linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH -next] btrfs: Remove set but not used variable 'fs_info'
  2019-04-18  6:43 [PATCH -next] btrfs: Remove set but not used variable 'fs_info' YueHaibing
@ 2019-04-18  6:37 ` Nikolay Borisov
  2019-04-18  7:34   ` YueHaibing
  2019-04-18 13:43 ` David Sterba
  1 sibling, 1 reply; 4+ messages in thread
From: Nikolay Borisov @ 2019-04-18  6:37 UTC (permalink / raw)
  To: YueHaibing, Chris Mason, Josef Bacik, David Sterba
  Cc: linux-btrfs, kernel-janitors



On 18.04.19 г. 9:43 ч., YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> fs/btrfs/free-space-tree.c: In function 'load_free_space_tree':
> fs/btrfs/free-space-tree.c:1535:24: warning:
>  variable 'fs_info' set but not used [-Wunused-but-set-variable]
> 
> It's not used since commit 05e9d3137d47 ("btrfs: get fs_info from block group
> in search_free_space_info"),  so can be removed.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  fs/btrfs/free-space-tree.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/fs/btrfs/free-space-tree.c b/fs/btrfs/free-space-tree.c
> index cfe9dfb0ff05..f5dc115ebba0 100644
> --- a/fs/btrfs/free-space-tree.c
> +++ b/fs/btrfs/free-space-tree.c
> @@ -1532,14 +1532,12 @@ static int load_free_space_extents(struct btrfs_caching_control *caching_ctl,
>  int load_free_space_tree(struct btrfs_caching_control *caching_ctl)
>  {
>  	struct btrfs_block_group_cache *block_group;
> -	struct btrfs_fs_info *fs_info;
>  	struct btrfs_free_space_info *info;
>  	struct btrfs_path *path;
>  	u32 extent_count, flags;
>  	int ret;
>  
>  	block_group = caching_ctl->block_group;
> -	fs_info = block_group->fs_info;

What version is this patch based on? In current misc-next ( on which new
patches ought to be based  and can be found at: currently has:

fs_info = block_group->fs_info;
root = fs_info->free_space_root;

......

if (extent_count != expected_extent_count) {
                  btrfs_err(fs_info,

                            "incorrect extent count for %llu; counted
%u, expected %u",
                            block_group->key.objectid, extent_count,

                            expected_extent_count);

In short: nack

>  
>  	path = btrfs_alloc_path();
>  	if (!path)
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH -next] btrfs: Remove set but not used variable 'fs_info'
@ 2019-04-18  6:43 YueHaibing
  2019-04-18  6:37 ` Nikolay Borisov
  2019-04-18 13:43 ` David Sterba
  0 siblings, 2 replies; 4+ messages in thread
From: YueHaibing @ 2019-04-18  6:43 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik, David Sterba
  Cc: YueHaibing, linux-btrfs, kernel-janitors

Fixes gcc '-Wunused-but-set-variable' warning:

fs/btrfs/free-space-tree.c: In function 'load_free_space_tree':
fs/btrfs/free-space-tree.c:1535:24: warning:
 variable 'fs_info' set but not used [-Wunused-but-set-variable]

It's not used since commit 05e9d3137d47 ("btrfs: get fs_info from block group
in search_free_space_info"),  so can be removed.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 fs/btrfs/free-space-tree.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/btrfs/free-space-tree.c b/fs/btrfs/free-space-tree.c
index cfe9dfb0ff05..f5dc115ebba0 100644
--- a/fs/btrfs/free-space-tree.c
+++ b/fs/btrfs/free-space-tree.c
@@ -1532,14 +1532,12 @@ static int load_free_space_extents(struct btrfs_caching_control *caching_ctl,
 int load_free_space_tree(struct btrfs_caching_control *caching_ctl)
 {
 	struct btrfs_block_group_cache *block_group;
-	struct btrfs_fs_info *fs_info;
 	struct btrfs_free_space_info *info;
 	struct btrfs_path *path;
 	u32 extent_count, flags;
 	int ret;
 
 	block_group = caching_ctl->block_group;
-	fs_info = block_group->fs_info;
 
 	path = btrfs_alloc_path();
 	if (!path)




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] btrfs: Remove set but not used variable 'fs_info'
  2019-04-18  6:37 ` Nikolay Borisov
@ 2019-04-18  7:34   ` YueHaibing
  0 siblings, 0 replies; 4+ messages in thread
From: YueHaibing @ 2019-04-18  7:34 UTC (permalink / raw)
  To: Nikolay Borisov, Chris Mason, Josef Bacik, David Sterba
  Cc: linux-btrfs, kernel-janitors


On 2019/4/18 14:37, Nikolay Borisov wrote:
> 
> 
> On 18.04.19 г. 9:43 ч., YueHaibing wrote:
>> Fixes gcc '-Wunused-but-set-variable' warning:
>>
>> fs/btrfs/free-space-tree.c: In function 'load_free_space_tree':
>> fs/btrfs/free-space-tree.c:1535:24: warning:
>>  variable 'fs_info' set but not used [-Wunused-but-set-variable]
>>
>> It's not used since commit 05e9d3137d47 ("btrfs: get fs_info from block group
>> in search_free_space_info"),  so can be removed.
>>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>> ---
>>  fs/btrfs/free-space-tree.c | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/fs/btrfs/free-space-tree.c b/fs/btrfs/free-space-tree.c
>> index cfe9dfb0ff05..f5dc115ebba0 100644
>> --- a/fs/btrfs/free-space-tree.c
>> +++ b/fs/btrfs/free-space-tree.c
>> @@ -1532,14 +1532,12 @@ static int load_free_space_extents(struct btrfs_caching_control *caching_ctl,
>>  int load_free_space_tree(struct btrfs_caching_control *caching_ctl)
>>  {
>>  	struct btrfs_block_group_cache *block_group;
>> -	struct btrfs_fs_info *fs_info;
>>  	struct btrfs_free_space_info *info;
>>  	struct btrfs_path *path;
>>  	u32 extent_count, flags;
>>  	int ret;
>>  
>>  	block_group = caching_ctl->block_group;
>> -	fs_info = block_group->fs_info;
> 
> What version is this patch based on? In current misc-next ( on which new
> patches ought to be based  and can be found at: currently has:

This patch based on linux-next tree:

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=05e9d3137d47

> 
> fs_info = block_group->fs_info;
> root = fs_info->free_space_root;
> 
> ......
> 
> if (extent_count != expected_extent_count) {
>                   btrfs_err(fs_info,
> 
>                             "incorrect extent count for %llu; counted
> %u, expected %u",
>                             block_group->key.objectid, extent_count,
> 
>                             expected_extent_count);
> 
> In short: nack
> 
>>  
>>  	path = btrfs_alloc_path();
>>  	if (!path)
>>
>>
>>
>>
> 
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] btrfs: Remove set but not used variable 'fs_info'
  2019-04-18  6:43 [PATCH -next] btrfs: Remove set but not used variable 'fs_info' YueHaibing
  2019-04-18  6:37 ` Nikolay Borisov
@ 2019-04-18 13:43 ` David Sterba
  1 sibling, 0 replies; 4+ messages in thread
From: David Sterba @ 2019-04-18 13:43 UTC (permalink / raw)
  To: YueHaibing
  Cc: Chris Mason, Josef Bacik, David Sterba, linux-btrfs, kernel-janitors

On Thu, Apr 18, 2019 at 06:43:56AM +0000, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> fs/btrfs/free-space-tree.c: In function 'load_free_space_tree':
> fs/btrfs/free-space-tree.c:1535:24: warning:
>  variable 'fs_info' set but not used [-Wunused-but-set-variable]
> 
> It's not used since commit 05e9d3137d47 ("btrfs: get fs_info from block group
> in search_free_space_info"),  so can be removed.

Thanks, as this is in a development branch I'll fold the change to the
patch that introduced it.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-18 13:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-18  6:43 [PATCH -next] btrfs: Remove set but not used variable 'fs_info' YueHaibing
2019-04-18  6:37 ` Nikolay Borisov
2019-04-18  7:34   ` YueHaibing
2019-04-18 13:43 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).