1 // SPDX-License-Identifier: GPL-2.0
3 * bcache sysfs interfaces
5 * Copyright 2010, 2011 Kent Overstreet <kent.overstreet@gmail.com>
6 * Copyright 2012 Google, Inc.
9 #ifndef NO_BCACHEFS_SYSFS
12 #include "alloc_background.h"
13 #include "alloc_foreground.h"
15 #include "btree_cache.h"
17 #include "btree_iter.h"
18 #include "btree_key_cache.h"
19 #include "btree_update.h"
20 #include "btree_update_interior.h"
24 #include "disk_groups.h"
31 #include "rebalance.h"
36 #include <linux/blkdev.h>
37 #include <linux/sort.h>
38 #include <linux/sched/clock.h>
42 #define SYSFS_OPS(type) \
43 struct sysfs_ops type ## _sysfs_ops = { \
44 .show = type ## _show, \
45 .store = type ## _store \
49 static ssize_t fn ## _show(struct kobject *kobj, struct attribute *attr,\
53 static ssize_t fn ## _store(struct kobject *kobj, struct attribute *attr,\
54 const char *buf, size_t size) \
56 #define __sysfs_attribute(_name, _mode) \
57 static struct attribute sysfs_##_name = \
58 { .name = #_name, .mode = _mode }
60 #define write_attribute(n) __sysfs_attribute(n, S_IWUSR)
61 #define read_attribute(n) __sysfs_attribute(n, S_IRUGO)
62 #define rw_attribute(n) __sysfs_attribute(n, S_IRUGO|S_IWUSR)
64 #define sysfs_printf(file, fmt, ...) \
66 if (attr == &sysfs_ ## file) \
67 return scnprintf(buf, PAGE_SIZE, fmt "\n", __VA_ARGS__);\
70 #define sysfs_print(file, var) \
72 if (attr == &sysfs_ ## file) \
73 return snprint(buf, PAGE_SIZE, var); \
76 #define sysfs_hprint(file, val) \
78 if (attr == &sysfs_ ## file) { \
79 bch2_hprint(&out, val); \
81 return out.pos - buf; \
85 #define var_printf(_var, fmt) sysfs_printf(_var, fmt, var(_var))
86 #define var_print(_var) sysfs_print(_var, var(_var))
87 #define var_hprint(_var) sysfs_hprint(_var, var(_var))
89 #define sysfs_strtoul(file, var) \
91 if (attr == &sysfs_ ## file) \
92 return strtoul_safe(buf, var) ?: (ssize_t) size; \
95 #define sysfs_strtoul_clamp(file, var, min, max) \
97 if (attr == &sysfs_ ## file) \
98 return strtoul_safe_clamp(buf, var, min, max) \
102 #define strtoul_or_return(cp) \
105 int _r = kstrtoul(cp, 10, &_v); \
111 #define strtoul_restrict_or_return(cp, min, max) \
113 unsigned long __v = 0; \
114 int _r = strtoul_safe_restrict(cp, __v, min, max); \
120 #define strtoi_h_or_return(cp) \
123 int _r = strtoi_h(cp, &_v); \
129 #define sysfs_hatoi(file, var) \
131 if (attr == &sysfs_ ## file) \
132 return strtoi_h(buf, &var) ?: (ssize_t) size; \
135 write_attribute(trigger_gc);
136 write_attribute(prune_cache);
137 rw_attribute(btree_gc_periodic);
138 rw_attribute(gc_gens_pos);
140 read_attribute(uuid);
141 read_attribute(minor);
142 read_attribute(bucket_size);
143 read_attribute(first_bucket);
144 read_attribute(nbuckets);
145 read_attribute(durability);
146 read_attribute(iodone);
148 read_attribute(io_latency_read);
149 read_attribute(io_latency_write);
150 read_attribute(io_latency_stats_read);
151 read_attribute(io_latency_stats_write);
152 read_attribute(congested);
154 read_attribute(btree_avg_write_size);
156 read_attribute(reserve_stats);
157 read_attribute(btree_cache_size);
158 read_attribute(compression_stats);
159 read_attribute(journal_debug);
160 read_attribute(journal_pins);
161 read_attribute(btree_updates);
162 read_attribute(dirty_btree_nodes);
163 read_attribute(btree_cache);
164 read_attribute(btree_key_cache);
165 read_attribute(btree_transactions);
166 read_attribute(stripes_heap);
167 read_attribute(open_buckets);
169 read_attribute(internal_uuid);
171 read_attribute(has_data);
172 read_attribute(alloc_debug);
173 write_attribute(wake_allocator);
175 read_attribute(read_realloc_races);
176 read_attribute(extent_migrate_done);
177 read_attribute(extent_migrate_raced);
179 rw_attribute(discard);
182 rw_attribute(copy_gc_enabled);
183 read_attribute(copy_gc_wait);
185 rw_attribute(rebalance_enabled);
186 sysfs_pd_controller_attribute(rebalance);
187 read_attribute(rebalance_work);
188 rw_attribute(promote_whole_extents);
190 read_attribute(new_stripes);
192 read_attribute(io_timers_read);
193 read_attribute(io_timers_write);
195 read_attribute(data_jobs);
197 #ifdef CONFIG_BCACHEFS_TESTS
198 write_attribute(perf_test);
199 #endif /* CONFIG_BCACHEFS_TESTS */
202 static struct attribute sysfs_time_stat_##_name = \
203 { .name = #_name, .mode = S_IRUGO };
207 static struct attribute sysfs_state_rw = {
212 static size_t bch2_btree_cache_size(struct bch_fs *c)
217 mutex_lock(&c->btree_cache.lock);
218 list_for_each_entry(b, &c->btree_cache.live, list)
219 ret += btree_bytes(c);
221 mutex_unlock(&c->btree_cache.lock);
225 static size_t bch2_btree_avg_write_size(struct bch_fs *c)
227 u64 nr = atomic64_read(&c->btree_writes_nr);
228 u64 sectors = atomic64_read(&c->btree_writes_sectors);
230 return nr ? div64_u64(sectors, nr) : 0;
233 static long data_progress_to_text(struct printbuf *out, struct bch_fs *c)
236 struct bch_move_stats *stats;
238 mutex_lock(&c->data_progress_lock);
239 list_for_each_entry(stats, &c->data_progress_list, list) {
240 pr_buf(out, "%s: data type %s btree_id %s position: ",
242 bch2_data_types[stats->data_type],
243 bch2_btree_ids[stats->btree_id]);
244 bch2_bpos_to_text(out, stats->pos);
245 pr_buf(out, "%s", "\n");
248 mutex_unlock(&c->data_progress_lock);
252 static int bch2_compression_stats_to_text(struct printbuf *out, struct bch_fs *c)
254 struct btree_trans trans;
255 struct btree_iter iter;
258 u64 nr_uncompressed_extents = 0,
259 nr_compressed_extents = 0,
260 nr_incompressible_extents = 0,
261 uncompressed_sectors = 0,
262 incompressible_sectors = 0,
263 compressed_sectors_compressed = 0,
264 compressed_sectors_uncompressed = 0;
267 if (!test_bit(BCH_FS_STARTED, &c->flags))
270 bch2_trans_init(&trans, c, 0, 0);
272 for (id = 0; id < BTREE_ID_NR; id++) {
273 if (!((1U << id) & BTREE_ID_HAS_PTRS))
276 for_each_btree_key(&trans, iter, id, POS_MIN,
277 BTREE_ITER_ALL_SNAPSHOTS, k, ret) {
278 struct bkey_ptrs_c ptrs = bch2_bkey_ptrs_c(k);
279 const union bch_extent_entry *entry;
280 struct extent_ptr_decoded p;
281 bool compressed = false, uncompressed = false, incompressible = false;
283 bkey_for_each_ptr_decode(k.k, ptrs, p, entry) {
284 switch (p.crc.compression_type) {
285 case BCH_COMPRESSION_TYPE_none:
287 uncompressed_sectors += k.k->size;
289 case BCH_COMPRESSION_TYPE_incompressible:
290 incompressible = true;
291 incompressible_sectors += k.k->size;
294 compressed_sectors_compressed +=
295 p.crc.compressed_size;
296 compressed_sectors_uncompressed +=
297 p.crc.uncompressed_size;
304 nr_incompressible_extents++;
305 else if (uncompressed)
306 nr_uncompressed_extents++;
308 nr_compressed_extents++;
310 bch2_trans_iter_exit(&trans, &iter);
313 bch2_trans_exit(&trans);
318 pr_buf(out, "uncompressed:\n");
319 pr_buf(out, " nr extents: %llu\n", nr_uncompressed_extents);
320 pr_buf(out, " size: ");
321 bch2_hprint(out, uncompressed_sectors << 9);
324 pr_buf(out, "compressed:\n");
325 pr_buf(out, " nr extents: %llu\n", nr_compressed_extents);
326 pr_buf(out, " compressed size: ");
327 bch2_hprint(out, compressed_sectors_compressed << 9);
329 pr_buf(out, " uncompressed size: ");
330 bch2_hprint(out, compressed_sectors_uncompressed << 9);
333 pr_buf(out, "incompressible:\n");
334 pr_buf(out, " nr extents: %llu\n", nr_incompressible_extents);
335 pr_buf(out, " size: ");
336 bch2_hprint(out, incompressible_sectors << 9);
341 static void bch2_gc_gens_pos_to_text(struct printbuf *out, struct bch_fs *c)
343 pr_buf(out, "%s: ", bch2_btree_ids[c->gc_gens_btree]);
344 bch2_bpos_to_text(out, c->gc_gens_pos);
350 struct bch_fs *c = container_of(kobj, struct bch_fs, kobj);
351 struct printbuf out = _PBUF(buf, PAGE_SIZE);
353 sysfs_print(minor, c->minor);
354 sysfs_printf(internal_uuid, "%pU", c->sb.uuid.b);
356 sysfs_hprint(btree_cache_size, bch2_btree_cache_size(c));
357 sysfs_hprint(btree_avg_write_size, bch2_btree_avg_write_size(c));
359 sysfs_print(read_realloc_races,
360 atomic_long_read(&c->read_realloc_races));
361 sysfs_print(extent_migrate_done,
362 atomic_long_read(&c->extent_migrate_done));
363 sysfs_print(extent_migrate_raced,
364 atomic_long_read(&c->extent_migrate_raced));
366 sysfs_printf(btree_gc_periodic, "%u", (int) c->btree_gc_periodic);
368 if (attr == &sysfs_gc_gens_pos) {
369 bch2_gc_gens_pos_to_text(&out, c);
370 return out.pos - buf;
373 sysfs_printf(copy_gc_enabled, "%i", c->copy_gc_enabled);
375 sysfs_printf(rebalance_enabled, "%i", c->rebalance.enabled);
376 sysfs_pd_controller_show(rebalance, &c->rebalance.pd); /* XXX */
377 sysfs_hprint(copy_gc_wait,
378 max(0LL, c->copygc_wait -
379 atomic64_read(&c->io_clock[WRITE].now)) << 9);
381 if (attr == &sysfs_rebalance_work) {
382 bch2_rebalance_work_to_text(&out, c);
383 return out.pos - buf;
386 sysfs_print(promote_whole_extents, c->promote_whole_extents);
390 if (attr == &sysfs_journal_debug) {
391 bch2_journal_debug_to_text(&out, &c->journal);
392 return out.pos - buf;
395 if (attr == &sysfs_journal_pins) {
396 bch2_journal_pins_to_text(&out, &c->journal);
397 return out.pos - buf;
400 if (attr == &sysfs_btree_updates) {
401 bch2_btree_updates_to_text(&out, c);
402 return out.pos - buf;
405 if (attr == &sysfs_dirty_btree_nodes) {
406 bch2_dirty_btree_nodes_to_text(&out, c);
407 return out.pos - buf;
410 if (attr == &sysfs_btree_cache) {
411 bch2_btree_cache_to_text(&out, c);
412 return out.pos - buf;
415 if (attr == &sysfs_btree_key_cache) {
416 bch2_btree_key_cache_to_text(&out, &c->btree_key_cache);
417 return out.pos - buf;
420 if (attr == &sysfs_btree_transactions) {
421 bch2_btree_trans_to_text(&out, c);
422 return out.pos - buf;
425 if (attr == &sysfs_stripes_heap) {
426 bch2_stripes_heap_to_text(&out, c);
427 return out.pos - buf;
430 if (attr == &sysfs_open_buckets) {
431 bch2_open_buckets_to_text(&out, c);
432 return out.pos - buf;
435 if (attr == &sysfs_compression_stats) {
436 bch2_compression_stats_to_text(&out, c);
437 return out.pos - buf;
440 if (attr == &sysfs_new_stripes) {
441 bch2_new_stripes_to_text(&out, c);
442 return out.pos - buf;
445 if (attr == &sysfs_io_timers_read) {
446 bch2_io_timers_to_text(&out, &c->io_clock[READ]);
447 return out.pos - buf;
449 if (attr == &sysfs_io_timers_write) {
450 bch2_io_timers_to_text(&out, &c->io_clock[WRITE]);
451 return out.pos - buf;
454 if (attr == &sysfs_data_jobs) {
455 data_progress_to_text(&out, c);
456 return out.pos - buf;
464 struct bch_fs *c = container_of(kobj, struct bch_fs, kobj);
466 if (attr == &sysfs_btree_gc_periodic) {
467 ssize_t ret = strtoul_safe(buf, c->btree_gc_periodic)
470 wake_up_process(c->gc_thread);
474 if (attr == &sysfs_copy_gc_enabled) {
475 ssize_t ret = strtoul_safe(buf, c->copy_gc_enabled)
478 if (c->copygc_thread)
479 wake_up_process(c->copygc_thread);
483 if (attr == &sysfs_rebalance_enabled) {
484 ssize_t ret = strtoul_safe(buf, c->rebalance.enabled)
491 sysfs_pd_controller_store(rebalance, &c->rebalance.pd);
493 sysfs_strtoul(promote_whole_extents, c->promote_whole_extents);
497 if (!test_bit(BCH_FS_STARTED, &c->flags))
502 if (!test_bit(BCH_FS_RW, &c->flags))
505 if (attr == &sysfs_prune_cache) {
506 struct shrink_control sc;
508 sc.gfp_mask = GFP_KERNEL;
509 sc.nr_to_scan = strtoul_or_return(buf);
510 c->btree_cache.shrink.scan_objects(&c->btree_cache.shrink, &sc);
513 if (attr == &sysfs_trigger_gc) {
515 * Full gc is currently incompatible with btree key cache:
518 down_read(&c->state_lock);
519 bch2_gc(c, false, false);
520 up_read(&c->state_lock);
526 #ifdef CONFIG_BCACHEFS_TESTS
527 if (attr == &sysfs_perf_test) {
528 char *tmp = kstrdup(buf, GFP_KERNEL), *p = tmp;
529 char *test = strsep(&p, " \t\n");
530 char *nr_str = strsep(&p, " \t\n");
531 char *threads_str = strsep(&p, " \t\n");
537 !(ret = kstrtouint(threads_str, 10, &threads)) &&
538 !(ret = bch2_strtoull_h(nr_str, &nr)))
539 ret = bch2_btree_perf_test(c, test, nr, threads);
550 struct attribute *bch2_fs_files[] = {
552 &sysfs_btree_cache_size,
553 &sysfs_btree_avg_write_size,
555 &sysfs_promote_whole_extents,
557 &sysfs_compression_stats,
559 #ifdef CONFIG_BCACHEFS_TESTS
565 /* internal dir - just a wrapper */
567 SHOW(bch2_fs_internal)
569 struct bch_fs *c = container_of(kobj, struct bch_fs, internal);
570 return bch2_fs_show(&c->kobj, attr, buf);
573 STORE(bch2_fs_internal)
575 struct bch_fs *c = container_of(kobj, struct bch_fs, internal);
576 return bch2_fs_store(&c->kobj, attr, buf, size);
578 SYSFS_OPS(bch2_fs_internal);
580 struct attribute *bch2_fs_internal_files[] = {
581 &sysfs_journal_debug,
583 &sysfs_btree_updates,
584 &sysfs_dirty_btree_nodes,
586 &sysfs_btree_key_cache,
587 &sysfs_btree_transactions,
591 &sysfs_io_timers_read,
592 &sysfs_io_timers_write,
597 &sysfs_read_realloc_races,
598 &sysfs_extent_migrate_done,
599 &sysfs_extent_migrate_raced,
603 &sysfs_copy_gc_enabled,
606 &sysfs_rebalance_enabled,
607 &sysfs_rebalance_work,
608 sysfs_pd_controller_files(rebalance),
612 &sysfs_internal_uuid,
618 SHOW(bch2_fs_opts_dir)
620 struct printbuf out = _PBUF(buf, PAGE_SIZE);
621 struct bch_fs *c = container_of(kobj, struct bch_fs, opts_dir);
622 const struct bch_option *opt = container_of(attr, struct bch_option, attr);
623 int id = opt - bch2_opt_table;
624 u64 v = bch2_opt_get_by_id(&c->opts, id);
626 bch2_opt_to_text(&out, c, opt, v, OPT_SHOW_FULL_LIST);
629 return out.pos - buf;
632 STORE(bch2_fs_opts_dir)
634 struct bch_fs *c = container_of(kobj, struct bch_fs, opts_dir);
635 const struct bch_option *opt = container_of(attr, struct bch_option, attr);
636 int ret, id = opt - bch2_opt_table;
640 tmp = kstrdup(buf, GFP_KERNEL);
644 ret = bch2_opt_parse(c, NULL, opt, strim(tmp), &v);
650 ret = bch2_opt_check_may_set(c, id, v);
654 bch2_opt_set_sb(c, opt, v);
655 bch2_opt_set_by_id(&c->opts, id, v);
657 if ((id == Opt_background_target ||
658 id == Opt_background_compression) && v) {
659 bch2_rebalance_add_work(c, S64_MAX);
665 SYSFS_OPS(bch2_fs_opts_dir);
667 struct attribute *bch2_fs_opts_dir_files[] = { NULL };
669 int bch2_opts_create_sysfs_files(struct kobject *kobj)
671 const struct bch_option *i;
674 for (i = bch2_opt_table;
675 i < bch2_opt_table + bch2_opts_nr;
677 if (!(i->flags & OPT_FS))
680 ret = sysfs_create_file(kobj, &i->attr);
690 SHOW(bch2_fs_time_stats)
692 struct bch_fs *c = container_of(kobj, struct bch_fs, time_stats);
693 struct printbuf out = _PBUF(buf, PAGE_SIZE);
696 if (attr == &sysfs_time_stat_##name) { \
697 bch2_time_stats_to_text(&out, &c->times[BCH_TIME_##name]);\
698 return out.pos - buf; \
706 STORE(bch2_fs_time_stats)
710 SYSFS_OPS(bch2_fs_time_stats);
712 struct attribute *bch2_fs_time_stats_files[] = {
714 &sysfs_time_stat_##name,
720 static void reserve_stats_to_text(struct printbuf *out, struct bch_dev *ca)
722 enum alloc_reserve i;
724 spin_lock(&ca->fs->freelist_lock);
726 pr_buf(out, "free_inc:\t%zu\t%zu\n",
727 fifo_used(&ca->free_inc),
730 for (i = 0; i < RESERVE_NR; i++)
731 pr_buf(out, "free[%u]:\t%zu\t%zu\n", i,
732 fifo_used(&ca->free[i]),
735 spin_unlock(&ca->fs->freelist_lock);
738 static void dev_alloc_debug_to_text(struct printbuf *out, struct bch_dev *ca)
740 struct bch_fs *c = ca->fs;
741 struct bch_dev_usage stats = bch2_dev_usage_read(ca);
742 unsigned i, nr[BCH_DATA_NR];
744 memset(nr, 0, sizeof(nr));
746 for (i = 0; i < ARRAY_SIZE(c->open_buckets); i++)
747 nr[c->open_buckets[i].data_type]++;
750 "\t\t buckets\t sectors fragmented\n"
752 ca->mi.nbuckets - ca->mi.first_bucket);
754 for (i = 1; i < BCH_DATA_NR; i++)
755 pr_buf(out, "%-8s%16llu%16llu%16llu\n",
756 bch2_data_types[i], stats.d[i].buckets,
757 stats.d[i].sectors, stats.d[i].fragmented);
763 "free_inc\t\t%zu/%zu\n"
764 "free[RESERVE_MOVINGGC]\t%zu/%zu\n"
765 "free[RESERVE_NONE]\t%zu/%zu\n"
766 "freelist_wait\t\t%s\n"
767 "open buckets allocated\t%u\n"
768 "open buckets this dev\t%u\n"
769 "open buckets total\t%u\n"
770 "open_buckets_wait\t%s\n"
771 "open_buckets_btree\t%u\n"
772 "open_buckets_user\t%u\n"
773 "btree reserve cache\t%u\n"
774 "thread state:\t\t%s\n",
776 __dev_buckets_available(ca, stats),
777 fifo_used(&ca->free_inc), ca->free_inc.size,
778 fifo_used(&ca->free[RESERVE_MOVINGGC]), ca->free[RESERVE_MOVINGGC].size,
779 fifo_used(&ca->free[RESERVE_NONE]), ca->free[RESERVE_NONE].size,
780 c->freelist_wait.list.first ? "waiting" : "empty",
781 OPEN_BUCKETS_COUNT - c->open_buckets_nr_free,
784 c->open_buckets_wait.list.first ? "waiting" : "empty",
787 c->btree_reserve_cache_nr,
788 bch2_allocator_states[ca->allocator_state]);
791 static const char * const bch2_rw[] = {
797 static void dev_iodone_to_text(struct printbuf *out, struct bch_dev *ca)
801 for (rw = 0; rw < 2; rw++) {
802 pr_buf(out, "%s:\n", bch2_rw[rw]);
804 for (i = 1; i < BCH_DATA_NR; i++)
805 pr_buf(out, "%-12s:%12llu\n",
807 percpu_u64_get(&ca->io_done->sectors[rw][i]) << 9);
813 struct bch_dev *ca = container_of(kobj, struct bch_dev, kobj);
814 struct bch_fs *c = ca->fs;
815 struct printbuf out = _PBUF(buf, PAGE_SIZE);
817 sysfs_printf(uuid, "%pU\n", ca->uuid.b);
819 sysfs_print(bucket_size, bucket_bytes(ca));
820 sysfs_print(first_bucket, ca->mi.first_bucket);
821 sysfs_print(nbuckets, ca->mi.nbuckets);
822 sysfs_print(durability, ca->mi.durability);
823 sysfs_print(discard, ca->mi.discard);
825 if (attr == &sysfs_label) {
827 mutex_lock(&c->sb_lock);
828 bch2_disk_path_to_text(&out, &c->disk_sb,
830 mutex_unlock(&c->sb_lock);
834 return out.pos - buf;
837 if (attr == &sysfs_has_data) {
838 bch2_flags_to_text(&out, bch2_data_types,
839 bch2_dev_has_data(c, ca));
841 return out.pos - buf;
844 if (attr == &sysfs_state_rw) {
845 bch2_string_opt_to_text(&out, bch2_member_states,
848 return out.pos - buf;
851 if (attr == &sysfs_iodone) {
852 dev_iodone_to_text(&out, ca);
853 return out.pos - buf;
856 sysfs_print(io_latency_read, atomic64_read(&ca->cur_latency[READ]));
857 sysfs_print(io_latency_write, atomic64_read(&ca->cur_latency[WRITE]));
859 if (attr == &sysfs_io_latency_stats_read) {
860 bch2_time_stats_to_text(&out, &ca->io_latency[READ]);
861 return out.pos - buf;
863 if (attr == &sysfs_io_latency_stats_write) {
864 bch2_time_stats_to_text(&out, &ca->io_latency[WRITE]);
865 return out.pos - buf;
868 sysfs_printf(congested, "%u%%",
869 clamp(atomic_read(&ca->congested), 0, CONGESTED_MAX)
870 * 100 / CONGESTED_MAX);
872 if (attr == &sysfs_reserve_stats) {
873 reserve_stats_to_text(&out, ca);
874 return out.pos - buf;
876 if (attr == &sysfs_alloc_debug) {
877 dev_alloc_debug_to_text(&out, ca);
878 return out.pos - buf;
886 struct bch_dev *ca = container_of(kobj, struct bch_dev, kobj);
887 struct bch_fs *c = ca->fs;
888 struct bch_member *mi;
890 if (attr == &sysfs_discard) {
891 bool v = strtoul_or_return(buf);
893 mutex_lock(&c->sb_lock);
894 mi = &bch2_sb_get_members(c->disk_sb.sb)->members[ca->dev_idx];
896 if (v != BCH_MEMBER_DISCARD(mi)) {
897 SET_BCH_MEMBER_DISCARD(mi, v);
900 mutex_unlock(&c->sb_lock);
903 if (attr == &sysfs_label) {
907 tmp = kstrdup(buf, GFP_KERNEL);
911 ret = bch2_dev_group_set(c, ca, strim(tmp));
917 if (attr == &sysfs_wake_allocator)
918 bch2_wake_allocator(ca);
924 struct attribute *bch2_dev_files[] = {
939 &sysfs_io_latency_read,
940 &sysfs_io_latency_write,
941 &sysfs_io_latency_stats_read,
942 &sysfs_io_latency_stats_write,
945 &sysfs_reserve_stats,
949 &sysfs_wake_allocator,
953 #endif /* _BCACHEFS_SYSFS_H_ */