diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-04-18 21:54:12 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-05-21 20:14:28 -0400 |
commit | cca2c0d224c17c99fb2ee7674284f89ce8389f3a (patch) | |
tree | f42ba67ed541b095cc0dba1fa946d02315efd10f /fs/bcachefs/sysfs.c | |
parent | c9b1d94a2196fcfd1985ff8728b22abda400b1ac (diff) |
bcachefs: bch_dev.io_ref -> enumerated_ref
Convert device IO refs to enumerated_refs, for easier debugging of
refcount issues.
Simple conversion: enumerate all users and convert to the new helpers.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/sysfs.c')
-rw-r--r-- | fs/bcachefs/sysfs.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/fs/bcachefs/sysfs.c b/fs/bcachefs/sysfs.c index b80c46af13d4..dfae5eda7a4c 100644 --- a/fs/bcachefs/sysfs.c +++ b/fs/bcachefs/sysfs.c @@ -176,14 +176,9 @@ read_attribute(btree_reserve_cache); read_attribute(open_buckets); read_attribute(open_buckets_partial); read_attribute(nocow_lock_table); -read_attribute(write_refs); -static const char * const bch2_write_refs[] = { -#define x(n) #n, - BCH_WRITE_REFS() -#undef x - NULL -}; +read_attribute(read_refs); +read_attribute(write_refs); read_attribute(internal_uuid); read_attribute(disk_groups); @@ -790,6 +785,12 @@ SHOW(bch2_dev) if (opt_id >= 0) return sysfs_opt_show(c, ca, opt_id, out); + if (attr == &sysfs_read_refs) + enumerated_ref_to_text(out, &ca->io_ref[READ], bch2_dev_read_refs); + + if (attr == &sysfs_write_refs) + enumerated_ref_to_text(out, &ca->io_ref[WRITE], bch2_dev_write_refs); + return 0; } @@ -845,6 +846,9 @@ struct attribute *bch2_dev_files[] = { /* debug: */ &sysfs_alloc_debug, &sysfs_open_buckets, + + &sysfs_read_refs, + &sysfs_write_refs, NULL }; |