Lines Matching full:vb
574 struct vblk *vb; in ldm_create_data_partitions() local
591 vb = list_entry (item, struct vblk, list); in ldm_create_data_partitions()
592 part = &vb->vblk.part; in ldm_create_data_partitions()
713 * @vb: In-memory vblk in which to return information
717 * Return: 'true' @vb contains a Component VBLK
718 * 'false' @vb contents are not defined
720 static bool ldm_parse_cmp3 (const u8 *buffer, int buflen, struct vblk *vb) in ldm_parse_cmp3() argument
725 BUG_ON (!buffer || !vb); in ldm_parse_cmp3()
749 comp = &vb->vblk.comp; in ldm_parse_cmp3()
764 * @vb: In-memory vblk in which to return information
768 * Return: 'true' @vb contains a Disk Group VBLK
769 * 'false' @vb contents are not defined
771 static int ldm_parse_dgr3 (const u8 *buffer, int buflen, struct vblk *vb) in ldm_parse_dgr3() argument
776 BUG_ON (!buffer || !vb); in ldm_parse_dgr3()
798 dgrp = &vb->vblk.dgrp; in ldm_parse_dgr3()
808 * @vb: In-memory vblk in which to return information
812 * Return: 'true' @vb contains a Disk Group VBLK
813 * 'false' @vb contents are not defined
815 static bool ldm_parse_dgr4 (const u8 *buffer, int buflen, struct vblk *vb) in ldm_parse_dgr4() argument
820 BUG_ON (!buffer || !vb); in ldm_parse_dgr4()
849 * @vb: In-memory vblk in which to return information
853 * Return: 'true' @vb contains a Disk VBLK
854 * 'false' @vb contents are not defined
856 static bool ldm_parse_dsk3 (const u8 *buffer, int buflen, struct vblk *vb) in ldm_parse_dsk3() argument
861 BUG_ON (!buffer || !vb); in ldm_parse_dsk3()
875 disk = &vb->vblk.disk; in ldm_parse_dsk3()
888 * @vb: In-memory vblk in which to return information
892 * Return: 'true' @vb contains a Disk VBLK
893 * 'false' @vb contents are not defined
895 static bool ldm_parse_dsk4 (const u8 *buffer, int buflen, struct vblk *vb) in ldm_parse_dsk4() argument
900 BUG_ON (!buffer || !vb); in ldm_parse_dsk4()
912 disk = &vb->vblk.disk; in ldm_parse_dsk4()
921 * @vb: In-memory vblk in which to return information
925 * Return: 'true' @vb contains a Partition VBLK
926 * 'false' @vb contents are not defined
928 static bool ldm_parse_prt3(const u8 *buffer, int buflen, struct vblk *vb) in ldm_parse_prt3() argument
933 BUG_ON(!buffer || !vb); in ldm_parse_prt3()
980 part = &vb->vblk.part; in ldm_parse_prt3()
986 if (vb->flags & VBLK_FLAG_PART_INDEX) in ldm_parse_prt3()
997 * @vb: In-memory vblk in which to return information
1001 * Return: 'true' @vb contains a Volume VBLK
1002 * 'false' @vb contents are not defined
1004 static bool ldm_parse_vol5(const u8 *buffer, int buflen, struct vblk *vb) in ldm_parse_vol5() argument
1010 BUG_ON(!buffer || !vb); in ldm_parse_vol5()
1085 volu = &vb->vblk.volu; in ldm_parse_vol5()
1104 * @vb: In-memory vblk in which to return information
1110 * Return: 'true' @vb contains a VBLK
1111 * 'false' @vb contents are not defined
1113 static bool ldm_parse_vblk (const u8 *buf, int len, struct vblk *vb) in ldm_parse_vblk() argument
1118 BUG_ON (!buf || !vb); in ldm_parse_vblk()
1126 vb->flags = buf[0x12]; in ldm_parse_vblk()
1127 vb->type = buf[0x13]; in ldm_parse_vblk()
1128 vb->obj_id = ldm_get_vnum (buf + 0x18); in ldm_parse_vblk()
1129 ldm_get_vstr (buf+0x18+r_objid, vb->name, sizeof (vb->name)); in ldm_parse_vblk()
1131 switch (vb->type) { in ldm_parse_vblk()
1132 case VBLK_CMP3: result = ldm_parse_cmp3 (buf, len, vb); break; in ldm_parse_vblk()
1133 case VBLK_DSK3: result = ldm_parse_dsk3 (buf, len, vb); break; in ldm_parse_vblk()
1134 case VBLK_DSK4: result = ldm_parse_dsk4 (buf, len, vb); break; in ldm_parse_vblk()
1135 case VBLK_DGR3: result = ldm_parse_dgr3 (buf, len, vb); break; in ldm_parse_vblk()
1136 case VBLK_DGR4: result = ldm_parse_dgr4 (buf, len, vb); break; in ldm_parse_vblk()
1137 case VBLK_PRT3: result = ldm_parse_prt3 (buf, len, vb); break; in ldm_parse_vblk()
1138 case VBLK_VOL5: result = ldm_parse_vol5 (buf, len, vb); break; in ldm_parse_vblk()
1143 (unsigned long long) vb->obj_id, vb->type); in ldm_parse_vblk()
1146 (unsigned long long) vb->obj_id, vb->type); in ldm_parse_vblk()
1167 struct vblk *vb; in ldm_ldmdb_add() local
1172 vb = kmalloc (sizeof (*vb), GFP_KERNEL); in ldm_ldmdb_add()
1173 if (!vb) { in ldm_ldmdb_add()
1178 if (!ldm_parse_vblk (data, len, vb)) { in ldm_ldmdb_add()
1179 kfree(vb); in ldm_ldmdb_add()
1184 switch (vb->type) { in ldm_ldmdb_add()
1187 list_add (&vb->list, &ldb->v_dgrp); in ldm_ldmdb_add()
1191 list_add (&vb->list, &ldb->v_disk); in ldm_ldmdb_add()
1194 list_add (&vb->list, &ldb->v_volu); in ldm_ldmdb_add()
1197 list_add (&vb->list, &ldb->v_comp); in ldm_ldmdb_add()
1203 if ((v->vblk.part.disk_id == vb->vblk.part.disk_id) && in ldm_ldmdb_add()
1204 (v->vblk.part.start > vb->vblk.part.start)) { in ldm_ldmdb_add()
1205 list_add_tail (&vb->list, &v->list); in ldm_ldmdb_add()
1209 list_add_tail (&vb->list, &ldb->v_part); in ldm_ldmdb_add()