From e881f4730f758cdb6db84cbda1b3d22b26aa497c Mon Sep 17 00:00:00 2001 From: Chao Yu Date: Wed, 7 Oct 2026 11:49:45 +0000 Subject: [PATCH] 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 Signed-off-by: Jaegeuk Kim --- Documentation/ABI/testing/sysfs-fs-f2fs | 2 +- fs/f2fs/sysfs.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs b/Documentation/ABI/testing/sysfs-fs-f2fs index c4746c416ac2..5b196806b3bc 100644 --- a/Documentation/ABI/testing/sysfs-fs-f2fs +++ b/Documentation/ABI/testing/sysfs-fs-f2fs @@ -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//inject_rate Date: May 2016 diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 9749da70089a..afce74744d4d 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -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);