Lines Matching refs:super
68 struct ext2_super_block *sb = fs->super; in calc_reserved_gdt_blocks()
98 struct ext2_super_block *super; in ext2fs_initialize() local
138 retval = ext2fs_get_mem(SUPERBLOCK_SIZE, &super); in ext2fs_initialize()
141 fs->super = super; in ext2fs_initialize()
143 memset(super, 0, SUPERBLOCK_SIZE); in ext2fs_initialize()
145 #define set_field(field, default) (super->field = param->field ? \ in ext2fs_initialize()
148 super->s_magic = EXT2_SUPER_MAGIC; in ext2fs_initialize()
149 super->s_state = EXT2_VALID_FS; in ext2fs_initialize()
153 set_field(s_first_data_block, super->s_log_block_size ? 0 : 1); in ext2fs_initialize()
164 if (super->s_feature_incompat & ~EXT2_LIB_FEATURE_INCOMPAT_SUPP) { in ext2fs_initialize()
168 if (super->s_feature_ro_compat & ~EXT2_LIB_FEATURE_RO_COMPAT_SUPP) { in ext2fs_initialize()
174 if (super->s_rev_level >= EXT2_DYNAMIC_REV) { in ext2fs_initialize()
177 if (super->s_inode_size >= sizeof(struct ext2_inode_large)) { in ext2fs_initialize()
184 super->s_first_ino = EXT2_GOOD_OLD_FIRST_INO; in ext2fs_initialize()
185 super->s_inode_size = EXT2_GOOD_OLD_INODE_SIZE; in ext2fs_initialize()
189 super->s_mkfs_time = super->s_lastcheck = fs->now ? fs->now : time(NULL); in ext2fs_initialize()
191 super->s_creator_os = CREATOR_OS; in ext2fs_initialize()
193 fs->blocksize = EXT2_BLOCK_SIZE(super); in ext2fs_initialize()
194 fs->fragsize = EXT2_FRAG_SIZE(super); in ext2fs_initialize()
199 if (super->s_blocks_per_group > EXT2_MAX_BLOCKS_PER_GROUP(super)) in ext2fs_initialize()
200 super->s_blocks_per_group = EXT2_MAX_BLOCKS_PER_GROUP(super); in ext2fs_initialize()
201 super->s_frags_per_group = super->s_blocks_per_group * frags_per_block; in ext2fs_initialize()
203 super->s_blocks_count = param->s_blocks_count; in ext2fs_initialize()
204 super->s_r_blocks_count = param->s_r_blocks_count; in ext2fs_initialize()
205 if (super->s_r_blocks_count >= param->s_blocks_count) { in ext2fs_initialize()
214 if (super->s_feature_incompat & EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) { in ext2fs_initialize()
222 fs->group_desc_count = ext2fs_div_ceil(super->s_blocks_count - in ext2fs_initialize()
223 super->s_first_data_block, in ext2fs_initialize()
224 EXT2_BLOCKS_PER_GROUP(super)); in ext2fs_initialize()
230 EXT2_DESC_PER_BLOCK(super)); in ext2fs_initialize()
233 set_field(s_inodes_count, super->s_blocks_count / i); in ext2fs_initialize()
239 if (super->s_inodes_count < EXT2_FIRST_INODE(super)+1) in ext2fs_initialize()
240 super->s_inodes_count = EXT2_FIRST_INODE(super)+1; in ext2fs_initialize()
248 ipg = ext2fs_div_ceil(super->s_inodes_count, fs->group_desc_count); in ext2fs_initialize()
250 if (super->s_blocks_per_group >= 256) { in ext2fs_initialize()
252 super->s_blocks_per_group -= 8; in ext2fs_initialize()
253 super->s_blocks_count = param->s_blocks_count; in ext2fs_initialize()
254 super->s_frags_per_group = super->s_blocks_per_group * in ext2fs_initialize()
263 if (ipg > (unsigned) EXT2_MAX_INODES_PER_GROUP(super)) in ext2fs_initialize()
264 ipg = EXT2_MAX_INODES_PER_GROUP(super); in ext2fs_initialize()
267 super->s_inodes_per_group = ipg; in ext2fs_initialize()
274 fs->inode_blocks_per_group = (((super->s_inodes_per_group * in ext2fs_initialize()
275 EXT2_INODE_SIZE(super)) + in ext2fs_initialize()
276 EXT2_BLOCK_SIZE(super) - 1) / in ext2fs_initialize()
277 EXT2_BLOCK_SIZE(super)); in ext2fs_initialize()
278 super->s_inodes_per_group = ((fs->inode_blocks_per_group * in ext2fs_initialize()
279 EXT2_BLOCK_SIZE(super)) / in ext2fs_initialize()
280 EXT2_INODE_SIZE(super)); in ext2fs_initialize()
286 super->s_inodes_per_group &= ~7; in ext2fs_initialize()
287 fs->inode_blocks_per_group = (((super->s_inodes_per_group * in ext2fs_initialize()
288 EXT2_INODE_SIZE(super)) + in ext2fs_initialize()
289 EXT2_BLOCK_SIZE(super) - 1) / in ext2fs_initialize()
290 EXT2_BLOCK_SIZE(super)); in ext2fs_initialize()
295 if ((__u64)super->s_inodes_per_group * fs->group_desc_count > ~0U) { in ext2fs_initialize()
299 super->s_inodes_count = super->s_inodes_per_group * in ext2fs_initialize()
301 super->s_free_inodes_count = super->s_inodes_count; in ext2fs_initialize()
306 if (super->s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INODE) in ext2fs_initialize()
311 if (super->s_reserved_gdt_blocks > EXT2_ADDR_PER_BLOCK(super)) { in ext2fs_initialize()
323 fs->desc_blocks + super->s_reserved_gdt_blocks); in ext2fs_initialize()
326 if (overhead > super->s_blocks_per_group) { in ext2fs_initialize()
340 overhead += 1 + fs->desc_blocks + super->s_reserved_gdt_blocks; in ext2fs_initialize()
341 rem = ((super->s_blocks_count - super->s_first_data_block) % in ext2fs_initialize()
342 super->s_blocks_per_group); in ext2fs_initialize()
348 super->s_blocks_count -= rem; in ext2fs_initialize()
394 super->s_free_blocks_count = 0; in ext2fs_initialize()
395 csum_flag = EXT2_HAS_RO_COMPAT_FEATURE(fs->super, in ext2fs_initialize()
407 numblocks = super->s_inodes_per_group; in ext2fs_initialize()
409 numblocks -= super->s_first_ino; in ext2fs_initialize()
413 if (fs->super->s_log_groups_per_flex) in ext2fs_initialize()
416 super->s_free_blocks_count += numblocks; in ext2fs_initialize()
419 fs->super->s_inodes_per_group; in ext2fs_initialize()
426 super->s_flags |= EXT2_FLAGS_SIGNED_HASH; in ext2fs_initialize()
428 super->s_flags |= EXT2_FLAGS_UNSIGNED_HASH; in ext2fs_initialize()