Lines Matching refs:aux_info
49 struct fs_aux_info aux_info;
93 aux_info.first_data_block = (info.block_size > 1024) ? 0 : 1;
94 aux_info.len_blocks = info.len / info.block_size;
95 aux_info.inode_table_blocks = DIV_ROUND_UP(info.inodes_per_group * info.inode_size,
97 aux_info.groups = DIV_ROUND_UP(aux_info.len_blocks - aux_info.first_data_block,
99 aux_info.blocks_per_ind = info.block_size / sizeof(u32);
100 aux_info.blocks_per_dind = aux_info.blocks_per_ind * aux_info.blocks_per_ind;
101 aux_info.blocks_per_tind = aux_info.blocks_per_dind * aux_info.blocks_per_dind;
103 aux_info.bg_desc_blocks =
104 DIV_ROUND_UP(aux_info.groups * sizeof(struct ext2_group_desc),
107 aux_info.default_i_flags = EXT4_NOATIME_FL;
109 u32 last_group_size = aux_info.len_blocks % info.blocks_per_group;
110 u32 last_header_size = 2 + aux_info.inode_table_blocks;
111 if (ext4_bg_has_super_block(aux_info.groups - 1))
112 last_header_size += 1 + aux_info.bg_desc_blocks +
115 aux_info.groups--;
116 aux_info.len_blocks -= last_group_size;
119 aux_info.sb = calloc(info.block_size, 1);
121 aux_info.backup_sb = calloc(aux_info.groups, sizeof(char *));
123 if (!aux_info.sb)
126 aux_info.bg_desc = calloc(info.block_size, aux_info.bg_desc_blocks);
127 if (!aux_info.bg_desc)
129 aux_info.xattrs = NULL;
136 for (i=0; i<aux_info.groups; i++) {
137 if (aux_info.backup_sb[i])
138 free(aux_info.backup_sb[i]);
140 free(aux_info.sb);
141 free(aux_info.bg_desc);
148 struct ext4_super_block *sb = aux_info.sb;
150 sb->s_inodes_count = info.inodes_per_group * aux_info.groups;
151 sb->s_blocks_count_lo = aux_info.len_blocks;
155 sb->s_first_data_block = aux_info.first_data_block;
206 sb->s_blocks_count_hi = aux_info.len_blocks >> 32;
221 for (i = 0; i < aux_info.groups; i++) {
222 u64 group_start_block = aux_info.first_data_block + i *
227 aux_info.backup_sb[i] = calloc(info.block_size, 1);
228 memcpy(aux_info.backup_sb[i], sb, info.block_size);
230 aux_info.backup_sb[i]->s_block_group_nr = i;
231 sparse_file_add_data(info.sparse_file, aux_info.backup_sb[i],
234 sparse_file_add_data(info.sparse_file, aux_info.bg_desc,
235 aux_info.bg_desc_blocks * info.block_size,
237 header_size = 1 + aux_info.bg_desc_blocks + info.bg_desc_reserve_blocks;
240 aux_info.bg_desc[i].bg_block_bitmap = group_start_block + header_size;
241 aux_info.bg_desc[i].bg_inode_bitmap = group_start_block + header_size + 1;
242 aux_info.bg_desc[i].bg_inode_table = group_start_block + header_size + 2;
244 aux_info.bg_desc[i].bg_free_blocks_count = sb->s_blocks_per_group;
245 aux_info.bg_desc[i].bg_free_inodes_count = sb->s_inodes_per_group;
246 aux_info.bg_desc[i].bg_used_dirs_count = 0;
259 memcpy(buf + 1024, (u8*)aux_info.sb, 1024);
262 sparse_file_add_data(info.sparse_file, aux_info.sb, 1024, 1);
285 aux_info.len_blocks = ((u64)sb->s_blocks_count_hi << 32) +
287 info.len = (u64)info.block_size * aux_info.len_blocks;
291 memcpy(aux_info.sb, sb, sizeof(*sb));
293 if (aux_info.first_data_block != sb->s_first_data_block)
309 for (i = 0; i < aux_info.groups; i++) {
311 u64 group_start_block = aux_info.first_data_block + i *
314 aux_info.bg_desc_blocks;
360 memcpy(aux_info.sb->s_jnl_blocks, &inode->i_block, sizeof(inode->i_block));
369 for (i = 0; i < aux_info.groups; i++) {
374 aux_info.bg_desc[i].bg_free_blocks_count = bg_free_blocks;
375 aux_info.sb->s_free_blocks_count_lo += bg_free_blocks;
377 aux_info.bg_desc[i].bg_free_inodes_count = bg_free_inodes;
378 aux_info.sb->s_free_inodes_count += bg_free_inodes;
380 aux_info.bg_desc[i].bg_used_dirs_count += get_directories(i);
382 aux_info.bg_desc[i].bg_flags = get_bg_flags(i);
384 crc = ext4_crc16(~0, aux_info.sb->s_uuid, sizeof(aux_info.sb->s_uuid));
386 crc = ext4_crc16(crc, &aux_info.bg_desc[i], offsetof(struct ext2_group_desc, bg_checksum));
387 aux_info.bg_desc[i].bg_checksum = crc;