summaryrefslogtreecommitdiff
path: root/libbcachefs/sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbcachefs/sysfs.c')
-rw-r--r--libbcachefs/sysfs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libbcachefs/sysfs.c b/libbcachefs/sysfs.c
index 9f8ca6a5..4a373581 100644
--- a/libbcachefs/sysfs.c
+++ b/libbcachefs/sysfs.c
@@ -233,7 +233,7 @@ write_attribute(perf_test);
#define x(_name) \
static struct attribute sysfs_time_stat_##_name = \
- { .name = #_name, .mode = 0444 };
+ { .name = #_name, .mode = 0644 };
BCH_TIME_STATS()
#undef x
@@ -722,6 +722,13 @@ SHOW(bch2_fs_time_stats)
STORE(bch2_fs_time_stats)
{
+ struct bch_fs *c = container_of(kobj, struct bch_fs, time_stats);
+
+#define x(name) \
+ if (attr == &sysfs_time_stat_##name) \
+ bch2_time_stats_reset(&c->times[BCH_TIME_##name]);
+ BCH_TIME_STATS()
+#undef x
return size;
}
SYSFS_OPS(bch2_fs_time_stats);