Lines Matching refs:super
55 struct ext2_super_block *sb = fs->super; in calc_reserved_gdt_blocks()
89 struct ext2_super_block *super; in ext2fs_initialize() local
135 retval = ext2fs_get_mem(SUPERBLOCK_SIZE, &super); in ext2fs_initialize()
138 fs->super = super; in ext2fs_initialize()
140 memset(super, 0, SUPERBLOCK_SIZE); in ext2fs_initialize()
142 #define set_field(field, default) (super->field = param->field ? \ in ext2fs_initialize()
144 #define assign_field(field) (super->field = param->field) in ext2fs_initialize()
146 super->s_magic = EXT2_SUPER_MAGIC; in ext2fs_initialize()
147 super->s_state = EXT2_VALID_FS; in ext2fs_initialize()
155 set_field(s_log_cluster_size, super->s_log_block_size+4); in ext2fs_initialize()
156 if (super->s_log_block_size > super->s_log_cluster_size) { in ext2fs_initialize()
161 super->s_log_cluster_size = super->s_log_block_size; in ext2fs_initialize()
163 set_field(s_first_data_block, super->s_log_cluster_size ? 0 : 1); in ext2fs_initialize()
175 if (super->s_feature_incompat & ~EXT2_LIB_FEATURE_INCOMPAT_SUPP) { in ext2fs_initialize()
179 if (super->s_feature_ro_compat & ~EXT2_LIB_FEATURE_RO_COMPAT_SUPP) { in ext2fs_initialize()
185 if (super->s_rev_level >= EXT2_DYNAMIC_REV) { in ext2fs_initialize()
188 if (super->s_inode_size >= sizeof(struct ext2_inode_large)) { in ext2fs_initialize()
195 super->s_first_ino = EXT2_GOOD_OLD_FIRST_INO; in ext2fs_initialize()
196 super->s_inode_size = EXT2_GOOD_OLD_INODE_SIZE; in ext2fs_initialize()
200 super->s_mkfs_time = super->s_lastcheck = fs->now ? fs->now : time(NULL); in ext2fs_initialize()
202 super->s_creator_os = CREATOR_OS; in ext2fs_initialize()
204 fs->fragsize = fs->blocksize = EXT2_BLOCK_SIZE(super); in ext2fs_initialize()
205 fs->cluster_ratio_bits = super->s_log_cluster_size - in ext2fs_initialize()
206 super->s_log_block_size; in ext2fs_initialize()
221 super->s_clusters_per_group = in ext2fs_initialize()
224 else if (super->s_log_cluster_size + 15 < 32) in ext2fs_initialize()
225 super->s_clusters_per_group = fs->blocksize * 8; in ext2fs_initialize()
227 super->s_clusters_per_group = (fs->blocksize - 1) * 8; in ext2fs_initialize()
228 if (super->s_clusters_per_group > EXT2_MAX_CLUSTERS_PER_GROUP(super)) in ext2fs_initialize()
229 super->s_clusters_per_group = EXT2_MAX_CLUSTERS_PER_GROUP(super); in ext2fs_initialize()
231 (unsigned long long) super->s_clusters_per_group); in ext2fs_initialize()
236 super->s_blocks_per_group = bpg; in ext2fs_initialize()
239 if (super->s_blocks_per_group > EXT2_MAX_BLOCKS_PER_GROUP(super)) in ext2fs_initialize()
240 super->s_blocks_per_group = EXT2_MAX_BLOCKS_PER_GROUP(super); in ext2fs_initialize()
241 super->s_clusters_per_group = super->s_blocks_per_group; in ext2fs_initialize()
244 ext2fs_blocks_count_set(super, ext2fs_blocks_count(param) & in ext2fs_initialize()
246 ext2fs_r_blocks_count_set(super, ext2fs_r_blocks_count(param)); in ext2fs_initialize()
247 if (ext2fs_r_blocks_count(super) >= ext2fs_blocks_count(param)) { in ext2fs_initialize()
258 if (super->s_feature_incompat & EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) { in ext2fs_initialize()
267 ext2fs_blocks_count(super) - super->s_first_data_block, in ext2fs_initialize()
268 EXT2_BLOCKS_PER_GROUP(super)); in ext2fs_initialize()
275 super->s_feature_incompat & EXT4_FEATURE_INCOMPAT_64BIT ? in ext2fs_initialize()
279 EXT2_DESC_PER_BLOCK(super)); in ext2fs_initialize()
283 if (super->s_feature_incompat & EXT4_FEATURE_INCOMPAT_64BIT && in ext2fs_initialize()
284 (ext2fs_blocks_count(super) / i) > (1ULL << 32)) in ext2fs_initialize()
287 set_field(s_inodes_count, ext2fs_blocks_count(super) / i); in ext2fs_initialize()
293 if (super->s_inodes_count < EXT2_FIRST_INODE(super)+1) in ext2fs_initialize()
294 super->s_inodes_count = EXT2_FIRST_INODE(super)+1; in ext2fs_initialize()
302 ipg = ext2fs_div_ceil(super->s_inodes_count, fs->group_desc_count); in ext2fs_initialize()
304 if (!bigalloc_flag && super->s_blocks_per_group >= 256) { in ext2fs_initialize()
306 super->s_blocks_per_group -= 8; in ext2fs_initialize()
307 ext2fs_blocks_count_set(super, in ext2fs_initialize()
309 super->s_clusters_per_group = super->s_blocks_per_group; in ext2fs_initialize()
317 if (ipg > (unsigned) EXT2_MAX_INODES_PER_GROUP(super)) in ext2fs_initialize()
318 ipg = EXT2_MAX_INODES_PER_GROUP(super); in ext2fs_initialize()
321 super->s_inodes_per_group = ipg; in ext2fs_initialize()
328 fs->inode_blocks_per_group = (((super->s_inodes_per_group * in ext2fs_initialize()
329 EXT2_INODE_SIZE(super)) + in ext2fs_initialize()
330 EXT2_BLOCK_SIZE(super) - 1) / in ext2fs_initialize()
331 EXT2_BLOCK_SIZE(super)); in ext2fs_initialize()
332 super->s_inodes_per_group = ((fs->inode_blocks_per_group * in ext2fs_initialize()
333 EXT2_BLOCK_SIZE(super)) / in ext2fs_initialize()
334 EXT2_INODE_SIZE(super)); in ext2fs_initialize()
340 if (super->s_inodes_per_group < 8) in ext2fs_initialize()
341 super->s_inodes_per_group = 8; in ext2fs_initialize()
342 super->s_inodes_per_group &= ~7; in ext2fs_initialize()
343 fs->inode_blocks_per_group = (((super->s_inodes_per_group * in ext2fs_initialize()
344 EXT2_INODE_SIZE(super)) + in ext2fs_initialize()
345 EXT2_BLOCK_SIZE(super) - 1) / in ext2fs_initialize()
346 EXT2_BLOCK_SIZE(super)); in ext2fs_initialize()
351 if ((__u64)super->s_inodes_per_group * fs->group_desc_count > ~0U) { in ext2fs_initialize()
355 super->s_inodes_count = super->s_inodes_per_group * in ext2fs_initialize()
357 super->s_free_inodes_count = super->s_inodes_count; in ext2fs_initialize()
362 if (super->s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INODE) in ext2fs_initialize()
367 if (super->s_reserved_gdt_blocks > EXT2_ADDR_PER_BLOCK(super)) { in ext2fs_initialize()
379 fs->desc_blocks + super->s_reserved_gdt_blocks); in ext2fs_initialize()
382 if (overhead > super->s_blocks_per_group) { in ext2fs_initialize()
396 overhead += 1 + fs->desc_blocks + super->s_reserved_gdt_blocks; in ext2fs_initialize()
397 rem = ((ext2fs_blocks_count(super) - super->s_first_data_block) % in ext2fs_initialize()
398 super->s_blocks_per_group); in ext2fs_initialize()
404 ext2fs_blocks_count_set(super, ext2fs_blocks_count(super) - in ext2fs_initialize()
412 ext2fs_r_blocks_count_set(super, reserved_ratio * in ext2fs_initialize()
413 ext2fs_blocks_count(super) / 100.0); in ext2fs_initialize()
461 csum_flag = EXT2_HAS_RO_COMPAT_FEATURE(fs->super, in ext2fs_initialize()
463 reserved_inos = super->s_first_ino; in ext2fs_initialize()
474 numblocks = super->s_inodes_per_group; in ext2fs_initialize()
487 if (fs->super->s_log_groups_per_flex) in ext2fs_initialize()
492 ext2fs_bg_free_inodes_count_set(fs, i, fs->super->s_inodes_per_group); in ext2fs_initialize()
497 ext2fs_free_blocks_count_set(super, free_blocks); in ext2fs_initialize()
501 super->s_flags |= EXT2_FLAGS_SIGNED_HASH; in ext2fs_initialize()
503 super->s_flags |= EXT2_FLAGS_UNSIGNED_HASH; in ext2fs_initialize()