f2fs: cache: introduce metadata_cache sysfs node

This patch exposes a new sysfs node 'metadata_cache' under
/sys/fs/f2fs/features/ to indicate runtime support for the in-kernel
metadata cache infrastructure.

Userspace can check this feature entry to determine support before
configuring metadata cache knobs (e.g., cache_wb_interval) or parsing
per-cache memory statistics in debugfs.

Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Chao Yu 2026-10-07 11:49:45 +00:00 committed by Jaegeuk Kim
parent b9b036bd1e
commit e881f4730f
2 changed files with 3 additions and 1 deletions

View File

@ -271,7 +271,7 @@ Description: Shows all enabled kernel features.
inode_crtime, lost_found, verity, sb_checksum,
casefold, readonly, compression, test_dummy_encryption_v2,
atomic_write, pin_file, encrypted_casefold, linear_lookup,
fserror.
fserror, metadata_cache.
What: /sys/fs/f2fs/<disk>/inject_rate
Date: May 2016

View File

@ -1421,6 +1421,7 @@ F2FS_FEATURE_RO_ATTR(linear_lookup);
#endif
F2FS_FEATURE_RO_ATTR(packed_ssa);
F2FS_FEATURE_RO_ATTR(fserror);
F2FS_FEATURE_RO_ATTR(metadata_cache);
#define ATTR_LIST(name) (&f2fs_attr_##name.attr)
static struct attribute *f2fs_attrs[] = {
@ -1592,6 +1593,7 @@ static struct attribute *f2fs_feat_attrs[] = {
#endif
BASE_ATTR_LIST(packed_ssa),
BASE_ATTR_LIST(fserror),
BASE_ATTR_LIST(metadata_cache),
NULL,
};
ATTRIBUTE_GROUPS(f2fs_feat);