Lines Matching +full:mi +full:- +full:v

1 // SPDX-License-Identifier: GPL-2.0
38 #include "super-io.h"
63 if (out.pos && out.buf[out.pos - 1] != '\n') \
67 ret = -ENOMEM; \
70 ret = min_t(size_t, out.pos, PAGE_SIZE - 1); \
193 for (unsigned i = 0; i < ARRAY_SIZE(c->writes); i++) in bch2_write_refs_to_text()
194 prt_printf(out, "%s\t%li\n", bch2_write_refs[i], atomic_long_read(&c->writes[i])); in bch2_write_refs_to_text()
235 struct btree_cache *bc = &c->btree_cache; in BCH_TIME_STATS()
239 mutex_lock(&bc->lock); in BCH_TIME_STATS()
240 list_for_each_entry(b, &bc->live[0].list, list) in BCH_TIME_STATS()
242 list_for_each_entry(b, &bc->live[1].list, list) in BCH_TIME_STATS()
244 list_for_each_entry(b, &bc->freeable, list) in BCH_TIME_STATS()
246 mutex_unlock(&bc->lock); in BCH_TIME_STATS()
263 u64 v[3]; in bch2_compression_stats_to_text() local
264 bch2_accounting_mem_read(c, p, v, ARRAY_SIZE(v)); in bch2_compression_stats_to_text()
266 u64 nr_extents = v[0]; in bch2_compression_stats_to_text()
267 u64 sectors_uncompressed = v[1]; in bch2_compression_stats_to_text()
268 u64 sectors_compressed = v[2]; in bch2_compression_stats_to_text()
291 bch2_btree_id_to_text(out, c->gc_gens_btree); in bch2_gc_gens_pos_to_text()
293 bch2_bpos_to_text(out, c->gc_gens_pos); in bch2_gc_gens_pos_to_text()
301 acc_u64s_percpu(&b.hidden, &c->usage->hidden, sizeof(b) / sizeof(u64)); in bch2_fs_usage_base_to_text()
315 sysfs_print(minor, c->minor); in SHOW()
316 sysfs_printf(internal_uuid, "%pU", c->sb.uuid.b); in SHOW()
319 prt_bitflags(out, bch2_fs_flag_strs, c->flags); in SHOW()
329 sysfs_pd_controller_show(rebalance, &c->rebalance.pd); /* XXX */ in SHOW()
340 bch2_journal_debug_to_text(out, &c->journal); in SHOW()
343 bch2_btree_cache_to_text(out, &c->btree_cache); in SHOW()
346 bch2_btree_key_cache_to_text(out, &c->btree_key_cache); in SHOW()
364 bch2_io_timers_to_text(out, &c->io_clock[READ]); in SHOW()
367 bch2_io_timers_to_text(out, &c->io_clock[WRITE]); in SHOW()
378 bch2_nocow_locks_to_text(out, &c->nocow_locks); in SHOW()
396 sysfs_pd_controller_store(rebalance, &c->rebalance.pd); in STORE()
400 if (!test_bit(BCH_FS_started, &c->flags)) in STORE()
401 return -EPERM; in STORE()
406 queue_work(c->btree_interior_update_worker, &c->btree_interior_update_work); in STORE()
409 return -EROFS; in STORE()
412 struct btree_cache *bc = &c->btree_cache; in STORE()
417 bc->live[0].shrink->scan_objects(bc->live[0].shrink, &sc); in STORE()
425 c->btree_key_cache.shrink->scan_objects(c->btree_key_cache.shrink, &sc); in STORE()
438 bch2_journal_flush_all_pins(&c->journal); in STORE()
439 bch2_journal_meta(&c->journal); in STORE()
443 bch2_journal_do_writes(&c->journal); in STORE()
446 closure_wake_up(&c->freelist_wait); in STORE()
456 int ret = -EINVAL; in STORE()
500 counter = percpu_u64_get(&c->counters[BCH_COUNTER_##t]);\ in SHOW()
501 counter_since_mount = counter - c->counters_on_mount[BCH_COUNTER_##t];\ in SHOW()
535 /* internal dir - just a wrapper */
541 return bch2_fs_to_text(out, &c->kobj, attr); in SHOW()
548 return bch2_fs_store(&c->kobj, attr, buf, size); in STORE()
602 u64 v; in sysfs_opt_show() local
604 if (opt->flags & OPT_FS) { in sysfs_opt_show()
605 v = bch2_opt_get_by_id(&c->opts, id); in sysfs_opt_show()
606 } else if ((opt->flags & OPT_DEVICE) && opt->get_member) { in sysfs_opt_show()
607 v = bch2_opt_from_sb(c->disk_sb.sb, id, ca->dev_idx); in sysfs_opt_show()
609 return -EINVAL; in sysfs_opt_show()
612 bch2_opt_to_text(out, c, c->disk_sb.sb, opt, v, OPT_SHOW_FULL_LIST); in sysfs_opt_show()
626 * We don't need to take c->writes for correctness, but it eliminates an in sysfs_opt_store()
630 return -EROFS; in sysfs_opt_store()
634 ret = -ENOMEM; in sysfs_opt_store()
638 u64 v; in sysfs_opt_store() local
639 ret = bch2_opt_parse(c, opt, strim(tmp), &v, NULL) ?: in sysfs_opt_store()
640 bch2_opt_check_may_set(c, ca, id, v); in sysfs_opt_store()
646 bch2_opt_set_sb(c, ca, opt, v); in sysfs_opt_store()
647 bch2_opt_set_by_id(&c->opts, id, v); in sysfs_opt_store()
649 if (v && in sysfs_opt_store()
651 (id == Opt_foreground_target && !c->opts.background_target) || in sysfs_opt_store()
653 (id == Opt_compression && !c->opts.background_compression))) in sysfs_opt_store()
656 if (v && id == Opt_rebalance_enabled) in sysfs_opt_store()
659 if (v && id == Opt_copygc_enabled) in sysfs_opt_store()
663 mutex_lock(&c->sb_lock); in sysfs_opt_store()
665 opt->set_member(bch2_members_v2_get_mut(ca->disk_sb.sb, ca->dev_idx), v); in sysfs_opt_store()
668 mutex_unlock(&c->sb_lock); in sysfs_opt_store()
680 int id = bch2_opt_lookup(attr->name); in SHOW()
690 int id = bch2_opt_lookup(attr->name); in STORE()
705 if (i->flags & OPT_HIDDEN) in bch2_opts_create_sysfs_files()
707 if (!(i->flags & type)) in bch2_opts_create_sysfs_files()
710 int ret = sysfs_create_file(kobj, &i->attr); in bch2_opts_create_sysfs_files()
726 bch2_time_stats_to_text(out, &c->times[BCH_TIME_##name]); in SHOW()
739 bch2_time_stats_reset(&c->times[BCH_TIME_##name]); in STORE()
768 prt_printf(out, "%-12s:%12llu\n", in dev_io_done_to_text()
770 percpu_u64_get(&ca->io_done->sectors[rw][i]) << 9); in dev_io_done_to_text()
777 struct bch_fs *c = ca->fs; in SHOW()
779 sysfs_printf(uuid, "%pU\n", ca->uuid.b); in SHOW()
781 sysfs_print(first_bucket, ca->mi.first_bucket); in SHOW()
782 sysfs_print(nbuckets, ca->mi.nbuckets); in SHOW()
785 if (ca->mi.group) in SHOW()
786 bch2_disk_path_to_text(out, c, ca->mi.group - 1); in SHOW()
801 sysfs_print(io_latency_read, atomic64_read(&ca->cur_latency[READ])); in SHOW()
802 sysfs_print(io_latency_write, atomic64_read(&ca->cur_latency[WRITE])); in SHOW()
805 bch2_time_stats_to_text(out, &ca->io_latency[READ].stats); in SHOW()
808 bch2_time_stats_to_text(out, &ca->io_latency[WRITE].stats); in SHOW()
811 clamp(atomic_read(&ca->congested), 0, CONGESTED_MAX) in SHOW()
820 int opt_id = bch2_opt_lookup(attr->name); in SHOW()
830 struct bch_fs *c = ca->fs; in STORE()
838 return -ENOMEM; in STORE()
849 int opt_id = bch2_opt_lookup(attr->name); in STORE()