Lines Matching refs:vb
588 struct vblk *vb; in ldm_create_data_partitions() local
605 vb = list_entry (item, struct vblk, list); in ldm_create_data_partitions()
606 part = &vb->vblk.part; in ldm_create_data_partitions()
734 static bool ldm_parse_cmp3 (const u8 *buffer, int buflen, struct vblk *vb) in ldm_parse_cmp3() argument
739 BUG_ON (!buffer || !vb); in ldm_parse_cmp3()
763 comp = &vb->vblk.comp; in ldm_parse_cmp3()
785 static int ldm_parse_dgr3 (const u8 *buffer, int buflen, struct vblk *vb) in ldm_parse_dgr3() argument
790 BUG_ON (!buffer || !vb); in ldm_parse_dgr3()
812 dgrp = &vb->vblk.dgrp; in ldm_parse_dgr3()
829 static bool ldm_parse_dgr4 (const u8 *buffer, int buflen, struct vblk *vb) in ldm_parse_dgr4() argument
835 BUG_ON (!buffer || !vb); in ldm_parse_dgr4()
856 dgrp = &vb->vblk.dgrp; in ldm_parse_dgr4()
873 static bool ldm_parse_dsk3 (const u8 *buffer, int buflen, struct vblk *vb) in ldm_parse_dsk3() argument
878 BUG_ON (!buffer || !vb); in ldm_parse_dsk3()
892 disk = &vb->vblk.disk; in ldm_parse_dsk3()
912 static bool ldm_parse_dsk4 (const u8 *buffer, int buflen, struct vblk *vb) in ldm_parse_dsk4() argument
917 BUG_ON (!buffer || !vb); in ldm_parse_dsk4()
929 disk = &vb->vblk.disk; in ldm_parse_dsk4()
945 static bool ldm_parse_prt3(const u8 *buffer, int buflen, struct vblk *vb) in ldm_parse_prt3() argument
950 BUG_ON(!buffer || !vb); in ldm_parse_prt3()
997 part = &vb->vblk.part; in ldm_parse_prt3()
1003 if (vb->flags & VBLK_FLAG_PART_INDEX) in ldm_parse_prt3()
1021 static bool ldm_parse_vol5(const u8 *buffer, int buflen, struct vblk *vb) in ldm_parse_vol5() argument
1027 BUG_ON(!buffer || !vb); in ldm_parse_vol5()
1102 volu = &vb->vblk.volu; in ldm_parse_vol5()
1130 static bool ldm_parse_vblk (const u8 *buf, int len, struct vblk *vb) in ldm_parse_vblk() argument
1135 BUG_ON (!buf || !vb); in ldm_parse_vblk()
1143 vb->flags = buf[0x12]; in ldm_parse_vblk()
1144 vb->type = buf[0x13]; in ldm_parse_vblk()
1145 vb->obj_id = ldm_get_vnum (buf + 0x18); in ldm_parse_vblk()
1146 ldm_get_vstr (buf+0x18+r_objid, vb->name, sizeof (vb->name)); in ldm_parse_vblk()
1148 switch (vb->type) { in ldm_parse_vblk()
1149 case VBLK_CMP3: result = ldm_parse_cmp3 (buf, len, vb); break; in ldm_parse_vblk()
1150 case VBLK_DSK3: result = ldm_parse_dsk3 (buf, len, vb); break; in ldm_parse_vblk()
1151 case VBLK_DSK4: result = ldm_parse_dsk4 (buf, len, vb); break; in ldm_parse_vblk()
1152 case VBLK_DGR3: result = ldm_parse_dgr3 (buf, len, vb); break; in ldm_parse_vblk()
1153 case VBLK_DGR4: result = ldm_parse_dgr4 (buf, len, vb); break; in ldm_parse_vblk()
1154 case VBLK_PRT3: result = ldm_parse_prt3 (buf, len, vb); break; in ldm_parse_vblk()
1155 case VBLK_VOL5: result = ldm_parse_vol5 (buf, len, vb); break; in ldm_parse_vblk()
1160 (unsigned long long) vb->obj_id, vb->type); in ldm_parse_vblk()
1163 (unsigned long long) vb->obj_id, vb->type); in ldm_parse_vblk()
1184 struct vblk *vb; in ldm_ldmdb_add() local
1189 vb = kmalloc (sizeof (*vb), GFP_KERNEL); in ldm_ldmdb_add()
1190 if (!vb) { in ldm_ldmdb_add()
1195 if (!ldm_parse_vblk (data, len, vb)) { in ldm_ldmdb_add()
1196 kfree(vb); in ldm_ldmdb_add()
1201 switch (vb->type) { in ldm_ldmdb_add()
1204 list_add (&vb->list, &ldb->v_dgrp); in ldm_ldmdb_add()
1208 list_add (&vb->list, &ldb->v_disk); in ldm_ldmdb_add()
1211 list_add (&vb->list, &ldb->v_volu); in ldm_ldmdb_add()
1214 list_add (&vb->list, &ldb->v_comp); in ldm_ldmdb_add()
1220 if ((v->vblk.part.disk_id == vb->vblk.part.disk_id) && in ldm_ldmdb_add()
1221 (v->vblk.part.start > vb->vblk.part.start)) { in ldm_ldmdb_add()
1222 list_add_tail (&vb->list, &v->list); in ldm_ldmdb_add()
1226 list_add_tail (&vb->list, &ldb->v_part); in ldm_ldmdb_add()