Skip to content

Commit 6d4a6b5

Browse files
nathanchancekdave
authored andcommitted
btrfs: remove unused variable in btrfs_{start,write}_dirty_block_groups()
Clang's version of -Wunused-but-set-variable recently gained support for unary operations, which reveals two unused variables: fs/btrfs/block-group.c:2949:6: error: variable 'num_started' set but not used [-Werror,-Wunused-but-set-variable] int num_started = 0; ^ fs/btrfs/block-group.c:3116:6: error: variable 'num_started' set but not used [-Werror,-Wunused-but-set-variable] int num_started = 0; ^ 2 errors generated. These variables appear to be unused from their introduction, so just remove them to silence the warnings. Fixes: c9dc4c6 ("Btrfs: two stage dirty block group writeout") Fixes: 1bbc621 ("Btrfs: allow block group cache writeout outside critical section in commit") CC: [email protected] # 5.4+ Link: ClangBuiltLinux#1614 Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 9435be7 commit 6d4a6b5

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

fs/btrfs/block-group.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2946,7 +2946,6 @@ int btrfs_start_dirty_block_groups(struct btrfs_trans_handle *trans)
29462946
struct btrfs_path *path = NULL;
29472947
LIST_HEAD(dirty);
29482948
struct list_head *io = &cur_trans->io_bgs;
2949-
int num_started = 0;
29502949
int loops = 0;
29512950

29522951
spin_lock(&cur_trans->dirty_bgs_lock);
@@ -3012,7 +3011,6 @@ int btrfs_start_dirty_block_groups(struct btrfs_trans_handle *trans)
30123011
cache->io_ctl.inode = NULL;
30133012
ret = btrfs_write_out_cache(trans, cache, path);
30143013
if (ret == 0 && cache->io_ctl.inode) {
3015-
num_started++;
30163014
should_put = 0;
30173015

30183016
/*
@@ -3113,7 +3111,6 @@ int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans)
31133111
int should_put;
31143112
struct btrfs_path *path;
31153113
struct list_head *io = &cur_trans->io_bgs;
3116-
int num_started = 0;
31173114

31183115
path = btrfs_alloc_path();
31193116
if (!path)
@@ -3171,7 +3168,6 @@ int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans)
31713168
cache->io_ctl.inode = NULL;
31723169
ret = btrfs_write_out_cache(trans, cache, path);
31733170
if (ret == 0 && cache->io_ctl.inode) {
3174-
num_started++;
31753171
should_put = 0;
31763172
list_add_tail(&cache->io_list, io);
31773173
} else {

0 commit comments

Comments
 (0)