diff options
author | Coly Li <colyli@suse.de> | 2020-07-25 20:00:36 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-07-25 07:38:21 -0600 |
commit | 092bd54d69230b4a4a7f640a4cdcdeb004d3546e (patch) | |
tree | 9bd4a363c21ace95a6613db3eaf45cd390a62924 /drivers/md/bcache/features.h | |
parent | ffa470327572b8f85dceda48fd0676d9658cb8c5 (diff) |
bcache: add sysfs file to display feature sets information of cache set
The following three sysfs files are created to display according feature
set information of bcache:
/sys/fs/bcache/<cache set UUID>/internal/feature_compat
/sys/fs/bcache/<cache set UUID>/internal/feature_ro_compat
/sys/fs/bcache/<cache set UUID>/internal/feature_incompat
is added by this patch, to display feature sets information of the cache
set.
Now only an incompat feature 'large_bucket' added in bcache, the sysfs
file content is:
[large_bucket]
string large_bucket means the running bcache drive supports incompat
feature 'large_bucket', the wrapping [] means the 'large_bucket' feature
is currently enabled on this cache set.
This patch is ready to display compat and ro_compat features, in future
once bcache code implements such feature sets, the according feature
strings will be displayed in their sysfs files too.
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/bcache/features.h')
-rw-r--r-- | drivers/md/bcache/features.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/bcache/features.h b/drivers/md/bcache/features.h index dca052cf5203..a1653c478041 100644 --- a/drivers/md/bcache/features.h +++ b/drivers/md/bcache/features.h @@ -78,4 +78,9 @@ static inline void bch_clear_feature_##name(struct cache_sb *sb) \ } BCH_FEATURE_INCOMPAT_FUNCS(large_bucket, LARGE_BUCKET); + +int bch_print_cache_set_feature_compat(struct cache_set *c, char *buf, int size); +int bch_print_cache_set_feature_ro_compat(struct cache_set *c, char *buf, int size); +int bch_print_cache_set_feature_incompat(struct cache_set *c, char *buf, int size); + #endif |