Commit 13f184ec authored by mincheol's avatar mincheol
Browse files

sb extraction changed

parent 6fc7d118
......@@ -116,7 +116,7 @@ static int extractmd_ioctl(struct inode *inode, struct file *f, struct extractmd
/* super block in Group 0 */
bh_sb = __bread(bdev, 0, EXT4_BLOCK_SIZE(sb));
extractmd_write_file(path_super_block, bh_sb->b_data, EXT4_BLOCK_SIZE(sb));
extractmd_write_file(path_super_block, bh_sb->b_data + 1024, 1024);
//extractmd_write_file_per_group(path_super_block, bh_sb->b_data, EXT4_BLOCK_SIZE(sb), 0);
/* sparse super block v2? */
......@@ -127,37 +127,34 @@ static int extractmd_ioctl(struct inode *inode, struct file *f, struct extractmd
bh_redundant_sb1 = __bread(bdev, extractmd_group_first_block_no(sb, sbi->s_es->s_backup_bgs[0]), EXT4_BLOCK_SIZE(sb));
bh_redundant_sb2 = __bread(bdev, extractmd_group_first_block_no(sb, sbi->s_es->s_backup_bgs[1]), EXT4_BLOCK_SIZE(sb));
extractmd_append_file(path_super_block, bh_redundant_sb1->b_data, EXT4_BLOCK_SIZE(sb));
extractmd_append_file(path_super_block, bh_redundant_sb2->b_data, EXT4_BLOCK_SIZE(sb));
extractmd_append_file(path_super_block, bh_redundant_sb1->b_data, 1024);
extractmd_append_file(path_super_block, bh_redundant_sb2->b_data, 1024);
}
/* sparse super block? Yes -> then sb in group 0 or a power of 3, 5, or 7 */
else if((sbi->s_es->s_feature_ro_compat & 0x1) == 1)
{
unsigned long x,y,z;
struct buffer_head *bh_redundant_sb;
for (x = 1; extractmd_pow(3,x) < nr_group; x++)
{
bh_redundant_sb = __bread(bdev, extractmd_group_first_block_no(sb,extractmd_pow(3,x)), EXT4_BLOCK_SIZE(sb));
extractmd_append_file(path_super_block, bh_redundant_sb->b_data, EXT4_BLOCK_SIZE(sb));
extractmd_append_file(path_super_block, bh_redundant_sb->b_data, 1024);
}
for (y = 1; extractmd_pow(5,y) < nr_group; y++)
{
bh_redundant_sb = __bread(bdev, extractmd_group_first_block_no(sb,extractmd_pow(5,y)), EXT4_BLOCK_SIZE(sb));
extractmd_append_file(path_super_block, bh_redundant_sb->b_data, EXT4_BLOCK_SIZE(sb));
extractmd_append_file(path_super_block, bh_redundant_sb->b_data, 1024);
}
for (z = 1; extractmd_pow(7,z) < nr_group; z++)
{
bh_redundant_sb = __bread(bdev, extractmd_group_first_block_no(sb,extractmd_pow(7,z)), EXT4_BLOCK_SIZE(sb));
extractmd_append_file(path_super_block, bh_redundant_sb->b_data, EXT4_BLOCK_SIZE(sb));
extractmd_append_file(path_super_block, bh_redundant_sb->b_data, 1024);
}
}
else
......@@ -168,7 +165,7 @@ static int extractmd_ioctl(struct inode *inode, struct file *f, struct extractmd
for (k = 1; k < nr_group; k++)
{
bh_redundant_sb = __bread(bdev, extractmd_group_first_block_no(sb, k), EXT4_BLOCK_SIZE(sb));
extractmd_append_file(path_super_block, bh_redundant_sb->b_data, EXT4_BLOCK_SIZE(sb));
extractmd_append_file(path_super_block, bh_redundant_sb->b_data, 1024);
}
}
......
No preview for this file type
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment