Lines Matching full:sb
23 struct super_block sb; member
27 #define MBT_CTX(_sb) (&(container_of((_sb), struct mbt_ext4_super_block, sb)->mbt_ctx))
40 fsb->sb.s_fs_info = sbi; in mbt_ext4_alloc_super_block()
41 return &fsb->sb; in mbt_ext4_alloc_super_block()
50 static void mbt_ext4_free_super_block(struct super_block *sb) in mbt_ext4_free_super_block() argument
53 container_of(sb, struct mbt_ext4_super_block, sb); in mbt_ext4_free_super_block()
54 struct ext4_sb_info *sbi = EXT4_SB(sb); in mbt_ext4_free_super_block()
69 static void mbt_init_sb_layout(struct super_block *sb, in mbt_init_sb_layout() argument
72 struct ext4_sb_info *sbi = EXT4_SB(sb); in mbt_init_sb_layout()
75 sb->s_blocksize = 1UL << layout->blocksize_bits; in mbt_init_sb_layout()
76 sb->s_blocksize_bits = layout->blocksize_bits; in mbt_init_sb_layout()
91 static int mbt_grp_ctx_init(struct super_block *sb, in mbt_grp_ctx_init() argument
94 grp_ctx->bitmap_bh.b_data = kzalloc(EXT4_BLOCK_SIZE(sb), GFP_KERNEL); in mbt_grp_ctx_init()
107 static void mbt_ctx_mark_used(struct super_block *sb, ext4_group_t group, in mbt_ctx_mark_used() argument
110 struct mbt_grp_ctx *grp_ctx = MBT_GRP_CTX(sb, group); in mbt_ctx_mark_used()
116 static int mbt_ctx_init(struct super_block *sb) in mbt_ctx_init() argument
118 struct mbt_ctx *ctx = MBT_CTX(sb); in mbt_ctx_init()
119 ext4_group_t i, ngroups = ext4_get_groups_count(sb); in mbt_ctx_init()
127 if (mbt_grp_ctx_init(sb, &ctx->grp_ctx[i])) in mbt_ctx_init()
145 static void mbt_ctx_release(struct super_block *sb) in mbt_ctx_release() argument
147 struct mbt_ctx *ctx = MBT_CTX(sb); in mbt_ctx_release()
148 ext4_group_t i, ngroups = ext4_get_groups_count(sb); in mbt_ctx_release()
156 ext4_read_block_bitmap_nowait_stub(struct super_block *sb, ext4_group_t block_group, in ext4_read_block_bitmap_nowait_stub() argument
159 struct mbt_grp_ctx *grp_ctx = MBT_GRP_CTX(sb, block_group); in ext4_read_block_bitmap_nowait_stub()
166 static int ext4_wait_block_bitmap_stub(struct super_block *sb, in ext4_wait_block_bitmap_stub() argument
174 ext4_get_group_desc_stub(struct super_block *sb, ext4_group_t block_group, in ext4_get_group_desc_stub() argument
177 struct mbt_grp_ctx *grp_ctx = MBT_GRP_CTX(sb, block_group); in ext4_get_group_desc_stub()
186 ext4_mb_mark_context_stub(handle_t *handle, struct super_block *sb, bool state, in ext4_mb_mark_context_stub() argument
191 struct mbt_grp_ctx *grp_ctx = MBT_GRP_CTX(sb, group); in ext4_mb_mark_context_stub()
207 struct super_block *sb; in mbt_kunit_init() local
210 sb = mbt_ext4_alloc_super_block(); in mbt_kunit_init()
211 if (sb == NULL) in mbt_kunit_init()
214 mbt_init_sb_layout(sb, layout); in mbt_kunit_init()
216 ret = mbt_ctx_init(sb); in mbt_kunit_init()
218 mbt_ext4_free_super_block(sb); in mbt_kunit_init()
222 test->priv = sb; in mbt_kunit_init()
240 struct super_block *sb = (struct super_block *)test->priv; in mbt_kunit_exit() local
242 mbt_ctx_release(sb); in mbt_kunit_exit()
243 mbt_ext4_free_super_block(sb); in mbt_kunit_exit()
248 struct super_block *sb = (struct super_block *)test->priv; in test_new_blocks_simple() local
249 struct inode inode = { .i_sb = sb, }; in test_new_blocks_simple()
254 struct ext4_sb_info *sbi = EXT4_SB(sb); in test_new_blocks_simple()
259 ar.goal = ext4_group_first_block_no(sb, goal_group); in test_new_blocks_simple()
266 ar.goal = ext4_group_first_block_no(sb, goal_group); in test_new_blocks_simple()
273 mbt_ctx_mark_used(sb, goal_group, 0, EXT4_CLUSTERS_PER_GROUP(sb)); in test_new_blocks_simple()
274 ar.goal = ext4_group_first_block_no(sb, goal_group); in test_new_blocks_simple()
277 ext4_group_first_block_no(sb, goal_group + 1), found, in test_new_blocks_simple()
279 ext4_group_first_block_no(sb, goal_group + 1), found); in test_new_blocks_simple()
282 for (i = goal_group; i < ext4_get_groups_count(sb); i++) in test_new_blocks_simple()
283 mbt_ctx_mark_used(sb, i, 0, EXT4_CLUSTERS_PER_GROUP(sb)); in test_new_blocks_simple()
284 ar.goal = ext4_group_first_block_no(sb, goal_group); in test_new_blocks_simple()
287 ext4_group_first_block_no(sb, 0) + EXT4_C2B(sbi, 1), found, in test_new_blocks_simple()
289 ext4_group_first_block_no(sb, 0 + EXT4_C2B(sbi, 1)), found); in test_new_blocks_simple()
292 for (i = 0; i < ext4_get_groups_count(sb); i++) in test_new_blocks_simple()
293 mbt_ctx_mark_used(sb, i, 0, EXT4_CLUSTERS_PER_GROUP(sb)); in test_new_blocks_simple()
294 ar.goal = ext4_group_first_block_no(sb, goal_group); in test_new_blocks_simple()