From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Eric Biggers <ebiggers@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH v2] f2fs: clean up /sys/fs/f2fs/<disk>/features
Date: Thu, 3 Jun 2021 22:34:48 -0700 [thread overview]
Message-ID: <YLm7eCBkwuU0cZws@google.com> (raw)
In-Reply-To: <YLm12A7qKFyYYU0Z@sol.localdomain>
On 06/03, Eric Biggers wrote:
> 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.
Done.
>
> 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?
Done.
>
> > +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).
I know, but I think it'd be good to sync with kernel feature.
>
> - Eric
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Eric Biggers <ebiggers@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH v2] f2fs: clean up /sys/fs/f2fs/<disk>/features
Date: Thu, 3 Jun 2021 22:34:48 -0700 [thread overview]
Message-ID: <YLm7eCBkwuU0cZws@google.com> (raw)
In-Reply-To: <YLm12A7qKFyYYU0Z@sol.localdomain>
On 06/03, Eric Biggers wrote:
> 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.
Done.
>
> 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?
Done.
>
> > +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).
I know, but I think it'd be good to sync with kernel feature.
>
> - Eric
next prev parent reply other threads:[~2021-06-04 5:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-03 22:08 [f2fs-dev] [PATCH] f2fs: clean up /sys/fs/f2fs/<disk>/features Jaegeuk Kim
2021-06-03 22:08 ` Jaegeuk Kim
2021-06-04 0:40 ` [f2fs-dev] " Eric Biggers
2021-06-04 0:40 ` Eric Biggers
2021-06-04 4:41 ` Jaegeuk Kim
2021-06-04 4:41 ` Jaegeuk Kim
2021-06-04 4:42 ` [f2fs-dev] [PATCH v2] " Jaegeuk Kim
2021-06-04 4:42 ` Jaegeuk Kim
2021-06-04 5:10 ` [f2fs-dev] " Eric Biggers
2021-06-04 5:10 ` Eric Biggers
2021-06-04 5:34 ` Jaegeuk Kim [this message]
2021-06-04 5:34 ` Jaegeuk Kim
2021-06-04 5:49 ` [f2fs-dev] [PATCH v3] " Jaegeuk Kim
2021-06-04 5:49 ` Jaegeuk Kim
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=YLm7eCBkwuU0cZws@google.com \
--to=jaegeuk@kernel.org \
--cc=ebiggers@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@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 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.