diff mbox series

[1/3] btrfs: rename BTRFS_FS_NO_OVERCOMMIT -> BTRFS_FS_ACTIVE_ZONE_TRACKING

Message ID 5cb6fa87af8959b0ee9b33591968812fc6b4ab87.1677705092.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series Fix active zone accounting for zoned | expand

Commit Message

Josef Bacik March 1, 2023, 9:14 p.m. UTC
This flag only gets set when we're doing active zone tracking, and I'm
going to need to use this flag for things related to this behavior.
Rename the flag to represent what it actually means for the file system
so it can be used in other ways and still make sense.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/fs.h         | 7 ++-----
 fs/btrfs/space-info.c | 2 +-
 fs/btrfs/zoned.c      | 3 +--
 3 files changed, 4 insertions(+), 8 deletions(-)

Comments

Anand Jain March 2, 2023, 6:45 a.m. UTC | #1
On 3/2/23 05:14, Josef Bacik wrote:
> This flag only gets set when we're doing active zone tracking, and I'm
> going to need to use this flag for things related to this behavior.
> Rename the flag to represent what it actually means for the file system
> so it can be used in other ways and still make sense.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

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


> diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
> index 69c09508afb5..2237685d1ed0 100644
> --- a/fs/btrfs/space-info.c
> +++ b/fs/btrfs/space-info.c
> @@ -407,7 +407,7 @@ int btrfs_can_overcommit(struct btrfs_fs_info *fs_info,
>   		return 0;
>   
>   	used = btrfs_space_info_used(space_info, true);
> -	if (test_bit(BTRFS_FS_NO_OVERCOMMIT, &fs_info->flags) &&
> +	if (test_bit(BTRFS_FS_ACTIVE_ZONE_TRACKING, &fs_info->flags) &&
>   	    (space_info->flags & BTRFS_BLOCK_GROUP_METADATA))
>   		avail = 0;
>   	else
> diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
> index f95b2c94d619..808cfa3091c5 100644
> --- a/fs/btrfs/zoned.c
> +++ b/fs/btrfs/zoned.c
> @@ -524,8 +524,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
>   		}
>   		atomic_set(&zone_info->active_zones_left,
>   			   max_active_zones - nactive);

> -		/* Overcommit does not work well with active zone tacking. */

  Nit:
  Consider moving this comment to the btrfs_can_overcommit() function,
  possibly during the apply.
Johannes Thumshirn March 2, 2023, 10:03 a.m. UTC | #2
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Naohiro Aota March 2, 2023, 2:45 p.m. UTC | #3
On Wed, Mar 01, 2023 at 04:14:42PM -0500, Josef Bacik wrote:
> This flag only gets set when we're doing active zone tracking, and I'm
> going to need to use this flag for things related to this behavior.
> Rename the flag to represent what it actually means for the file system
> so it can be used in other ways and still make sense.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Looks good,
Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com>
diff mbox series

Patch

diff --git a/fs/btrfs/fs.h b/fs/btrfs/fs.h
index 4c477eae6891..24cd49229408 100644
--- a/fs/btrfs/fs.h
+++ b/fs/btrfs/fs.h
@@ -120,11 +120,8 @@  enum {
 	/* Indicate that we want to commit the transaction. */
 	BTRFS_FS_NEED_TRANS_COMMIT,
 
-	/*
-	 * Indicate metadata over-commit is disabled. This is set when active
-	 * zone tracking is needed.
-	 */
-	BTRFS_FS_NO_OVERCOMMIT,
+	/* This is set when active zone tracking is needed. */
+	BTRFS_FS_ACTIVE_ZONE_TRACKING,
 
 	/*
 	 * Indicate if we have some features changed, this is mostly for
diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
index 69c09508afb5..2237685d1ed0 100644
--- a/fs/btrfs/space-info.c
+++ b/fs/btrfs/space-info.c
@@ -407,7 +407,7 @@  int btrfs_can_overcommit(struct btrfs_fs_info *fs_info,
 		return 0;
 
 	used = btrfs_space_info_used(space_info, true);
-	if (test_bit(BTRFS_FS_NO_OVERCOMMIT, &fs_info->flags) &&
+	if (test_bit(BTRFS_FS_ACTIVE_ZONE_TRACKING, &fs_info->flags) &&
 	    (space_info->flags & BTRFS_BLOCK_GROUP_METADATA))
 		avail = 0;
 	else
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index f95b2c94d619..808cfa3091c5 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -524,8 +524,7 @@  int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
 		}
 		atomic_set(&zone_info->active_zones_left,
 			   max_active_zones - nactive);
-		/* Overcommit does not work well with active zone tacking. */
-		set_bit(BTRFS_FS_NO_OVERCOMMIT, &fs_info->flags);
+		set_bit(BTRFS_FS_ACTIVE_ZONE_TRACKING, &fs_info->flags);
 	}
 
 	/* Validate superblock log */