Make the code -Wunused clean
cover Make the code -Wunused clean
This series eliminates all -Wunused warnings in the code base.
Nikolay Borisov (8):
btrfs: Remove unused op_key var from add_delayed_refs
btrfs: Remove unused length var from scrub_handle_errored_block
btrfs: Remove unused tot_len var from lzo_decompress
btrfs: Remove unused root var from relink_file_extents
btrfs: remove max_active var from open_ctree
btrfs: Remove unused parent_level var from btrfs_realloc_node
btrfs: Remove unused extent_root var from caching_thread
btrfs: Remove unused flush var in shrink_delalloc
fs/btrfs/backref.c | 5 +---- fs/btrfs/ctree.c | 3 --- fs/btrfs/disk-io.c | 3 --- fs/btrfs/extent-tree.c | 7 ------- fs/btrfs/inode.c | 2 -- fs/btrfs/lzo.c | 2 -- fs/btrfs/scrub.c | 2 -- 7 files changed, 1 insertion(+), 23 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/8 btrfs: Remove unused op_key var from add_delayed_refs
Added as part of 86d5f9944252 ("btrfs: convert prelimary reference tracking to use rbtrees") but never used. tmp_op_key essentially subsumed that variable
--- fs/btrfs/backref.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
fs/btrfs/backref.c +1 -4
@@ -773,15 +773,12 @@ static int add_delayed_refs(const struct btrfs_fs_info *fs_info,struct btrfs_delayed_extent_op *extent_op = head->extent_op;struct btrfs_key key;struct btrfs_key tmp_op_key; -struct btrfs_key *op_key =NULL ;struct rb_node *n;int count;int ret =0 ; -if (extent_op && extent_op->update_key) { +if (extent_op && extent_op->update_key)btrfs_disk_key_to_cpu (&tmp_op_key, &extent_op->key); - op_key = &tmp_op_key; - }spin_lock (&head->lock);for (n =rb_first (&head->ref_tree); n; n =rb_next (n)) {
Signature · 1 line
2.7.4
PATCH 2/8 btrfs: Remove unused length var from scrub_handle_errored_block
In reply to Nikolay BorisovAdded in b5d67f64f9bc ("Btrfs: change scrub to support big blocks") but rendered redundant by be50a8ddaae1 ("Btrfs: Simplify scrub_setup_recheck_block()'s argument")
--- fs/btrfs/scrub.c | 2 -- 1 file changed, 2 deletions(-)
fs/btrfs/scrub.c +0 -2
@@ -1111,7 +1111,6 @@ static int scrub_handle_errored_block(struct scrub_block *sblock_to_check)struct scrub_ctx *sctx = sblock_to_check->sctx;struct btrfs_device *dev;struct btrfs_fs_info *fs_info; -u64 length;u64 logical;unsigned int failed_mirror_index;unsigned int is_metadata;
@@ -1139,7 +1138,6 @@ static int scrub_handle_errored_block(struct scrub_block *sblock_to_check)spin_unlock (&sctx->stat_lock);return 0 ; } - length = sblock_to_check->page_count *PAGE_SIZE ; logical = sblock_to_check->pagev[0 ]->logical;BUG_ON (sblock_to_check->pagev[0 ]->mirror_num <1 ); failed_mirror_index = sblock_to_check->pagev[0 ]->mirror_num -1 ;
Signature · 1 line
2.7.4
PATCH 3/8 btrfs: Remove unused tot_len var from lzo_decompress
In reply to Nikolay BorisovAdded already unused in a6fa6fae40ec ("btrfs: Add lzo compression support")
--- fs/btrfs/lzo.c | 2 -- 1 file changed, 2 deletions(-)
fs/btrfs/lzo.c +0 -2
@@ -382,14 +382,12 @@ static int lzo_decompress(struct list_head *ws, unsigned char *data_in, struct workspace *workspace = list_entry(ws, struct workspace, list);size_t in_len;size_t out_len; -size_t tot_len;int ret =0 ;char *kaddr;unsigned long bytes;BUG_ON (srclen <LZO_LEN ); - tot_len =read_compress_length (data_in); data_in +=LZO_LEN ; in_len =read_compress_length (data_in);
Signature · 1 line
2.7.4
PATCH 4/8 btrfs: Remove unused root var from relink_file_extents
In reply to Nikolay BorisovAdded in 38c227d87c49 ("Btrfs: snapshot-aware defrag") but subsequently made redundant by 0b246afa62b0 ("btrfs: root->fs_info cleanup, add fs_info convenience variables")
--- fs/btrfs/inode.c | 2 -- 1 file changed, 2 deletions(-)
fs/btrfs/inode.c +0 -2
@@ -2772,12 +2772,10 @@ static void relink_file_extents(struct new_sa_defrag_extent *new)struct sa_defrag_extent_backref *backref;struct sa_defrag_extent_backref *prev =NULL ;struct inode *inode; -struct btrfs_root *root;struct rb_node *node;int ret; inode = new->inode; - root =BTRFS_I (inode)->root; path =btrfs_alloc_path ();if (!path)
Signature · 1 line
2.7.4
PATCH 5/8 btrfs: remove max_active var from open_ctree
In reply to Nikolay BorisovIntroduced by 5cdc7ad337fb ("btrfs: Replace fs_info->workers with btrfs_workqueue.") but obsoleted by 2a4581983f90 ("btrfs: factor btrfs_init_workqueues() out of open_ctree()")
--- fs/btrfs/disk-io.c | 3 --- 1 file changed, 3 deletions(-)
fs/btrfs/disk-io.c +0 -3
@@ -2390,7 +2390,6 @@ int open_ctree(struct super_block *sb,int err = -EINVAL ;int num_backups_tried =0 ;int backup_index =0 ; -u32 max_active;int clear_free_space_tree =0 ; tree_root = fs_info->tree_root =btrfs_alloc_root (fs_info,GFP_KERNEL );
@@ -2699,8 +2698,6 @@ int open_ctree(struct super_block *sb, goto fail_alloc; } - max_active = fs_info->thread_pool_size; - ret =btrfs_init_workqueues (fs_info, fs_devices);if (ret) { err = ret;
Signature · 1 line
2.7.4
PATCH 6/8 btrfs: Remove unused parent_level var from btrfs_realloc_node
In reply to Nikolay BorisovAdded by f2183bde1a91 ("Btrfs: Add BH_Defrag to mark buffers that are in need of defragging") but obsoleted by 3f157a2fd2ad ("Btrfs: Online btree defragmentation fixes")
--- fs/btrfs/ctree.c | 3 --- 1 file changed, 3 deletions(-)
fs/btrfs/ctree.c +0 -3
@@ -1571,14 +1571,11 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans,int end_slot;int i;int err =0 ; -int parent_level;int uptodate;u32 blocksize;int progress_passed =0 ;struct btrfs_disk_key disk_key; - parent_level =btrfs_header_level (parent); -WARN_ON (trans->transaction != fs_info->running_transaction);WARN_ON (trans->transid != fs_info->generation);
Signature · 1 line
2.7.4
PATCH 7/8 btrfs: Remove unused extent_root var from caching_thread
In reply to Nikolay BorisovAdded by b4570aa994b8 ("btrfs: fix compiling with CONFIG_BTRFS_DEBUG enabled.") and obsoleted by 2ff7e61e0d30 ("btrfs: take an fs_info directly when the root is not used otherwise")
--- fs/btrfs/extent-tree.c | 2 -- 1 file changed, 2 deletions(-)
fs/btrfs/extent-tree.c +0 -2
@@ -535,13 +535,11 @@ static noinline void caching_thread(struct btrfs_work *work)struct btrfs_block_group_cache *block_group;struct btrfs_fs_info *fs_info;struct btrfs_caching_control *caching_ctl; -struct btrfs_root *extent_root;int ret; caching_ctl = container_of(work, struct btrfs_caching_control, work); block_group = caching_ctl->block_group; fs_info = block_group->fs_info; - extent_root = fs_info->extent_root;mutex_lock (&caching_ctl->mutex);down_read (&fs_info->commit_root_sem);
Signature · 1 line
2.7.4
PATCH 8/8 btrfs: Remove unused flush var in shrink_delalloc
In reply to Nikolay BorisovAdded by 08e007d2e577 ("Btrfs: improve the noflush reservation") and made redundant by 17024ad0a0fd ("Btrfs: fix early ENOSPC due to delalloc")
--- fs/btrfs/extent-tree.c | 5 ----- 1 file changed, 5 deletions(-)
fs/btrfs/extent-tree.c +0 -5
@@ -4829,7 +4829,6 @@ static void shrink_delalloc(struct btrfs_fs_info *fs_info, u64 to_reclaim,long time_left;unsigned long nr_pages;int loops; -enum btrfs_reserve_flush_enum flush;/* Calc the number of the pages we need flush for space reservation */ items =calc_reclaim_items_nr (fs_info, to_reclaim);
@@ -4870,10 +4869,6 @@ static void shrink_delalloc(struct btrfs_fs_info *fs_info, u64 to_reclaim,atomic_read (&fs_info->async_delalloc_pages) <= (int)max_reclaim); skip_async: -if (!trans) - flush =BTRFS_RESERVE_FLUSH_ALL ; -else - flush =BTRFS_RESERVE_NO_FLUSH ;spin_lock (&space_info->lock);if (list_empty (&space_info->tickets) &&list_empty (&space_info->priority_tickets)) {
Signature · 1 line
2.7.4
Quoted 1 line · Nikolay Borisov
This series eliminates all -Wunused warnings in the code base.
Thanks, 1-8 applied.