Lines Matching full:mi

42 static struct bch_member members_v2_get(struct bch_sb_field_members_v2 *mi, int i)  in members_v2_get()  argument
44 struct bch_member ret, *p = __bch2_members_v2_get_mut(mi, i); in members_v2_get()
46 memcpy(&ret, p, min_t(size_t, le16_to_cpu(mi->member_bytes), sizeof(ret))); in members_v2_get()
50 static struct bch_member *members_v1_get_mut(struct bch_sb_field_members_v1 *mi, int i) in members_v1_get_mut() argument
52 return (void *) mi->_members + (i * BCH_MEMBER_V1_BYTES); in members_v1_get_mut()
55 static struct bch_member members_v1_get(struct bch_sb_field_members_v1 *mi, int i) in members_v1_get() argument
57 struct bch_member ret, *p = members_v1_get_mut(mi, i); in members_v1_get()
74 struct bch_sb_field_members_v2 *mi = bch2_sb_field_get(c->disk_sb.sb, members_v2); in sb_members_v2_resize_entries() local
76 if (le16_to_cpu(mi->member_bytes) < sizeof(struct bch_member)) { in sb_members_v2_resize_entries()
77 unsigned u64s = DIV_ROUND_UP((sizeof(*mi) + sizeof(mi->_members[0]) * in sb_members_v2_resize_entries()
80 mi = bch2_sb_field_resize(&c->disk_sb, members_v2, u64s); in sb_members_v2_resize_entries()
81 if (!mi) in sb_members_v2_resize_entries()
85 void *dst = (void *) mi->_members + (i * sizeof(struct bch_member)); in sb_members_v2_resize_entries()
86 memmove(dst, __bch2_members_v2_get_mut(mi, i), le16_to_cpu(mi->member_bytes)); in sb_members_v2_resize_entries()
87 memset(dst + le16_to_cpu(mi->member_bytes), in sb_members_v2_resize_entries()
88 0, (sizeof(struct bch_member) - le16_to_cpu(mi->member_bytes))); in sb_members_v2_resize_entries()
90 mi->member_bytes = cpu_to_le16(sizeof(struct bch_member)); in sb_members_v2_resize_entries()
276 struct bch_sb_field_members_v1 *mi = field_to_type(f, members_v1); in bch2_sb_members_v1_validate() local
279 if ((void *) members_v1_get_mut(mi, sb->nr_devices) > vstruct_end(&mi->field)) { in bch2_sb_members_v1_validate()
285 struct bch_member m = members_v1_get(mi, i); in bch2_sb_members_v1_validate()
298 struct bch_sb_field_members_v1 *mi = field_to_type(f, members_v1); in bch2_sb_members_v1_to_text() local
303 member_to_text(out, members_v1_get(mi, i), gi, sb, i); in bch2_sb_members_v1_to_text()
314 struct bch_sb_field_members_v2 *mi = field_to_type(f, members_v2); in bch2_sb_members_v2_to_text() local
319 member_to_text(out, members_v2_get(mi, i), gi, sb, i); in bch2_sb_members_v2_to_text()
325 struct bch_sb_field_members_v2 *mi = field_to_type(f, members_v2); in bch2_sb_members_v2_validate() local
326 size_t mi_bytes = (void *) __bch2_members_v2_get_mut(mi, sb->nr_devices) - in bch2_sb_members_v2_validate()
327 (void *) mi; in bch2_sb_members_v2_validate()
329 if (mi_bytes > vstruct_bytes(&mi->field)) { in bch2_sb_members_v2_validate()
331 mi_bytes, vstruct_bytes(&mi->field)); in bch2_sb_members_v2_validate()
336 int ret = validate_member(err, members_v2_get(mi, i), sb, i); in bch2_sb_members_v2_validate()
351 struct bch_sb_field_members_v2 *mi = bch2_sb_field_get(c->disk_sb.sb, members_v2); in bch2_sb_members_from_cpu() local
355 struct bch_member *m = __bch2_members_v2_get_mut(mi, ca->dev_idx); in bch2_sb_members_from_cpu()
434 static void __bch2_dev_btree_bitmap_mark(struct bch_sb_field_members_v2 *mi, unsigned dev, in __bch2_dev_btree_bitmap_mark() argument
437 struct bch_member *m = __bch2_members_v2_get_mut(mi, dev); in __bch2_dev_btree_bitmap_mark()
468 struct bch_sb_field_members_v2 *mi = bch2_sb_field_get(c->disk_sb.sb, members_v2); in bch2_dev_btree_bitmap_mark() local
473 __bch2_dev_btree_bitmap_mark(mi, ptr->dev, ptr->offset, btree_sectors(c)); in bch2_dev_btree_bitmap_mark()
489 struct bch_sb_field_members_v2 *mi; in bch2_sb_member_alloc() local
522 mi = bch2_sb_field_get(c->disk_sb.sb, members_v2); in bch2_sb_member_alloc()
524 le16_to_cpu(mi->member_bytes) * nr_devices, sizeof(u64)); in bch2_sb_member_alloc()
526 mi = bch2_sb_field_resize(&c->disk_sb, members_v2, u64s); in bch2_sb_member_alloc()
527 if (!mi) in bch2_sb_member_alloc()