* [PATCH] btrfs: use the enums instead of int type in struct btrfs_block_group fields
@ 2026-04-20 13:54 fdmanana
2026-04-20 21:57 ` Qu Wenruo
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: fdmanana @ 2026-04-20 13:54 UTC (permalink / raw)
To: linux-btrfs
From: Filipe Manana <fdmanana@suse.com>
The 'disk_cache_state' and 'cached' fields are defined with an int type
but all the values we assigned to them come from the enums
btrfs_disk_cache_state and btrfs_caching_type. So change the type in the
btrfs_block_group structure from int to these enums - in practice an enum
is an int, so this is more for readability and clarity.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
fs/btrfs/block-group.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h
index 60a3b1c0a8ab..790c2d467af5 100644
--- a/fs/btrfs/block-group.h
+++ b/fs/btrfs/block-group.h
@@ -171,10 +171,10 @@ struct btrfs_block_group {
unsigned long full_stripe_len;
unsigned long runtime_flags;
- int disk_cache_state;
+ enum btrfs_disk_cache_state disk_cache_state;
/* Cache tracking stuff */
- int cached;
+ enum btrfs_caching_type cached;
struct btrfs_caching_control *caching_ctl;
struct btrfs_space_info *space_info;
--
2.47.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs: use the enums instead of int type in struct btrfs_block_group fields
2026-04-20 13:54 [PATCH] btrfs: use the enums instead of int type in struct btrfs_block_group fields fdmanana
@ 2026-04-20 21:57 ` Qu Wenruo
2026-04-21 2:19 ` Sun YangKai
2026-04-21 3:18 ` David Sterba
2 siblings, 0 replies; 4+ messages in thread
From: Qu Wenruo @ 2026-04-20 21:57 UTC (permalink / raw)
To: fdmanana, linux-btrfs
在 2026/4/20 23:24, fdmanana@kernel.org 写道:
> From: Filipe Manana <fdmanana@suse.com>
>
> The 'disk_cache_state' and 'cached' fields are defined with an int type
> but all the values we assigned to them come from the enums
> btrfs_disk_cache_state and btrfs_caching_type. So change the type in the
> btrfs_block_group structure from int to these enums - in practice an enum
> is an int, so this is more for readability and clarity.
>
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Thanks,
Qu
> ---
> fs/btrfs/block-group.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h
> index 60a3b1c0a8ab..790c2d467af5 100644
> --- a/fs/btrfs/block-group.h
> +++ b/fs/btrfs/block-group.h
> @@ -171,10 +171,10 @@ struct btrfs_block_group {
> unsigned long full_stripe_len;
> unsigned long runtime_flags;
>
> - int disk_cache_state;
> + enum btrfs_disk_cache_state disk_cache_state;
>
> /* Cache tracking stuff */
> - int cached;
> + enum btrfs_caching_type cached;
> struct btrfs_caching_control *caching_ctl;
>
> struct btrfs_space_info *space_info;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs: use the enums instead of int type in struct btrfs_block_group fields
2026-04-20 13:54 [PATCH] btrfs: use the enums instead of int type in struct btrfs_block_group fields fdmanana
2026-04-20 21:57 ` Qu Wenruo
@ 2026-04-21 2:19 ` Sun YangKai
2026-04-21 3:18 ` David Sterba
2 siblings, 0 replies; 4+ messages in thread
From: Sun YangKai @ 2026-04-21 2:19 UTC (permalink / raw)
To: fdmanana, linux-btrfs
On 2026/4/20 21:54, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> The 'disk_cache_state' and 'cached' fields are defined with an int type
> but all the values we assigned to them come from the enums
> btrfs_disk_cache_state and btrfs_caching_type. So change the type in the
> btrfs_block_group structure from int to these enums - in practice an enum
> is an int, so this is more for readability and clarity.
>
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Sun YangKai <sunk67188@gnail.com>
Thanks
> ---
> fs/btrfs/block-group.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h
> index 60a3b1c0a8ab..790c2d467af5 100644
> --- a/fs/btrfs/block-group.h
> +++ b/fs/btrfs/block-group.h
> @@ -171,10 +171,10 @@ struct btrfs_block_group {
> unsigned long full_stripe_len;
> unsigned long runtime_flags;
>
> - int disk_cache_state;
> + enum btrfs_disk_cache_state disk_cache_state;
>
> /* Cache tracking stuff */
> - int cached;
> + enum btrfs_caching_type cached;
> struct btrfs_caching_control *caching_ctl;
>
> struct btrfs_space_info *space_info;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs: use the enums instead of int type in struct btrfs_block_group fields
2026-04-20 13:54 [PATCH] btrfs: use the enums instead of int type in struct btrfs_block_group fields fdmanana
2026-04-20 21:57 ` Qu Wenruo
2026-04-21 2:19 ` Sun YangKai
@ 2026-04-21 3:18 ` David Sterba
2 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2026-04-21 3:18 UTC (permalink / raw)
To: fdmanana; +Cc: linux-btrfs
On Mon, Apr 20, 2026 at 02:54:11PM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> The 'disk_cache_state' and 'cached' fields are defined with an int type
> but all the values we assigned to them come from the enums
> btrfs_disk_cache_state and btrfs_caching_type. So change the type in the
> btrfs_block_group structure from int to these enums - in practice an enum
> is an int, so this is more for readability and clarity.
>
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-04-21 3:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20 13:54 [PATCH] btrfs: use the enums instead of int type in struct btrfs_block_group fields fdmanana
2026-04-20 21:57 ` Qu Wenruo
2026-04-21 2:19 ` Sun YangKai
2026-04-21 3:18 ` David Sterba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox