All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: zoned: disable space cache using proper function
@ 2021-05-14  2:03 Naohiro Aota
  2021-05-14 10:05 ` Qu Wenruo
  2021-05-14 15:27 ` David Sterba
  0 siblings, 2 replies; 6+ messages in thread
From: Naohiro Aota @ 2021-05-14  2:03 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs, Naohiro Aota

As btrfs_set_free_space_cache_v1_active() is introduced, this patch uses
it to disable space cache v1 properly.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
 fs/btrfs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 4a396c1147f1..89ffc17d074c 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -592,7 +592,7 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
 		if (btrfs_is_zoned(info)) {
 			btrfs_info(info,
 			"zoned: clearing existing space cache");
-			btrfs_set_super_cache_generation(info->super_copy, 0);
+			btrfs_set_free_space_cache_v1_active(info, false);
 		} else {
 			btrfs_set_opt(info->mount_opt, SPACE_CACHE);
 		}
-- 
2.31.1


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

* Re: [PATCH] btrfs: zoned: disable space cache using proper function
  2021-05-14  2:03 [PATCH] btrfs: zoned: disable space cache using proper function Naohiro Aota
@ 2021-05-14 10:05 ` Qu Wenruo
  2021-05-14 15:30   ` David Sterba
  2021-05-14 15:27 ` David Sterba
  1 sibling, 1 reply; 6+ messages in thread
From: Qu Wenruo @ 2021-05-14 10:05 UTC (permalink / raw)
  To: Naohiro Aota, David Sterba; +Cc: linux-btrfs



On 2021/5/14 上午10:03, Naohiro Aota wrote:
> As btrfs_set_free_space_cache_v1_active() is introduced, this patch uses
> it to disable space cache v1 properly.
>
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> ---
>   fs/btrfs/super.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index 4a396c1147f1..89ffc17d074c 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -592,7 +592,7 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
>   		if (btrfs_is_zoned(info)) {
>   			btrfs_info(info,
>   			"zoned: clearing existing space cache");
> -			btrfs_set_super_cache_generation(info->super_copy, 0);
> +			btrfs_set_free_space_cache_v1_active(info, false);

Can we have a better naming?

The set_..._active() really looks like to *enable* space cache, other
than disabling it.

Thanks,
Qu
>   		} else {
>   			btrfs_set_opt(info->mount_opt, SPACE_CACHE);
>   		}
>

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

* Re: [PATCH] btrfs: zoned: disable space cache using proper function
  2021-05-14  2:03 [PATCH] btrfs: zoned: disable space cache using proper function Naohiro Aota
  2021-05-14 10:05 ` Qu Wenruo
@ 2021-05-14 15:27 ` David Sterba
  2021-05-18  6:21   ` Naohiro Aota
  1 sibling, 1 reply; 6+ messages in thread
From: David Sterba @ 2021-05-14 15:27 UTC (permalink / raw)
  To: Naohiro Aota; +Cc: David Sterba, linux-btrfs

On Fri, May 14, 2021 at 11:03:08AM +0900, Naohiro Aota wrote:
> As btrfs_set_free_space_cache_v1_active() is introduced, this patch uses
> it to disable space cache v1 properly.

Can you please describe what problem is it fixing, of if it's a problem
at all? The two functions do have quite different effects, resetting
generation is simple but the new function starts transaction and
iterates over all space inodes. That's beyond obvious so this needs an
explanation. Thanks.

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

* Re: [PATCH] btrfs: zoned: disable space cache using proper function
  2021-05-14 10:05 ` Qu Wenruo
@ 2021-05-14 15:30   ` David Sterba
  2021-05-18  6:13     ` Naohiro Aota
  0 siblings, 1 reply; 6+ messages in thread
From: David Sterba @ 2021-05-14 15:30 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: Naohiro Aota, David Sterba, linux-btrfs

On Fri, May 14, 2021 at 06:05:05PM +0800, Qu Wenruo wrote:
> 
> 
> On 2021/5/14 上午10:03, Naohiro Aota wrote:
> > As btrfs_set_free_space_cache_v1_active() is introduced, this patch uses
> > it to disable space cache v1 properly.
> >
> > Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> > ---
> >   fs/btrfs/super.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> > index 4a396c1147f1..89ffc17d074c 100644
> > --- a/fs/btrfs/super.c
> > +++ b/fs/btrfs/super.c
> > @@ -592,7 +592,7 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
> >   		if (btrfs_is_zoned(info)) {
> >   			btrfs_info(info,
> >   			"zoned: clearing existing space cache");
> > -			btrfs_set_super_cache_generation(info->super_copy, 0);
> > +			btrfs_set_free_space_cache_v1_active(info, false);
> 
> Can we have a better naming?
> 
> The set_..._active() really looks like to *enable* space cache, other
> than disabling it.

Agreed, it's really confusing and does the opposite of the name, this
needs fixing.

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

* Re: [PATCH] btrfs: zoned: disable space cache using proper function
  2021-05-14 15:30   ` David Sterba
@ 2021-05-18  6:13     ` Naohiro Aota
  0 siblings, 0 replies; 6+ messages in thread
From: Naohiro Aota @ 2021-05-18  6:13 UTC (permalink / raw)
  To: dsterba, Qu Wenruo, David Sterba, linux-btrfs

On Fri, May 14, 2021 at 05:30:49PM +0200, David Sterba wrote:
> On Fri, May 14, 2021 at 06:05:05PM +0800, Qu Wenruo wrote:
> > 
> > 
> > On 2021/5/14 上午10:03, Naohiro Aota wrote:
> > > As btrfs_set_free_space_cache_v1_active() is introduced, this patch uses
> > > it to disable space cache v1 properly.
> > >
> > > Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> > > ---
> > >   fs/btrfs/super.c | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> > > index 4a396c1147f1..89ffc17d074c 100644
> > > --- a/fs/btrfs/super.c
> > > +++ b/fs/btrfs/super.c
> > > @@ -592,7 +592,7 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
> > >   		if (btrfs_is_zoned(info)) {
> > >   			btrfs_info(info,
> > >   			"zoned: clearing existing space cache");
> > > -			btrfs_set_super_cache_generation(info->super_copy, 0);
> > > +			btrfs_set_free_space_cache_v1_active(info, false);
> > 
> > Can we have a better naming?
> > 
> > The set_..._active() really looks like to *enable* space cache, other
> > than disabling it.
> 
> Agreed, it's really confusing and does the opposite of the name, this
> needs fixing.

Sure. I'll add btrfs_{enable/disable}_free_space_cache_v1() as a prep
patch.

Thanks,

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

* Re: [PATCH] btrfs: zoned: disable space cache using proper function
  2021-05-14 15:27 ` David Sterba
@ 2021-05-18  6:21   ` Naohiro Aota
  0 siblings, 0 replies; 6+ messages in thread
From: Naohiro Aota @ 2021-05-18  6:21 UTC (permalink / raw)
  To: dsterba, David Sterba, linux-btrfs

On Fri, May 14, 2021 at 05:27:42PM +0200, David Sterba wrote:
> On Fri, May 14, 2021 at 11:03:08AM +0900, Naohiro Aota wrote:
> > As btrfs_set_free_space_cache_v1_active() is introduced, this patch uses
> > it to disable space cache v1 properly.
> 
> Can you please describe what problem is it fixing, of if it's a problem
> at all? The two functions do have quite different effects, resetting
> generation is simple but the new function starts transaction and
> iterates over all space inodes. That's beyond obvious so this needs an
> explanation. Thanks.

Sure. I'll rework the commit message to tell we want "cache_generation
> 0 iff the file system is using space_cache v1."

Thanks,

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

end of thread, other threads:[~2021-05-18  6:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14  2:03 [PATCH] btrfs: zoned: disable space cache using proper function Naohiro Aota
2021-05-14 10:05 ` Qu Wenruo
2021-05-14 15:30   ` David Sterba
2021-05-18  6:13     ` Naohiro Aota
2021-05-14 15:27 ` David Sterba
2021-05-18  6:21   ` Naohiro Aota

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.