From a10195764901e0a41e64d596de57a957e7f982f0 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sat, 22 Oct 2022 15:59:53 -0400 Subject: bcachefs: More style fixes Fixes for various checkpatch errors. Signed-off-by: Kent Overstreet --- fs/bcachefs/sysfs.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'fs/bcachefs/sysfs.c') diff --git a/fs/bcachefs/sysfs.c b/fs/bcachefs/sysfs.c index db3d377ba10c..7ccdf3197d51 100644 --- a/fs/bcachefs/sysfs.c +++ b/fs/bcachefs/sysfs.c @@ -89,9 +89,9 @@ static ssize_t fn ## _store_inner(struct kobject *kobj, struct attribute *attr,\ static struct attribute sysfs_##_name = \ { .name = #_name, .mode = _mode } -#define write_attribute(n) __sysfs_attribute(n, S_IWUSR) -#define read_attribute(n) __sysfs_attribute(n, S_IRUGO) -#define rw_attribute(n) __sysfs_attribute(n, S_IRUGO|S_IWUSR) +#define write_attribute(n) __sysfs_attribute(n, 0200) +#define read_attribute(n) __sysfs_attribute(n, 0444) +#define rw_attribute(n) __sysfs_attribute(n, 0644) #define sysfs_printf(file, fmt, ...) \ do { \ @@ -228,13 +228,13 @@ write_attribute(perf_test); #define x(_name) \ static struct attribute sysfs_time_stat_##_name = \ - { .name = #_name, .mode = S_IRUGO }; + { .name = #_name, .mode = 0444 }; BCH_TIME_STATS() #undef x static struct attribute sysfs_state_rw = { .name = "state", - .mode = S_IRUGO + .mode = 0444, }; static size_t bch2_btree_cache_size(struct bch_fs *c) @@ -610,12 +610,14 @@ struct attribute *bch2_fs_counters_files[] = { SHOW(bch2_fs_internal) { struct bch_fs *c = container_of(kobj, struct bch_fs, internal); + return bch2_fs_to_text(out, &c->kobj, attr); } STORE(bch2_fs_internal) { struct bch_fs *c = container_of(kobj, struct bch_fs, internal); + return bch2_fs_store(&c->kobj, attr, buf, size); } SYSFS_OPS(bch2_fs_internal); -- cgit v1.2.3