From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: fdmanana@kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: use the enums instead of int type in struct btrfs_block_group fields
Date: Tue, 21 Apr 2026 07:27:46 +0930 [thread overview]
Message-ID: <e5814387-b235-4277-a5fc-cdc2f52cdf3f@gmx.com> (raw)
In-Reply-To: <085942c2ba1ec8fec438f49c6f8e2d6bb2011eb1.1776693204.git.fdmanana@suse.com>
在 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;
next prev parent reply other threads:[~2026-04-20 21:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2026-04-21 2:19 ` Sun YangKai
2026-04-21 3:18 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e5814387-b235-4277-a5fc-cdc2f52cdf3f@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=fdmanana@kernel.org \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox