Commit 29ba1723 authored by Glauber de Oliveira Costa's avatar Glauber de Oliveira Costa Committed by Linus Torvalds
Browse files

[PATCH] ext3: use sbi instead of EXT3_SB() in resize code.



There are places in the resize code in which EXT3_SB() macro is used after
an statement like sbi = EXT3_SB(sb) is done.  Inside the same function,
both sbi and EXT3_SB() are used to reference the super block Altough it is
not wrong, keeping it coherent increases legibility, IMHO.
Signed-off-by: default avatarGlauber de Oliveira Costa <glommer@br.ibm.com>
Cc: "Stephen C. Tweedie" <sct@redhat.com>
Cc: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9f40668d
...@@ -31,7 +31,7 @@ static int verify_group_input(struct super_block *sb, ...@@ -31,7 +31,7 @@ static int verify_group_input(struct super_block *sb,
unsigned start = le32_to_cpu(es->s_blocks_count); unsigned start = le32_to_cpu(es->s_blocks_count);
unsigned end = start + input->blocks_count; unsigned end = start + input->blocks_count;
unsigned group = input->group; unsigned group = input->group;
unsigned itend = input->inode_table + EXT3_SB(sb)->s_itb_per_group; unsigned itend = input->inode_table + sbi->s_itb_per_group;
unsigned overhead = ext3_bg_has_super(sb, group) ? unsigned overhead = ext3_bg_has_super(sb, group) ?
(1 + ext3_bg_num_gdb(sb, group) + (1 + ext3_bg_num_gdb(sb, group) +
le16_to_cpu(es->s_reserved_gdt_blocks)) : 0; le16_to_cpu(es->s_reserved_gdt_blocks)) : 0;
...@@ -764,7 +764,7 @@ int ext3_group_add(struct super_block *sb, struct ext3_new_group_data *input) ...@@ -764,7 +764,7 @@ int ext3_group_add(struct super_block *sb, struct ext3_new_group_data *input)
} }
lock_super(sb); lock_super(sb);
if (input->group != EXT3_SB(sb)->s_groups_count) { if (input->group != sbi->s_groups_count) {
ext3_warning(sb, __FUNCTION__, ext3_warning(sb, __FUNCTION__,
"multiple resizers run on filesystem!"); "multiple resizers run on filesystem!");
err = -EBUSY; err = -EBUSY;
...@@ -799,7 +799,7 @@ int ext3_group_add(struct super_block *sb, struct ext3_new_group_data *input) ...@@ -799,7 +799,7 @@ int ext3_group_add(struct super_block *sb, struct ext3_new_group_data *input)
* data. So we need to be careful to set all of the relevant * data. So we need to be careful to set all of the relevant
* group descriptor data etc. *before* we enable the group. * group descriptor data etc. *before* we enable the group.
* *
* The key field here is EXT3_SB(sb)->s_groups_count: as long as * The key field here is sbi->s_groups_count: as long as
* that retains its old value, nobody is going to access the new * that retains its old value, nobody is going to access the new
* group. * group.
* *
...@@ -859,7 +859,7 @@ int ext3_group_add(struct super_block *sb, struct ext3_new_group_data *input) ...@@ -859,7 +859,7 @@ int ext3_group_add(struct super_block *sb, struct ext3_new_group_data *input)
smp_wmb(); smp_wmb();
/* Update the global fs size fields */ /* Update the global fs size fields */
EXT3_SB(sb)->s_groups_count++; sbi->s_groups_count++;
ext3_journal_dirty_metadata(handle, primary); ext3_journal_dirty_metadata(handle, primary);
...@@ -874,7 +874,7 @@ int ext3_group_add(struct super_block *sb, struct ext3_new_group_data *input) ...@@ -874,7 +874,7 @@ int ext3_group_add(struct super_block *sb, struct ext3_new_group_data *input)
percpu_counter_mod(&sbi->s_freeinodes_counter, percpu_counter_mod(&sbi->s_freeinodes_counter,
EXT3_INODES_PER_GROUP(sb)); EXT3_INODES_PER_GROUP(sb));
ext3_journal_dirty_metadata(handle, EXT3_SB(sb)->s_sbh); ext3_journal_dirty_metadata(handle, sbi->s_sbh);
sb->s_dirt = 1; sb->s_dirt = 1;
exit_journal: exit_journal:
......
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