Lines Matching defs:sb

118 	aux_info.sb = calloc(info.block_size, 1);
122 if (!aux_info.sb)
138 free(aux_info.sb);
146 struct ext4_super_block *sb = aux_info.sb;
148 sb->s_inodes_count = info.inodes_per_group * aux_info.groups;
149 sb->s_blocks_count_lo = aux_info.len_blocks;
150 sb->s_r_blocks_count_lo = 0;
151 sb->s_free_blocks_count_lo = 0;
152 sb->s_free_inodes_count = 0;
153 sb->s_first_data_block = aux_info.first_data_block;
154 sb->s_log_block_size = log_2(info.block_size / 1024);
155 sb->s_obso_log_frag_size = log_2(info.block_size / 1024);
156 sb->s_blocks_per_group = info.blocks_per_group;
157 sb->s_obso_frags_per_group = info.blocks_per_group;
158 sb->s_inodes_per_group = info.inodes_per_group;
159 sb->s_mtime = 0;
160 sb->s_wtime = 0;
161 sb->s_mnt_count = 0;
162 sb->s_max_mnt_count = 0xFFFF;
163 sb->s_magic = EXT4_SUPER_MAGIC;
164 sb->s_state = EXT4_VALID_FS;
165 sb->s_errors = EXT4_ERRORS_RO;
166 sb->s_minor_rev_level = 0;
167 sb->s_lastcheck = 0;
168 sb->s_checkinterval = 0;
169 sb->s_creator_os = EXT4_OS_LINUX;
170 sb->s_rev_level = EXT4_DYNAMIC_REV;
171 sb->s_def_resuid = EXT4_DEF_RESUID;
172 sb->s_def_resgid = EXT4_DEF_RESGID;
174 sb->s_first_ino = EXT4_GOOD_OLD_FIRST_INO;
175 sb->s_inode_size = info.inode_size;
176 sb->s_block_group_nr = 0;
177 sb->s_feature_compat = info.feat_compat;
178 sb->s_feature_incompat = info.feat_incompat;
179 sb->s_feature_ro_compat = info.feat_ro_compat;
180 generate_uuid("extandroid/make_ext4fs", info.label, sb->s_uuid);
181 memset(sb->s_volume_name, 0, sizeof(sb->s_volume_name));
182 strncpy(sb->s_volume_name, info.label, sizeof(sb->s_volume_name));
183 memset(sb->s_last_mounted, 0, sizeof(sb->s_last_mounted));
184 sb->s_algorithm_usage_bitmap = 0;
186 sb->s_reserved_gdt_blocks = info.bg_desc_reserve_blocks;
187 sb->s_prealloc_blocks = 0;
188 sb->s_prealloc_dir_blocks = 0;
190 //memcpy(sb->s_journal_uuid, sb->s_uuid, sizeof(sb->s_journal_uuid));
192 sb->s_journal_inum = EXT4_JOURNAL_INO;
193 sb->s_journal_dev = 0;
194 sb->s_last_orphan = 0;
195 sb->s_hash_seed[0] = 0; /* FIXME */
196 sb->s_def_hash_version = DX_HASH_TEA;
197 sb->s_reserved_char_pad = EXT4_JNL_BACKUP_BLOCKS;
198 sb->s_desc_size = sizeof(struct ext2_group_desc);
199 sb->s_default_mount_opts = 0; /* FIXME */
200 sb->s_first_meta_bg = 0;
201 sb->s_mkfs_time = 0;
202 //sb->s_jnl_blocks[17]; /* FIXME */
204 sb->s_blocks_count_hi = aux_info.len_blocks >> 32;
205 sb->s_r_blocks_count_hi = 0;
206 sb->s_free_blocks_count_hi = 0;
207 sb->s_min_extra_isize = sizeof(struct ext4_inode) -
209 sb->s_want_extra_isize = sizeof(struct ext4_inode) -
211 sb->s_flags = 0;
212 sb->s_raid_stride = 0;
213 sb->s_mmp_interval = 0;
214 sb->s_mmp_block = 0;
215 sb->s_raid_stripe_width = 0;
216 sb->s_log_groups_per_flex = 0;
217 sb->s_kbytes_written = 0;
226 memcpy(aux_info.backup_sb[i], sb, info.block_size);
242 aux_info.bg_desc[i].bg_free_blocks_count = sb->s_blocks_per_group;
243 aux_info.bg_desc[i].bg_free_inodes_count = sb->s_inodes_per_group;
257 memcpy(buf + 1024, (u8*)aux_info.sb, 1024);
260 sparse_file_add_data(info.sparse_file, aux_info.sb, 1024, 1);
264 void ext4_parse_sb(struct ext4_super_block *sb)
266 if (sb->s_magic != EXT4_SUPER_MAGIC)
269 if ((sb->s_state & EXT4_VALID_FS) != EXT4_VALID_FS)
272 info.block_size = 1024 << sb->s_log_block_size;
273 info.blocks_per_group = sb->s_blocks_per_group;
274 info.inodes_per_group = sb->s_inodes_per_group;
275 info.inode_size = sb->s_inode_size;
276 info.inodes = sb->s_inodes_count;
277 info.feat_ro_compat = sb->s_feature_ro_compat;
278 info.feat_compat = sb->s_feature_compat;
279 info.feat_incompat = sb->s_feature_incompat;
280 info.bg_desc_reserve_blocks = sb->s_reserved_gdt_blocks;
281 info.label = sb->s_volume_name;
283 aux_info.len_blocks = ((u64)sb->s_blocks_count_hi << 32) +
284 sb->s_blocks_count_lo;
289 memcpy(aux_info.sb, sb, sizeof(*sb));
291 if (aux_info.first_data_block != sb->s_first_data_block)
358 memcpy(aux_info.sb->s_jnl_blocks, &inode->i_block, sizeof(inode->i_block));
372 aux_info.sb->s_free_blocks_count_lo += bg_free_blocks;
375 aux_info.sb->s_free_inodes_count += bg_free_inodes;