diff mbox

[10/10] btrfs: Remove redundant argument of __link_block_group

Message ID 1503308630-6652-11-git-send-email-nborisov@suse.com (mailing list archive)
State New, archived
Headers show

Commit Message

Nikolay Borisov Aug. 21, 2017, 9:43 a.m. UTC
__link_block_group is called from only 2 places and at each call site the
space_info being passed is the same as the space info assigned to the passed
cache struct. Let's remove the redundant argument and make the function
reference the space_info from the passed block_group_cache. No functional
changes

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/extent-tree.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

David Sterba Sept. 7, 2017, 7:33 p.m. UTC | #1
On Mon, Aug 21, 2017 at 12:43:50PM +0300, Nikolay Borisov wrote:
> __link_block_group is called from only 2 places and at each call site the
> space_info being passed is the same as the space info assigned to the passed
> cache struct. Let's remove the redundant argument and make the function
> reference the space_info from the passed block_group_cache. No functional
> changes
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

I took the cleanup a bit further and removed the double underscore from
the function name.

Reviewed-by: David Sterba <dsterba@suse.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 1a80f6e58296..6ca75dc62a3c 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -9886,9 +9886,9 @@  int btrfs_free_block_groups(struct btrfs_fs_info *info)
 	return 0;
 }
 
-static void __link_block_group(struct btrfs_space_info *space_info,
-			       struct btrfs_block_group_cache *cache)
+static void __link_block_group(struct btrfs_block_group_cache *cache)
 {
+	struct btrfs_space_info *space_info = cache->space_info;
 	int index = get_block_group_index(cache);
 	bool first = false;
 
@@ -10096,7 +10096,7 @@  int btrfs_read_block_groups(struct btrfs_fs_info *info)
 
 		cache->space_info = space_info;
 
-		__link_block_group(space_info, cache);
+		__link_block_group(cache);
 
 		set_avail_alloc_bits(info, cache->flags);
 		if (btrfs_chunk_readonly(info, cache->key.objectid)) {
@@ -10255,7 +10255,7 @@  int btrfs_make_block_group(struct btrfs_trans_handle *trans,
 				cache->bytes_super, &cache->space_info);
 	update_global_block_rsv(fs_info);
 
-	__link_block_group(cache->space_info, cache);
+	__link_block_group(cache);
 
 	list_add_tail(&cache->bg_list, &trans->new_bgs);