[9/9] btrfs: rename btrfs_space_info_add_old_bytes
diff mbox series

Message ID 20190822191102.13732-10-josef@toxicpanda.com
State New
Headers show
Series
  • Rework reserve ticket handling
Related show

Commit Message

Josef Bacik Aug. 22, 2019, 7:11 p.m. UTC
This name doesn't really fit with how the space reservation stuff works
now, rename it to btrfs_space_info_free_bytes_may_use so it's clear what
the function is doing.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/block-rsv.c   | 5 +++--
 fs/btrfs/delayed-ref.c | 2 +-
 fs/btrfs/space-info.h  | 6 +++---
 3 files changed, 7 insertions(+), 6 deletions(-)

Comments

Nikolay Borisov Aug. 23, 2019, 8:18 a.m. UTC | #1
On 22.08.19 г. 22:11 ч., Josef Bacik wrote:
> This name doesn't really fit with how the space reservation stuff works
> now, rename it to btrfs_space_info_free_bytes_may_use so it's clear what
> the function is doing.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Nikolay Borisov <nborisov@suse.com>

> ---
>  fs/btrfs/block-rsv.c   | 5 +++--
>  fs/btrfs/delayed-ref.c | 2 +-
>  fs/btrfs/space-info.h  | 6 +++---
>  3 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/btrfs/block-rsv.c b/fs/btrfs/block-rsv.c
> index c64b460a4301..60f313888a7d 100644
> --- a/fs/btrfs/block-rsv.c
> +++ b/fs/btrfs/block-rsv.c
> @@ -54,8 +54,9 @@ static u64 block_rsv_release_bytes(struct btrfs_fs_info *fs_info,
>  			spin_unlock(&dest->lock);
>  		}
>  		if (num_bytes)
> -			btrfs_space_info_add_old_bytes(fs_info, space_info,
> -						       num_bytes);
> +			btrfs_space_info_free_bytes_may_use(fs_info,
> +							    space_info,
> +							    num_bytes);
>  	}
>  	if (qgroup_to_release_ret)
>  		*qgroup_to_release_ret = qgroup_to_release;
> diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c
> index 9a91d1eb0af4..3822edbf54a7 100644
> --- a/fs/btrfs/delayed-ref.c
> +++ b/fs/btrfs/delayed-ref.c
> @@ -158,7 +158,7 @@ void btrfs_migrate_to_delayed_refs_rsv(struct btrfs_fs_info *fs_info,
>  		trace_btrfs_space_reservation(fs_info, "delayed_refs_rsv",
>  					      0, num_bytes, 1);
>  	if (to_free)
> -		btrfs_space_info_add_old_bytes(fs_info,
> +		btrfs_space_info_free_bytes_may_use(fs_info,
>  				delayed_refs_rsv->space_info, to_free);
>  }
>  
> diff --git a/fs/btrfs/space-info.h b/fs/btrfs/space-info.h
> index d61550f06c94..c93fe9808dc0 100644
> --- a/fs/btrfs/space-info.h
> +++ b/fs/btrfs/space-info.h
> @@ -130,9 +130,9 @@ void btrfs_try_granting_tickets(struct btrfs_fs_info *fs_info,
>  				struct btrfs_space_info *space_info);
>  
>  static inline void
> -btrfs_space_info_add_old_bytes(struct btrfs_fs_info *fs_info,
> -			       struct btrfs_space_info *space_info,
> -			       u64 num_bytes)
> +btrfs_space_info_free_bytes_may_use(struct btrfs_fs_info *fs_info,
> +				    struct btrfs_space_info *space_info,
> +				    u64 num_bytes)
>  {
>  	spin_lock(&space_info->lock);
>  	btrfs_space_info_update_bytes_may_use(fs_info, space_info, -num_bytes);
>

Patch
diff mbox series

diff --git a/fs/btrfs/block-rsv.c b/fs/btrfs/block-rsv.c
index c64b460a4301..60f313888a7d 100644
--- a/fs/btrfs/block-rsv.c
+++ b/fs/btrfs/block-rsv.c
@@ -54,8 +54,9 @@  static u64 block_rsv_release_bytes(struct btrfs_fs_info *fs_info,
 			spin_unlock(&dest->lock);
 		}
 		if (num_bytes)
-			btrfs_space_info_add_old_bytes(fs_info, space_info,
-						       num_bytes);
+			btrfs_space_info_free_bytes_may_use(fs_info,
+							    space_info,
+							    num_bytes);
 	}
 	if (qgroup_to_release_ret)
 		*qgroup_to_release_ret = qgroup_to_release;
diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c
index 9a91d1eb0af4..3822edbf54a7 100644
--- a/fs/btrfs/delayed-ref.c
+++ b/fs/btrfs/delayed-ref.c
@@ -158,7 +158,7 @@  void btrfs_migrate_to_delayed_refs_rsv(struct btrfs_fs_info *fs_info,
 		trace_btrfs_space_reservation(fs_info, "delayed_refs_rsv",
 					      0, num_bytes, 1);
 	if (to_free)
-		btrfs_space_info_add_old_bytes(fs_info,
+		btrfs_space_info_free_bytes_may_use(fs_info,
 				delayed_refs_rsv->space_info, to_free);
 }
 
diff --git a/fs/btrfs/space-info.h b/fs/btrfs/space-info.h
index d61550f06c94..c93fe9808dc0 100644
--- a/fs/btrfs/space-info.h
+++ b/fs/btrfs/space-info.h
@@ -130,9 +130,9 @@  void btrfs_try_granting_tickets(struct btrfs_fs_info *fs_info,
 				struct btrfs_space_info *space_info);
 
 static inline void
-btrfs_space_info_add_old_bytes(struct btrfs_fs_info *fs_info,
-			       struct btrfs_space_info *space_info,
-			       u64 num_bytes)
+btrfs_space_info_free_bytes_may_use(struct btrfs_fs_info *fs_info,
+				    struct btrfs_space_info *space_info,
+				    u64 num_bytes)
 {
 	spin_lock(&space_info->lock);
 	btrfs_space_info_update_bytes_may_use(fs_info, space_info, -num_bytes);