[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YLm12A7qKFyYYU0Z@sol.localdomain>
Date: Thu, 3 Jun 2021 22:10:48 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: Jaegeuk Kim <jaegeuk@...nel.org>
Cc: linux-kernel@...r.kernel.org,
linux-f2fs-devel@...ts.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH v2] f2fs: clean up /sys/fs/f2fs/<disk>/features
On Thu, Jun 03, 2021 at 09:42:08PM -0700, Jaegeuk Kim wrote:
> enum feat_id {
> FEAT_CRYPTO = 0,
> FEAT_BLKZONED,
> @@ -587,6 +601,7 @@ enum feat_id {
> FEAT_RO,
> FEAT_TEST_DUMMY_ENCRYPTION_V2,
> FEAT_ENCRYPTED_CASEFOLD,
> + FEAT_PIN_FILE,
> };
>
> static ssize_t f2fs_feature_show(struct f2fs_attr *a,
> @@ -610,6 +625,7 @@ static ssize_t f2fs_feature_show(struct f2fs_attr *a,
> case FEAT_RO:
> case FEAT_TEST_DUMMY_ENCRYPTION_V2:
> case FEAT_ENCRYPTED_CASEFOLD:
> + case FEAT_PIN_FILE:
> return sprintf(buf, "supported\n");
> }
> return 0;
There's no need for the feat_id enum to exist. If f2fs_feature_show() just
always printed "supported\n", it will do the right thing.
Also, adding pin_file probably should be a separate patch. That seems to be a
bug fix, as pin_file was mistakenly added to the per-sb feature list instead of
to the kernel feature list?
> +static ssize_t f2fs_sb_feature_show(struct f2fs_attr *a,
> + struct f2fs_sb_info *sbi, char *buf)
> +{
> + if (F2FS_MATCH_FEATURE(sbi, a->id))
> + return sprintf(buf, "supported\n");
> + return sprintf(buf, "unsupported\n");
> +}
This can just use F2FS_HAS_FEATURE(), provided that encrypted_casefold isn't
included here, which it shouldn't be (as discussed elsewhere).
- Eric
Powered by blists - more mailing lists