diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-10-23 17:39:22 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2022-10-23 18:24:08 -0400 |
commit | ae43a58d97fc00e31770142da832fb8a249808eb (patch) | |
tree | 95c8fced05f8054eb135b309417415dfa3e5eb18 /libbcachefs/sysfs.c | |
parent | 188b6d0c8ef1c02462a744b176557c27220112c9 (diff) |
Update bcachefs sources to 70fa0c1ff4 fixup! bcachefs: Btree key cache improvements
Diffstat (limited to 'libbcachefs/sysfs.c')
-rw-r--r-- | libbcachefs/sysfs.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libbcachefs/sysfs.c b/libbcachefs/sysfs.c index 0f45aef7..06b2924c 100644 --- a/libbcachefs/sysfs.c +++ b/libbcachefs/sysfs.c @@ -90,9 +90,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) @@ -613,12 +613,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); |