diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-07 02:57:43 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-21 12:01:45 +0100 |
commit | e58f963cecbdb08f28334122afba93a7840beabc (patch) | |
tree | 0a5e9dd89fceeb1fbd8550958dfe44d1d7981cad /fs/bcachefs/sysfs.c | |
parent | bcachefs: BTREE_TRIGGER_ATOMIC (diff) | |
download | linux-e58f963cecbdb08f28334122afba93a7840beabc.tar.xz linux-e58f963cecbdb08f28334122afba93a7840beabc.zip |
bcachefs: helpers for printing data types
We need bounds checking since new versions may introduce new data types.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to '')
-rw-r--r-- | fs/bcachefs/sysfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/sysfs.c b/fs/bcachefs/sysfs.c index 8ed52319ff68..434961e400e2 100644 --- a/fs/bcachefs/sysfs.c +++ b/fs/bcachefs/sysfs.c @@ -883,7 +883,7 @@ static void dev_io_done_to_text(struct printbuf *out, struct bch_dev *ca) for (i = 1; i < BCH_DATA_NR; i++) prt_printf(out, "%-12s:%12llu\n", - bch2_data_types[i], + bch2_data_type_str(i), percpu_u64_get(&ca->io_done->sectors[rw][i]) << 9); } } @@ -908,7 +908,7 @@ SHOW(bch2_dev) } if (attr == &sysfs_has_data) { - prt_bitflags(out, bch2_data_types, bch2_dev_has_data(c, ca)); + prt_bitflags(out, __bch2_data_types, bch2_dev_has_data(c, ca)); prt_char(out, '\n'); } |