f2fs: clean up /sys/fs/f2fs/<disk>/features
authorJaegeuk Kim <jaegeuk@kernel.org>
Thu, 3 Jun 2021 19:31:08 +0000 (12:31 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 23 Jun 2021 08:09:35 +0000 (01:09 -0700)
commit4c89b53d05f1f5d25e9aec09c00351994101cc97
treeaf624cd168031810162bb5a39ecd27d3b3e6c9b4
parent4a196df4cfba0b6a74023e6b36427f2bf2ddcdba
f2fs: clean up /sys/fs/f2fs/<disk>/features

Let's create /sys/fs/f2fs/<disk>/feature_list/ to meet sysfs rule.

Note that there are three feature list entries:
1) /sys/fs/f2fs/features
  : shows runtime features supported by in-kernel f2fs along with Kconfig.
    - ref. F2FS_FEATURE_RO_ATTR()

2) /sys/fs/f2fs/$s_id/features <deprecated>
  : shows on-disk features enabled by mkfs.f2fs, used for old kernels. This
    won't add new feature anymore, and thus, users should check entries in 3)
    instead of this 2).

3) /sys/fs/f2fs/$s_id/feature_list
  : shows on-disk features enabled by mkfs.f2fs per instance, which follows
    sysfs entry rule where each entry should expose single value.
    This list covers old feature list provided by 2) and beyond. Therefore,
    please add new on-disk feature in this list only.
    - ref. F2FS_SB_FEATURE_RO_ATTR()

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Documentation/ABI/testing/sysfs-fs-f2fs
fs/f2fs/f2fs.h
fs/f2fs/sysfs.c