summaryrefslogtreecommitdiff
path: root/libbcachefs/sysfs.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-12-13 18:27:31 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2022-12-13 18:27:31 -0500
commit3c0484687d00f3f2818d13c0c6f65123abcf4517 (patch)
treebf288e3d6c1f0c085db0af3fb472f2214c7775f0 /libbcachefs/sysfs.c
parenta06dee6da2babd19a392ff30a399b89b85018a36 (diff)
Update bcachefs sources to 84505cfd37 bcachefs: Go RW before check_alloc_info()
Diffstat (limited to 'libbcachefs/sysfs.c')
-rw-r--r--libbcachefs/sysfs.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libbcachefs/sysfs.c b/libbcachefs/sysfs.c
index 647d018b..bad3eafd 100644
--- a/libbcachefs/sysfs.c
+++ b/libbcachefs/sysfs.c
@@ -194,6 +194,7 @@ read_attribute(btree_cache);
read_attribute(btree_key_cache);
read_attribute(stripes_heap);
read_attribute(open_buckets);
+read_attribute(nocow_lock_table);
read_attribute(internal_uuid);
@@ -445,6 +446,22 @@ SHOW(bch2_fs)
if (attr == &sysfs_data_jobs)
data_progress_to_text(out, c);
+ if (attr == &sysfs_nocow_lock_table) {
+ int i, count = 1;
+ long last, curr = 0;
+
+ last = atomic_long_read(&c->nocow_locks.l[0].v);
+ for (i = 1; i < BUCKET_NOCOW_LOCKS; i++) {
+ curr = atomic_long_read(&c->nocow_locks.l[i].v);
+ if (last != curr) {
+ prt_printf(out, "%li: %d\n", last, count);
+ count = 1;
+ last = curr;
+ } else
+ count++;
+ }
+ prt_printf(out, "%li: %d\n", last, count);
+}
return 0;
}
@@ -627,6 +644,7 @@ struct attribute *bch2_fs_internal_files[] = {
&sysfs_new_stripes,
&sysfs_stripes_heap,
&sysfs_open_buckets,
+ &sysfs_nocow_lock_table,
&sysfs_io_timers_read,
&sysfs_io_timers_write,