remove unused bh in calls to ext234_get_group_desc
ext[234]_get_group_desc never tests the bh argument, and only sets it if it is passed in; it is perfectly happy with a NULL bh argument. But, many callers send one in and never use it. May as well call with NULL like other callers who don't use the bh. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Cc: <linux-ext4@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
74bf17cffc
commit
ef2fb67989
@ -204,14 +204,13 @@ static int find_group_dir(struct super_block *sb, struct inode *parent)
|
||||
int ngroups = EXT3_SB(sb)->s_groups_count;
|
||||
unsigned int freei, avefreei;
|
||||
struct ext3_group_desc *desc, *best_desc = NULL;
|
||||
struct buffer_head *bh;
|
||||
int group, best_group = -1;
|
||||
|
||||
freei = percpu_counter_read_positive(&EXT3_SB(sb)->s_freeinodes_counter);
|
||||
avefreei = freei / ngroups;
|
||||
|
||||
for (group = 0; group < ngroups; group++) {
|
||||
desc = ext3_get_group_desc (sb, group, &bh);
|
||||
desc = ext3_get_group_desc (sb, group, NULL);
|
||||
if (!desc || !desc->bg_free_inodes_count)
|
||||
continue;
|
||||
if (le16_to_cpu(desc->bg_free_inodes_count) < avefreei)
|
||||
@ -269,7 +268,6 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent)
|
||||
ext3_grpblk_t min_blocks;
|
||||
int group = -1, i;
|
||||
struct ext3_group_desc *desc;
|
||||
struct buffer_head *bh;
|
||||
|
||||
freei = percpu_counter_read_positive(&sbi->s_freeinodes_counter);
|
||||
avefreei = freei / ngroups;
|
||||
@ -286,7 +284,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent)
|
||||
parent_group = (unsigned)group % ngroups;
|
||||
for (i = 0; i < ngroups; i++) {
|
||||
group = (parent_group + i) % ngroups;
|
||||
desc = ext3_get_group_desc (sb, group, &bh);
|
||||
desc = ext3_get_group_desc (sb, group, NULL);
|
||||
if (!desc || !desc->bg_free_inodes_count)
|
||||
continue;
|
||||
if (le16_to_cpu(desc->bg_used_dirs_count) >= best_ndir)
|
||||
@ -319,7 +317,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent)
|
||||
|
||||
for (i = 0; i < ngroups; i++) {
|
||||
group = (parent_group + i) % ngroups;
|
||||
desc = ext3_get_group_desc (sb, group, &bh);
|
||||
desc = ext3_get_group_desc (sb, group, NULL);
|
||||
if (!desc || !desc->bg_free_inodes_count)
|
||||
continue;
|
||||
if (le16_to_cpu(desc->bg_used_dirs_count) >= max_dirs)
|
||||
@ -334,7 +332,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent)
|
||||
fallback:
|
||||
for (i = 0; i < ngroups; i++) {
|
||||
group = (parent_group + i) % ngroups;
|
||||
desc = ext3_get_group_desc (sb, group, &bh);
|
||||
desc = ext3_get_group_desc (sb, group, NULL);
|
||||
if (!desc || !desc->bg_free_inodes_count)
|
||||
continue;
|
||||
if (le16_to_cpu(desc->bg_free_inodes_count) >= avefreei)
|
||||
@ -358,14 +356,13 @@ static int find_group_other(struct super_block *sb, struct inode *parent)
|
||||
int parent_group = EXT3_I(parent)->i_block_group;
|
||||
int ngroups = EXT3_SB(sb)->s_groups_count;
|
||||
struct ext3_group_desc *desc;
|
||||
struct buffer_head *bh;
|
||||
int group, i;
|
||||
|
||||
/*
|
||||
* Try to place the inode in its parent directory
|
||||
*/
|
||||
group = parent_group;
|
||||
desc = ext3_get_group_desc (sb, group, &bh);
|
||||
desc = ext3_get_group_desc (sb, group, NULL);
|
||||
if (desc && le16_to_cpu(desc->bg_free_inodes_count) &&
|
||||
le16_to_cpu(desc->bg_free_blocks_count))
|
||||
return group;
|
||||
@ -389,7 +386,7 @@ static int find_group_other(struct super_block *sb, struct inode *parent)
|
||||
group += i;
|
||||
if (group >= ngroups)
|
||||
group -= ngroups;
|
||||
desc = ext3_get_group_desc (sb, group, &bh);
|
||||
desc = ext3_get_group_desc (sb, group, NULL);
|
||||
if (desc && le16_to_cpu(desc->bg_free_inodes_count) &&
|
||||
le16_to_cpu(desc->bg_free_blocks_count))
|
||||
return group;
|
||||
@ -403,7 +400,7 @@ static int find_group_other(struct super_block *sb, struct inode *parent)
|
||||
for (i = 0; i < ngroups; i++) {
|
||||
if (++group >= ngroups)
|
||||
group = 0;
|
||||
desc = ext3_get_group_desc (sb, group, &bh);
|
||||
desc = ext3_get_group_desc (sb, group, NULL);
|
||||
if (desc && le16_to_cpu(desc->bg_free_inodes_count))
|
||||
return group;
|
||||
}
|
||||
|
Reference in New Issue
Block a user