* [PATCH] btrfs: reduce btrfs_update_block_group alloc argument to bool
@ 2021-10-13 6:05 Anand Jain
2021-10-13 6:24 ` Su Yue
2021-10-13 9:15 ` David Sterba
0 siblings, 2 replies; 3+ messages in thread
From: Anand Jain @ 2021-10-13 6:05 UTC (permalink / raw)
To: linux-btrfs, dsterba
btrfs_update_block_group() accounts for the number of bytes allocated or
freed. Argument %alloc specifies whether the call is for alloc or free.
Convert the argument %alloc type from int to bool.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
fs/btrfs/block-group.c | 2 +-
fs/btrfs/block-group.h | 2 +-
fs/btrfs/extent-tree.c | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
index 46fdef7bbe20..7dba9028c80c 100644
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -3160,7 +3160,7 @@ int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans)
}
int btrfs_update_block_group(struct btrfs_trans_handle *trans,
- u64 bytenr, u64 num_bytes, int alloc)
+ u64 bytenr, u64 num_bytes, bool alloc)
{
struct btrfs_fs_info *info = trans->fs_info;
struct btrfs_block_group *cache = NULL;
diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h
index f751b802b173..07f977d3816c 100644
--- a/fs/btrfs/block-group.h
+++ b/fs/btrfs/block-group.h
@@ -284,7 +284,7 @@ int btrfs_start_dirty_block_groups(struct btrfs_trans_handle *trans);
int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans);
int btrfs_setup_space_cache(struct btrfs_trans_handle *trans);
int btrfs_update_block_group(struct btrfs_trans_handle *trans,
- u64 bytenr, u64 num_bytes, int alloc);
+ u64 bytenr, u64 num_bytes, bool alloc);
int btrfs_add_reserved_bytes(struct btrfs_block_group *cache,
u64 ram_bytes, u64 num_bytes, int delalloc);
void btrfs_free_reserved_bytes(struct btrfs_block_group *cache,
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index ec5de19f0acd..6e7c03261d78 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3195,7 +3195,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
goto out;
}
- ret = btrfs_update_block_group(trans, bytenr, num_bytes, 0);
+ ret = btrfs_update_block_group(trans, bytenr, num_bytes, false);
if (ret) {
btrfs_abort_transaction(trans, ret);
goto out;
@@ -4629,7 +4629,7 @@ static int alloc_reserved_file_extent(struct btrfs_trans_handle *trans,
if (ret)
return ret;
- ret = btrfs_update_block_group(trans, ins->objectid, ins->offset, 1);
+ ret = btrfs_update_block_group(trans, ins->objectid, ins->offset, true);
if (ret) { /* -ENOENT, logic error */
btrfs_err(fs_info, "update block group failed for %llu %llu",
ins->objectid, ins->offset);
@@ -4718,7 +4718,7 @@ static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
return ret;
ret = btrfs_update_block_group(trans, extent_key.objectid,
- fs_info->nodesize, 1);
+ fs_info->nodesize, true);
if (ret) { /* -ENOENT, logic error */
btrfs_err(fs_info, "update block group failed for %llu %llu",
extent_key.objectid, extent_key.offset);
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs: reduce btrfs_update_block_group alloc argument to bool
2021-10-13 6:05 [PATCH] btrfs: reduce btrfs_update_block_group alloc argument to bool Anand Jain
@ 2021-10-13 6:24 ` Su Yue
2021-10-13 9:15 ` David Sterba
1 sibling, 0 replies; 3+ messages in thread
From: Su Yue @ 2021-10-13 6:24 UTC (permalink / raw)
To: Anand Jain; +Cc: linux-btrfs, dsterba
On Wed 13 Oct 2021 at 14:05, Anand Jain <anand.jain@oracle.com>
wrote:
> btrfs_update_block_group() accounts for the number of bytes
> allocated or
> freed. Argument %alloc specifies whether the call is for alloc
> or free.
> Convert the argument %alloc type from int to bool.
>
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>
Reviewed-by: Su Yue <l@damenly.su>
--
Su
> ---
> fs/btrfs/block-group.c | 2 +-
> fs/btrfs/block-group.h | 2 +-
> fs/btrfs/extent-tree.c | 6 +++---
> 3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
> index 46fdef7bbe20..7dba9028c80c 100644
> --- a/fs/btrfs/block-group.c
> +++ b/fs/btrfs/block-group.c
> @@ -3160,7 +3160,7 @@ int btrfs_write_dirty_block_groups(struct
> btrfs_trans_handle *trans)
> }
>
> int btrfs_update_block_group(struct btrfs_trans_handle *trans,
> - u64 bytenr, u64 num_bytes, int alloc)
> + u64 bytenr, u64 num_bytes, bool alloc)
> {
> struct btrfs_fs_info *info = trans->fs_info;
> struct btrfs_block_group *cache = NULL;
> diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h
> index f751b802b173..07f977d3816c 100644
> --- a/fs/btrfs/block-group.h
> +++ b/fs/btrfs/block-group.h
> @@ -284,7 +284,7 @@ int btrfs_start_dirty_block_groups(struct
> btrfs_trans_handle *trans);
> int btrfs_write_dirty_block_groups(struct btrfs_trans_handle
> *trans);
> int btrfs_setup_space_cache(struct btrfs_trans_handle *trans);
> int btrfs_update_block_group(struct btrfs_trans_handle *trans,
> - u64 bytenr, u64 num_bytes, int alloc);
> + u64 bytenr, u64 num_bytes, bool alloc);
> int btrfs_add_reserved_bytes(struct btrfs_block_group *cache,
> u64 ram_bytes, u64 num_bytes, int delalloc);
> void btrfs_free_reserved_bytes(struct btrfs_block_group *cache,
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index ec5de19f0acd..6e7c03261d78 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -3195,7 +3195,7 @@ static int __btrfs_free_extent(struct
> btrfs_trans_handle *trans,
> goto out;
> }
>
> - ret = btrfs_update_block_group(trans, bytenr, num_bytes,
> 0);
> + ret = btrfs_update_block_group(trans, bytenr, num_bytes,
> false);
> if (ret) {
> btrfs_abort_transaction(trans, ret);
> goto out;
> @@ -4629,7 +4629,7 @@ static int
> alloc_reserved_file_extent(struct btrfs_trans_handle *trans,
> if (ret)
> return ret;
>
> - ret = btrfs_update_block_group(trans, ins->objectid,
> ins->offset, 1);
> + ret = btrfs_update_block_group(trans, ins->objectid,
> ins->offset, true);
> if (ret) { /* -ENOENT, logic error */
> btrfs_err(fs_info, "update block group failed for %llu
> %llu",
> ins->objectid, ins->offset);
> @@ -4718,7 +4718,7 @@ static int
> alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
> return ret;
>
> ret = btrfs_update_block_group(trans, extent_key.objectid,
> - fs_info->nodesize, 1);
> + fs_info->nodesize, true);
> if (ret) { /* -ENOENT, logic error */
> btrfs_err(fs_info, "update block group failed for %llu
> %llu",
> extent_key.objectid, extent_key.offset);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs: reduce btrfs_update_block_group alloc argument to bool
2021-10-13 6:05 [PATCH] btrfs: reduce btrfs_update_block_group alloc argument to bool Anand Jain
2021-10-13 6:24 ` Su Yue
@ 2021-10-13 9:15 ` David Sterba
1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2021-10-13 9:15 UTC (permalink / raw)
To: Anand Jain; +Cc: linux-btrfs, dsterba
On Wed, Oct 13, 2021 at 02:05:14PM +0800, Anand Jain wrote:
> btrfs_update_block_group() accounts for the number of bytes allocated or
> freed. Argument %alloc specifies whether the call is for alloc or free.
> Convert the argument %alloc type from int to bool.
>
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
Added to misc-next, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-10-13 9:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13 6:05 [PATCH] btrfs: reduce btrfs_update_block_group alloc argument to bool Anand Jain
2021-10-13 6:24 ` Su Yue
2021-10-13 9:15 ` David Sterba
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.