diff mbox series

btrfs: turn btrfs_destroy_delayed_refs() into void function

Message ID 1615282374-29598-1-git-send-email-yang.lee@linux.alibaba.com (mailing list archive)
State New, archived
Headers show
Series btrfs: turn btrfs_destroy_delayed_refs() into void function | expand

Commit Message

Yang Li March 9, 2021, 9:32 a.m. UTC
This function always return '0' and no callers use the return value.
So make it a void function.

This eliminates the following coccicheck warning:
./fs/btrfs/disk-io.c:4522:5-8: Unneeded variable: "ret". Return "0" on
line 4530

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 fs/btrfs/disk-io.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Anand Jain March 9, 2021, 9:50 a.m. UTC | #1
On 9/3/21 5:32 pm, Yang Li wrote:
> This function always return '0' and no callers use the return value.
> So make it a void function.
> 
> This eliminates the following coccicheck warning:
> ./fs/btrfs/disk-io.c:4522:5-8: Unneeded variable: "ret". Return "0" on
> line 4530
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>

> ---
>   fs/btrfs/disk-io.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 41b718c..b75d2d9 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -52,7 +52,7 @@
>   
>   static void end_workqueue_fn(struct btrfs_work *work);
>   static void btrfs_destroy_ordered_extents(struct btrfs_root *root);
> -static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
> +static void btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
>   				      struct btrfs_fs_info *fs_info);

  A nit...
  The declare here can be removed without moving the code.

Thanks, Anand

>   static void btrfs_destroy_delalloc_inodes(struct btrfs_root *root);
>   static int btrfs_destroy_marked_extents(struct btrfs_fs_info *fs_info,
> @@ -4513,13 +4513,12 @@ static void btrfs_destroy_all_ordered_extents(struct btrfs_fs_info *fs_info)
>   	btrfs_wait_ordered_roots(fs_info, U64_MAX, 0, (u64)-1);
>   }
>   
> -static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
> +static void btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
>   				      struct btrfs_fs_info *fs_info)
>   {
>   	struct rb_node *node;
>   	struct btrfs_delayed_ref_root *delayed_refs;
>   	struct btrfs_delayed_ref_node *ref;
> -	int ret = 0;
>   
>   	delayed_refs = &trans->delayed_refs;
>   
> @@ -4592,8 +4591,6 @@ static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
>   	btrfs_qgroup_destroy_extent_records(trans);
>   
>   	spin_unlock(&delayed_refs->lock);
> -
> -	return ret;
>   }
>   
>   static void btrfs_destroy_delalloc_inodes(struct btrfs_root *root)
>
kernel test robot March 9, 2021, 11:38 a.m. UTC | #2
Hi Yang,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on kdave/for-next]
[also build test ERROR on v5.12-rc2 next-20210309]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Yang-Li/btrfs-turn-btrfs_destroy_delayed_refs-into-void-function/20210309-173510
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
config: riscv-allyesconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/bad3b2a4dc5b9bc5b6584b104c9b13210e6b739a
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yang-Li/btrfs-turn-btrfs_destroy_delayed_refs-into-void-function/20210309-173510
        git checkout bad3b2a4dc5b9bc5b6584b104c9b13210e6b739a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   fs/btrfs/disk-io.c: In function 'btrfs_destroy_delayed_refs':
>> fs/btrfs/disk-io.c:4612:10: error: 'ret' undeclared (first use in this function); did you mean 'ref'?
    4612 |   return ret;
         |          ^~~
         |          ref
   fs/btrfs/disk-io.c:4612:10: note: each undeclared identifier is reported only once for each function it appears in
   fs/btrfs/disk-io.c:4612:10: error: 'return' with a value, in function returning void [-Werror=return-type]
   fs/btrfs/disk-io.c:4599:13: note: declared here
    4599 | static void btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +4612 fs/btrfs/disk-io.c

acce952b026382 liubo           2011-01-06  4598  
bad3b2a4dc5b9b Yang Li         2021-03-09  4599  static void btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
2ff7e61e0d30ff Jeff Mahoney    2016-06-22  4600  				      struct btrfs_fs_info *fs_info)
acce952b026382 liubo           2011-01-06  4601  {
acce952b026382 liubo           2011-01-06  4602  	struct rb_node *node;
acce952b026382 liubo           2011-01-06  4603  	struct btrfs_delayed_ref_root *delayed_refs;
acce952b026382 liubo           2011-01-06  4604  	struct btrfs_delayed_ref_node *ref;
acce952b026382 liubo           2011-01-06  4605  
acce952b026382 liubo           2011-01-06  4606  	delayed_refs = &trans->delayed_refs;
acce952b026382 liubo           2011-01-06  4607  
acce952b026382 liubo           2011-01-06  4608  	spin_lock(&delayed_refs->lock);
d7df2c796d7eed Josef Bacik     2014-01-23  4609  	if (atomic_read(&delayed_refs->num_entries) == 0) {
cfece4db110dac David Sterba    2011-04-25  4610  		spin_unlock(&delayed_refs->lock);
b79ce3dddd3f1b David Sterba    2019-11-28  4611  		btrfs_debug(fs_info, "delayed_refs has NO entry");
acce952b026382 liubo           2011-01-06 @4612  		return ret;
acce952b026382 liubo           2011-01-06  4613  	}
acce952b026382 liubo           2011-01-06  4614  
5c9d028b3b174e Liu Bo          2018-08-23  4615  	while ((node = rb_first_cached(&delayed_refs->href_root)) != NULL) {
d7df2c796d7eed Josef Bacik     2014-01-23  4616  		struct btrfs_delayed_ref_head *head;
0e0adbcfdc9086 Josef Bacik     2017-10-19  4617  		struct rb_node *n;
e78417d1921c53 Josef Bacik     2013-06-03  4618  		bool pin_bytes = false;
acce952b026382 liubo           2011-01-06  4619  
d7df2c796d7eed Josef Bacik     2014-01-23  4620  		head = rb_entry(node, struct btrfs_delayed_ref_head,
d7df2c796d7eed Josef Bacik     2014-01-23  4621  				href_node);
3069bd26690a01 Josef Bacik     2018-11-21  4622  		if (btrfs_delayed_ref_lock(delayed_refs, head))
b939d1ab76b4aa Josef Bacik     2012-05-31  4623  			continue;
3069bd26690a01 Josef Bacik     2018-11-21  4624  
d7df2c796d7eed Josef Bacik     2014-01-23  4625  		spin_lock(&head->lock);
e3d03965638428 Liu Bo          2018-08-23  4626  		while ((n = rb_first_cached(&head->ref_tree)) != NULL) {
0e0adbcfdc9086 Josef Bacik     2017-10-19  4627  			ref = rb_entry(n, struct btrfs_delayed_ref_node,
0e0adbcfdc9086 Josef Bacik     2017-10-19  4628  				       ref_node);
d7df2c796d7eed Josef Bacik     2014-01-23  4629  			ref->in_tree = 0;
e3d03965638428 Liu Bo          2018-08-23  4630  			rb_erase_cached(&ref->ref_node, &head->ref_tree);
0e0adbcfdc9086 Josef Bacik     2017-10-19  4631  			RB_CLEAR_NODE(&ref->ref_node);
1d57ee941692d0 Wang Xiaoguang  2016-10-26  4632  			if (!list_empty(&ref->add_list))
1d57ee941692d0 Wang Xiaoguang  2016-10-26  4633  				list_del(&ref->add_list);
d7df2c796d7eed Josef Bacik     2014-01-23  4634  			atomic_dec(&delayed_refs->num_entries);
d7df2c796d7eed Josef Bacik     2014-01-23  4635  			btrfs_put_delayed_ref(ref);
d7df2c796d7eed Josef Bacik     2014-01-23  4636  		}
54067ae95e1547 Josef Bacik     2013-04-25  4637  		if (head->must_insert_reserved)
e78417d1921c53 Josef Bacik     2013-06-03  4638  			pin_bytes = true;
78a6184a3ff904 Miao Xie        2012-11-21  4639  		btrfs_free_delayed_extent_op(head->extent_op);
fa781cea3d6a2b Josef Bacik     2018-11-21  4640  		btrfs_delete_ref_head(delayed_refs, head);
d7df2c796d7eed Josef Bacik     2014-01-23  4641  		spin_unlock(&head->lock);
acce952b026382 liubo           2011-01-06  4642  		spin_unlock(&delayed_refs->lock);
e78417d1921c53 Josef Bacik     2013-06-03  4643  		mutex_unlock(&head->mutex);
acce952b026382 liubo           2011-01-06  4644  
f603bb94abbed5 Nikolay Borisov 2020-01-20  4645  		if (pin_bytes) {
f603bb94abbed5 Nikolay Borisov 2020-01-20  4646  			struct btrfs_block_group *cache;
f603bb94abbed5 Nikolay Borisov 2020-01-20  4647  
f603bb94abbed5 Nikolay Borisov 2020-01-20  4648  			cache = btrfs_lookup_block_group(fs_info, head->bytenr);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4649  			BUG_ON(!cache);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4650  
f603bb94abbed5 Nikolay Borisov 2020-01-20  4651  			spin_lock(&cache->space_info->lock);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4652  			spin_lock(&cache->lock);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4653  			cache->pinned += head->num_bytes;
f603bb94abbed5 Nikolay Borisov 2020-01-20  4654  			btrfs_space_info_update_bytes_pinned(fs_info,
f603bb94abbed5 Nikolay Borisov 2020-01-20  4655  				cache->space_info, head->num_bytes);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4656  			cache->reserved -= head->num_bytes;
f603bb94abbed5 Nikolay Borisov 2020-01-20  4657  			cache->space_info->bytes_reserved -= head->num_bytes;
f603bb94abbed5 Nikolay Borisov 2020-01-20  4658  			spin_unlock(&cache->lock);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4659  			spin_unlock(&cache->space_info->lock);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4660  			percpu_counter_add_batch(
f603bb94abbed5 Nikolay Borisov 2020-01-20  4661  				&cache->space_info->total_bytes_pinned,
f603bb94abbed5 Nikolay Borisov 2020-01-20  4662  				head->num_bytes, BTRFS_TOTAL_BYTES_PINNED_BATCH);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4663  
f603bb94abbed5 Nikolay Borisov 2020-01-20  4664  			btrfs_put_block_group(cache);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4665  
f603bb94abbed5 Nikolay Borisov 2020-01-20  4666  			btrfs_error_unpin_extent_range(fs_info, head->bytenr,
f603bb94abbed5 Nikolay Borisov 2020-01-20  4667  				head->bytenr + head->num_bytes - 1);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4668  		}
31890da0bfdd24 Josef Bacik     2018-11-21  4669  		btrfs_cleanup_ref_head_accounting(fs_info, delayed_refs, head);
d278850eff3053 Josef Bacik     2017-09-29  4670  		btrfs_put_delayed_ref_head(head);
acce952b026382 liubo           2011-01-06  4671  		cond_resched();
acce952b026382 liubo           2011-01-06  4672  		spin_lock(&delayed_refs->lock);
acce952b026382 liubo           2011-01-06  4673  	}
81f7eb00ff5bb8 Jeff Mahoney    2020-02-11  4674  	btrfs_qgroup_destroy_extent_records(trans);
acce952b026382 liubo           2011-01-06  4675  
acce952b026382 liubo           2011-01-06  4676  	spin_unlock(&delayed_refs->lock);
acce952b026382 liubo           2011-01-06  4677  }
acce952b026382 liubo           2011-01-06  4678  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
David Sterba March 9, 2021, 12:22 p.m. UTC | #3
On Tue, Mar 09, 2021 at 05:32:54PM +0800, Yang Li wrote:
> This function always return '0' and no callers use the return value.
> So make it a void function.
> 
> This eliminates the following coccicheck warning:
> ./fs/btrfs/disk-io.c:4522:5-8: Unneeded variable: "ret". Return "0" on
> line 4530
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>

Can you please tell your robot to ignore this warning, I'm getting tired
to explain the same thing again,

https://lore.kernel.org/linux-btrfs/20210302120708.GH7604@suse.cz/

this is like 5th attempt to blindly fix a tool warning without
understanding the code.
kernel test robot March 9, 2021, 12:45 p.m. UTC | #4
Hi Yang,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on kdave/for-next]
[also build test ERROR on v5.12-rc2 next-20210309]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Yang-Li/btrfs-turn-btrfs_destroy_delayed_refs-into-void-function/20210309-173510
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
config: mips-randconfig-r022-20210309 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 820f508b08d7c94b2dd7847e9710d2bc36d3dd45)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://github.com/0day-ci/linux/commit/bad3b2a4dc5b9bc5b6584b104c9b13210e6b739a
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yang-Li/btrfs-turn-btrfs_destroy_delayed_refs-into-void-function/20210309-173510
        git checkout bad3b2a4dc5b9bc5b6584b104c9b13210e6b739a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> fs/btrfs/disk-io.c:4612:10: error: use of undeclared identifier 'ret'; did you mean 'ref'?
                   return ret;
                          ^~~
                          ref
   fs/btrfs/disk-io.c:4604:33: note: 'ref' declared here
           struct btrfs_delayed_ref_node *ref;
                                          ^
>> fs/btrfs/disk-io.c:4612:3: error: void function 'btrfs_destroy_delayed_refs' should not return a value [-Wreturn-type]
                   return ret;
                   ^      ~~~
   2 errors generated.


vim +4612 fs/btrfs/disk-io.c

acce952b026382 liubo           2011-01-06  4598  
bad3b2a4dc5b9b Yang Li         2021-03-09  4599  static void btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
2ff7e61e0d30ff Jeff Mahoney    2016-06-22  4600  				      struct btrfs_fs_info *fs_info)
acce952b026382 liubo           2011-01-06  4601  {
acce952b026382 liubo           2011-01-06  4602  	struct rb_node *node;
acce952b026382 liubo           2011-01-06  4603  	struct btrfs_delayed_ref_root *delayed_refs;
acce952b026382 liubo           2011-01-06  4604  	struct btrfs_delayed_ref_node *ref;
acce952b026382 liubo           2011-01-06  4605  
acce952b026382 liubo           2011-01-06  4606  	delayed_refs = &trans->delayed_refs;
acce952b026382 liubo           2011-01-06  4607  
acce952b026382 liubo           2011-01-06  4608  	spin_lock(&delayed_refs->lock);
d7df2c796d7eed Josef Bacik     2014-01-23  4609  	if (atomic_read(&delayed_refs->num_entries) == 0) {
cfece4db110dac David Sterba    2011-04-25  4610  		spin_unlock(&delayed_refs->lock);
b79ce3dddd3f1b David Sterba    2019-11-28  4611  		btrfs_debug(fs_info, "delayed_refs has NO entry");
acce952b026382 liubo           2011-01-06 @4612  		return ret;
acce952b026382 liubo           2011-01-06  4613  	}
acce952b026382 liubo           2011-01-06  4614  
5c9d028b3b174e Liu Bo          2018-08-23  4615  	while ((node = rb_first_cached(&delayed_refs->href_root)) != NULL) {
d7df2c796d7eed Josef Bacik     2014-01-23  4616  		struct btrfs_delayed_ref_head *head;
0e0adbcfdc9086 Josef Bacik     2017-10-19  4617  		struct rb_node *n;
e78417d1921c53 Josef Bacik     2013-06-03  4618  		bool pin_bytes = false;
acce952b026382 liubo           2011-01-06  4619  
d7df2c796d7eed Josef Bacik     2014-01-23  4620  		head = rb_entry(node, struct btrfs_delayed_ref_head,
d7df2c796d7eed Josef Bacik     2014-01-23  4621  				href_node);
3069bd26690a01 Josef Bacik     2018-11-21  4622  		if (btrfs_delayed_ref_lock(delayed_refs, head))
b939d1ab76b4aa Josef Bacik     2012-05-31  4623  			continue;
3069bd26690a01 Josef Bacik     2018-11-21  4624  
d7df2c796d7eed Josef Bacik     2014-01-23  4625  		spin_lock(&head->lock);
e3d03965638428 Liu Bo          2018-08-23  4626  		while ((n = rb_first_cached(&head->ref_tree)) != NULL) {
0e0adbcfdc9086 Josef Bacik     2017-10-19  4627  			ref = rb_entry(n, struct btrfs_delayed_ref_node,
0e0adbcfdc9086 Josef Bacik     2017-10-19  4628  				       ref_node);
d7df2c796d7eed Josef Bacik     2014-01-23  4629  			ref->in_tree = 0;
e3d03965638428 Liu Bo          2018-08-23  4630  			rb_erase_cached(&ref->ref_node, &head->ref_tree);
0e0adbcfdc9086 Josef Bacik     2017-10-19  4631  			RB_CLEAR_NODE(&ref->ref_node);
1d57ee941692d0 Wang Xiaoguang  2016-10-26  4632  			if (!list_empty(&ref->add_list))
1d57ee941692d0 Wang Xiaoguang  2016-10-26  4633  				list_del(&ref->add_list);
d7df2c796d7eed Josef Bacik     2014-01-23  4634  			atomic_dec(&delayed_refs->num_entries);
d7df2c796d7eed Josef Bacik     2014-01-23  4635  			btrfs_put_delayed_ref(ref);
d7df2c796d7eed Josef Bacik     2014-01-23  4636  		}
54067ae95e1547 Josef Bacik     2013-04-25  4637  		if (head->must_insert_reserved)
e78417d1921c53 Josef Bacik     2013-06-03  4638  			pin_bytes = true;
78a6184a3ff904 Miao Xie        2012-11-21  4639  		btrfs_free_delayed_extent_op(head->extent_op);
fa781cea3d6a2b Josef Bacik     2018-11-21  4640  		btrfs_delete_ref_head(delayed_refs, head);
d7df2c796d7eed Josef Bacik     2014-01-23  4641  		spin_unlock(&head->lock);
acce952b026382 liubo           2011-01-06  4642  		spin_unlock(&delayed_refs->lock);
e78417d1921c53 Josef Bacik     2013-06-03  4643  		mutex_unlock(&head->mutex);
acce952b026382 liubo           2011-01-06  4644  
f603bb94abbed5 Nikolay Borisov 2020-01-20  4645  		if (pin_bytes) {
f603bb94abbed5 Nikolay Borisov 2020-01-20  4646  			struct btrfs_block_group *cache;
f603bb94abbed5 Nikolay Borisov 2020-01-20  4647  
f603bb94abbed5 Nikolay Borisov 2020-01-20  4648  			cache = btrfs_lookup_block_group(fs_info, head->bytenr);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4649  			BUG_ON(!cache);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4650  
f603bb94abbed5 Nikolay Borisov 2020-01-20  4651  			spin_lock(&cache->space_info->lock);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4652  			spin_lock(&cache->lock);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4653  			cache->pinned += head->num_bytes;
f603bb94abbed5 Nikolay Borisov 2020-01-20  4654  			btrfs_space_info_update_bytes_pinned(fs_info,
f603bb94abbed5 Nikolay Borisov 2020-01-20  4655  				cache->space_info, head->num_bytes);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4656  			cache->reserved -= head->num_bytes;
f603bb94abbed5 Nikolay Borisov 2020-01-20  4657  			cache->space_info->bytes_reserved -= head->num_bytes;
f603bb94abbed5 Nikolay Borisov 2020-01-20  4658  			spin_unlock(&cache->lock);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4659  			spin_unlock(&cache->space_info->lock);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4660  			percpu_counter_add_batch(
f603bb94abbed5 Nikolay Borisov 2020-01-20  4661  				&cache->space_info->total_bytes_pinned,
f603bb94abbed5 Nikolay Borisov 2020-01-20  4662  				head->num_bytes, BTRFS_TOTAL_BYTES_PINNED_BATCH);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4663  
f603bb94abbed5 Nikolay Borisov 2020-01-20  4664  			btrfs_put_block_group(cache);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4665  
f603bb94abbed5 Nikolay Borisov 2020-01-20  4666  			btrfs_error_unpin_extent_range(fs_info, head->bytenr,
f603bb94abbed5 Nikolay Borisov 2020-01-20  4667  				head->bytenr + head->num_bytes - 1);
f603bb94abbed5 Nikolay Borisov 2020-01-20  4668  		}
31890da0bfdd24 Josef Bacik     2018-11-21  4669  		btrfs_cleanup_ref_head_accounting(fs_info, delayed_refs, head);
d278850eff3053 Josef Bacik     2017-09-29  4670  		btrfs_put_delayed_ref_head(head);
acce952b026382 liubo           2011-01-06  4671  		cond_resched();
acce952b026382 liubo           2011-01-06  4672  		spin_lock(&delayed_refs->lock);
acce952b026382 liubo           2011-01-06  4673  	}
81f7eb00ff5bb8 Jeff Mahoney    2020-02-11  4674  	btrfs_qgroup_destroy_extent_records(trans);
acce952b026382 liubo           2011-01-06  4675  
acce952b026382 liubo           2011-01-06  4676  	spin_unlock(&delayed_refs->lock);
acce952b026382 liubo           2011-01-06  4677  }
acce952b026382 liubo           2011-01-06  4678  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 41b718c..b75d2d9 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -52,7 +52,7 @@ 
 
 static void end_workqueue_fn(struct btrfs_work *work);
 static void btrfs_destroy_ordered_extents(struct btrfs_root *root);
-static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
+static void btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
 				      struct btrfs_fs_info *fs_info);
 static void btrfs_destroy_delalloc_inodes(struct btrfs_root *root);
 static int btrfs_destroy_marked_extents(struct btrfs_fs_info *fs_info,
@@ -4513,13 +4513,12 @@  static void btrfs_destroy_all_ordered_extents(struct btrfs_fs_info *fs_info)
 	btrfs_wait_ordered_roots(fs_info, U64_MAX, 0, (u64)-1);
 }
 
-static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
+static void btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
 				      struct btrfs_fs_info *fs_info)
 {
 	struct rb_node *node;
 	struct btrfs_delayed_ref_root *delayed_refs;
 	struct btrfs_delayed_ref_node *ref;
-	int ret = 0;
 
 	delayed_refs = &trans->delayed_refs;
 
@@ -4592,8 +4591,6 @@  static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
 	btrfs_qgroup_destroy_extent_records(trans);
 
 	spin_unlock(&delayed_refs->lock);
-
-	return ret;
 }
 
 static void btrfs_destroy_delalloc_inodes(struct btrfs_root *root)