Lines Matching +full:read +full:- +full:out
1 // SPDX-License-Identifier: GPL-2.0
38 struct btree *v = c->verify_data; in bch2_btree_verify_replica()
39 struct btree_node *n_ondisk = c->verify_ondisk; in bch2_btree_verify_replica()
40 struct btree_node *n_sorted = c->verify_data->data; in bch2_btree_verify_replica()
41 struct bset *sorted, *inmemory = &b->data->keys; in bch2_btree_verify_replica()
45 struct bch_dev *ca = bch2_dev_get_ioref(c, pick.ptr.dev, READ); in bch2_btree_verify_replica()
49 bio = bio_alloc_bioset(ca->disk_sb.bdev, in bch2_btree_verify_replica()
53 &c->btree_bio); in bch2_btree_verify_replica()
54 bio->bi_iter.bi_sector = pick.ptr.offset; in bch2_btree_verify_replica()
60 percpu_ref_put(&ca->io_ref[READ]); in bch2_btree_verify_replica()
64 v->written = 0; in bch2_btree_verify_replica()
68 n_sorted = c->verify_data->data; in bch2_btree_verify_replica()
69 sorted = &n_sorted->keys; in bch2_btree_verify_replica()
71 if (inmemory->u64s != sorted->u64s || in bch2_btree_verify_replica()
72 memcmp(inmemory->start, in bch2_btree_verify_replica()
73 sorted->start, in bch2_btree_verify_replica()
74 vstruct_end(inmemory) - (void *) inmemory->start)) { in bch2_btree_verify_replica()
84 printk(KERN_ERR "*** read back in:\n"); in bch2_btree_verify_replica()
87 while (offset < v->written) { in bch2_btree_verify_replica()
89 i = &n_ondisk->keys; in bch2_btree_verify_replica()
90 sectors = vstruct_blocks(n_ondisk, c->block_bits) << in bch2_btree_verify_replica()
91 c->block_bits; in bch2_btree_verify_replica()
95 i = &bne->keys; in bch2_btree_verify_replica()
97 sectors = vstruct_blocks(bne, c->block_bits) << in bch2_btree_verify_replica()
98 c->block_bits; in bch2_btree_verify_replica()
107 for (j = 0; j < le16_to_cpu(inmemory->u64s); j++) in bch2_btree_verify_replica()
108 if (inmemory->_data[j] != sorted->_data[j]) in bch2_btree_verify_replica()
117 if (v->written != b->written) { in bch2_btree_verify_replica()
119 b->written, v->written); in bch2_btree_verify_replica()
132 struct bset *inmemory = &b->data->keys; in __bch2_btree_verify()
136 if (c->opts.nochanges) in __bch2_btree_verify()
140 mutex_lock(&c->verify_lock); in __bch2_btree_verify()
142 if (!c->verify_ondisk) { in __bch2_btree_verify()
143 c->verify_ondisk = kvmalloc(btree_buf_bytes(b), GFP_KERNEL); in __bch2_btree_verify()
144 if (!c->verify_ondisk) in __bch2_btree_verify()
145 goto out; in __bch2_btree_verify()
148 if (!c->verify_data) { in __bch2_btree_verify()
149 c->verify_data = __bch2_btree_node_mem_alloc(c); in __bch2_btree_verify()
150 if (!c->verify_data) in __bch2_btree_verify()
151 goto out; in __bch2_btree_verify()
153 list_del_init(&c->verify_data->list); in __bch2_btree_verify()
156 BUG_ON(b->nsets != 1); in __bch2_btree_verify()
158 for (k = inmemory->start; k != vstruct_last(inmemory); k = bkey_p_next(k)) in __bch2_btree_verify()
159 if (k->type == KEY_TYPE_btree_ptr_v2) in __bch2_btree_verify()
160 ((struct bch_btree_ptr_v2 *) bkeyp_val(&b->format, k))->mem_ptr = 0; in __bch2_btree_verify()
162 v = c->verify_data; in __bch2_btree_verify()
163 bkey_copy(&v->key, &b->key); in __bch2_btree_verify()
164 v->c.level = b->c.level; in __bch2_btree_verify()
165 v->c.btree_id = b->c.btree_id; in __bch2_btree_verify()
168 ptrs = bch2_bkey_ptrs_c(bkey_i_to_s_c(&b->key)); in __bch2_btree_verify()
169 bkey_for_each_ptr_decode(&b->key.k, ptrs, p, entry) in __bch2_btree_verify()
175 bch2_bkey_val_to_text(&buf, c, bkey_i_to_s_c(&b->key)); in __bch2_btree_verify()
179 out: in __bch2_btree_verify()
180 mutex_unlock(&c->verify_lock); in __bch2_btree_verify()
184 void bch2_btree_node_ondisk_to_text(struct printbuf *out, struct bch_fs *c, in bch2_btree_node_ondisk_to_text() argument
194 if (bch2_bkey_pick_read_device(c, bkey_i_to_s_c(&b->key), NULL, &pick, -1) <= 0) { in bch2_btree_node_ondisk_to_text()
195 prt_printf(out, "error getting device to read from: invalid device\n"); in bch2_btree_node_ondisk_to_text()
199 ca = bch2_dev_get_ioref(c, pick.ptr.dev, READ); in bch2_btree_node_ondisk_to_text()
201 prt_printf(out, "error getting device to read from: not online\n"); in bch2_btree_node_ondisk_to_text()
207 prt_printf(out, "memory allocation failure\n"); in bch2_btree_node_ondisk_to_text()
208 goto out; in bch2_btree_node_ondisk_to_text()
211 bio = bio_alloc_bioset(ca->disk_sb.bdev, in bch2_btree_node_ondisk_to_text()
215 &c->btree_bio); in bch2_btree_node_ondisk_to_text()
216 bio->bi_iter.bi_sector = pick.ptr.offset; in bch2_btree_node_ondisk_to_text()
221 prt_printf(out, "IO error reading btree node: %s\n", bch2_err_str(ret)); in bch2_btree_node_ondisk_to_text()
222 goto out; in bch2_btree_node_ondisk_to_text()
233 i = &n_ondisk->keys; in bch2_btree_node_ondisk_to_text()
236 prt_printf(out, "unknown checksum type at offset %u: %llu\n", in bch2_btree_node_ondisk_to_text()
238 goto out; in bch2_btree_node_ondisk_to_text()
244 if (bch2_crc_cmp(csum, n_ondisk->csum)) { in bch2_btree_node_ondisk_to_text()
245 prt_printf(out, "invalid checksum\n"); in bch2_btree_node_ondisk_to_text()
246 goto out; in bch2_btree_node_ondisk_to_text()
251 sectors = vstruct_sectors(n_ondisk, c->block_bits); in bch2_btree_node_ondisk_to_text()
255 i = &bne->keys; in bch2_btree_node_ondisk_to_text()
257 if (i->seq != n_ondisk->keys.seq) in bch2_btree_node_ondisk_to_text()
261 prt_printf(out, "unknown checksum type at offset %u: %llu\n", in bch2_btree_node_ondisk_to_text()
263 goto out; in bch2_btree_node_ondisk_to_text()
269 if (bch2_crc_cmp(csum, bne->csum)) { in bch2_btree_node_ondisk_to_text()
270 prt_printf(out, "invalid checksum"); in bch2_btree_node_ondisk_to_text()
271 goto out; in bch2_btree_node_ondisk_to_text()
276 sectors = vstruct_sectors(bne, c->block_bits); in bch2_btree_node_ondisk_to_text()
279 prt_printf(out, " offset %u version %u, journal seq %llu\n", in bch2_btree_node_ondisk_to_text()
281 le16_to_cpu(i->version), in bch2_btree_node_ondisk_to_text()
282 le64_to_cpu(i->journal_seq)); in bch2_btree_node_ondisk_to_text()
285 printbuf_indent_add(out, 4); in bch2_btree_node_ondisk_to_text()
287 for (k = i->start; k != vstruct_last(i); k = bkey_p_next(k)) { in bch2_btree_node_ondisk_to_text()
290 bch2_bkey_val_to_text(out, c, bkey_disassemble(b, k, &u)); in bch2_btree_node_ondisk_to_text()
291 prt_newline(out); in bch2_btree_node_ondisk_to_text()
294 printbuf_indent_sub(out, 4); in bch2_btree_node_ondisk_to_text()
296 out: in bch2_btree_node_ondisk_to_text()
300 percpu_ref_put(&ca->io_ref[READ]); in bch2_btree_node_ondisk_to_text()
317 size_t size; /* size of requested read */
318 ssize_t ret; /* bytes read so far */
323 if (i->buf.pos) { in flush_buf()
324 size_t bytes = min_t(size_t, i->buf.pos, i->size); in flush_buf()
325 int copied = bytes - copy_to_user(i->ubuf, i->buf.buf, bytes); in flush_buf()
327 i->ret += copied; in flush_buf()
328 i->ubuf += copied; in flush_buf()
329 i->size -= copied; in flush_buf()
330 i->buf.pos -= copied; in flush_buf()
331 memmove(i->buf.buf, i->buf.buf + copied, i->buf.pos); in flush_buf()
334 return -EFAULT; in flush_buf()
337 return i->size ? 0 : i->ret; in flush_buf()
342 struct btree_debug *bd = inode->i_private; in bch2_dump_open()
347 return -ENOMEM; in bch2_dump_open()
349 file->private_data = i; in bch2_dump_open()
350 i->from = POS_MIN; in bch2_dump_open()
351 i->iter = 0; in bch2_dump_open()
352 i->c = container_of(bd, struct bch_fs, btree_debug[bd->id]); in bch2_dump_open()
353 i->id = bd->id; in bch2_dump_open()
354 i->buf = PRINTBUF; in bch2_dump_open()
361 struct dump_iter *i = file->private_data; in bch2_dump_release()
363 printbuf_exit(&i->buf); in bch2_dump_release()
371 struct dump_iter *i = file->private_data; in bch2_read_btree()
373 i->ubuf = buf; in bch2_read_btree()
374 i->size = size; in bch2_read_btree()
375 i->ret = 0; in bch2_read_btree()
378 bch2_trans_run(i->c, in bch2_read_btree()
379 for_each_btree_key(trans, iter, i->id, i->from, in bch2_read_btree()
382 bch2_bkey_val_to_text(&i->buf, i->c, k); in bch2_read_btree()
383 prt_newline(&i->buf); in bch2_read_btree()
385 i->from = bpos_successor(iter.pos); in bch2_read_btree()
388 i->ret; in bch2_read_btree()
395 .read = bch2_read_btree,
401 struct dump_iter *i = file->private_data; in bch2_read_btree_formats()
403 i->ubuf = buf; in bch2_read_btree_formats()
404 i->size = size; in bch2_read_btree_formats()
405 i->ret = 0; in bch2_read_btree_formats()
411 if (bpos_eq(SPOS_MAX, i->from)) in bch2_read_btree_formats()
412 return i->ret; in bch2_read_btree_formats()
414 return bch2_trans_run(i->c, in bch2_read_btree_formats()
415 for_each_btree_node(trans, iter, i->id, i->from, 0, b, ({ in bch2_read_btree_formats()
416 bch2_btree_node_to_text(&i->buf, i->c, b); in bch2_read_btree_formats()
417 i->from = !bpos_eq(SPOS_MAX, b->key.k.p) in bch2_read_btree_formats()
418 ? bpos_successor(b->key.k.p) in bch2_read_btree_formats()
419 : b->key.k.p; in bch2_read_btree_formats()
422 }))) ?: i->ret; in bch2_read_btree_formats()
429 .read = bch2_read_btree_formats,
435 struct dump_iter *i = file->private_data; in bch2_read_bfloat_failed()
437 i->ubuf = buf; in bch2_read_bfloat_failed()
438 i->size = size; in bch2_read_bfloat_failed()
439 i->ret = 0; in bch2_read_bfloat_failed()
442 bch2_trans_run(i->c, in bch2_read_bfloat_failed()
443 for_each_btree_key(trans, iter, i->id, i->from, in bch2_read_bfloat_failed()
447 &btree_iter_path(trans, &iter)->l[0]; in bch2_read_bfloat_failed()
449 bch2_btree_node_iter_peek(&l->iter, l->b); in bch2_read_bfloat_failed()
451 if (bpos_gt(l->b->key.k.p, i->prev_node)) { in bch2_read_bfloat_failed()
452 bch2_btree_node_to_text(&i->buf, i->c, l->b); in bch2_read_bfloat_failed()
453 i->prev_node = l->b->key.k.p; in bch2_read_bfloat_failed()
456 bch2_bfloat_to_text(&i->buf, l->b, _k); in bch2_read_bfloat_failed()
458 i->from = bpos_successor(iter.pos); in bch2_read_bfloat_failed()
461 i->ret; in bch2_read_bfloat_failed()
468 .read = bch2_read_bfloat_failed,
471 static void bch2_cached_btree_node_to_text(struct printbuf *out, struct bch_fs *c, in bch2_cached_btree_node_to_text() argument
474 if (!out->nr_tabstops) in bch2_cached_btree_node_to_text()
475 printbuf_tabstop_push(out, 32); in bch2_cached_btree_node_to_text()
477 prt_printf(out, "%px ", b); in bch2_cached_btree_node_to_text()
478 bch2_btree_id_level_to_text(out, b->c.btree_id, b->c.level); in bch2_cached_btree_node_to_text()
479 prt_printf(out, "\n"); in bch2_cached_btree_node_to_text()
481 printbuf_indent_add(out, 2); in bch2_cached_btree_node_to_text()
483 bch2_bkey_val_to_text(out, c, bkey_i_to_s_c(&b->key)); in bch2_cached_btree_node_to_text()
484 prt_newline(out); in bch2_cached_btree_node_to_text()
486 prt_printf(out, "flags:\t"); in bch2_cached_btree_node_to_text()
487 prt_bitflags(out, bch2_btree_node_flags, b->flags); in bch2_cached_btree_node_to_text()
488 prt_newline(out); in bch2_cached_btree_node_to_text()
490 prt_printf(out, "pcpu read locks:\t%u\n", b->c.lock.readers != NULL); in bch2_cached_btree_node_to_text()
491 prt_printf(out, "written:\t%u\n", b->written); in bch2_cached_btree_node_to_text()
492 prt_printf(out, "writes blocked:\t%u\n", !list_empty_careful(&b->write_blocked)); in bch2_cached_btree_node_to_text()
493 prt_printf(out, "will make reachable:\t%lx\n", b->will_make_reachable); in bch2_cached_btree_node_to_text()
495 prt_printf(out, "journal pin %px:\t%llu\n", in bch2_cached_btree_node_to_text()
496 &b->writes[0].journal, b->writes[0].journal.seq); in bch2_cached_btree_node_to_text()
497 prt_printf(out, "journal pin %px:\t%llu\n", in bch2_cached_btree_node_to_text()
498 &b->writes[1].journal, b->writes[1].journal.seq); in bch2_cached_btree_node_to_text()
500 printbuf_indent_sub(out, 2); in bch2_cached_btree_node_to_text()
506 struct dump_iter *i = file->private_data; in bch2_cached_btree_nodes_read()
507 struct bch_fs *c = i->c; in bch2_cached_btree_nodes_read()
511 i->ubuf = buf; in bch2_cached_btree_nodes_read()
512 i->size = size; in bch2_cached_btree_nodes_read()
513 i->ret = 0; in bch2_cached_btree_nodes_read()
525 i->buf.atomic++; in bch2_cached_btree_nodes_read()
526 tbl = rht_dereference_rcu(c->btree_cache.table.tbl, in bch2_cached_btree_nodes_read()
527 &c->btree_cache.table); in bch2_cached_btree_nodes_read()
528 if (i->iter < tbl->size) { in bch2_cached_btree_nodes_read()
529 rht_for_each_entry_rcu(b, pos, tbl, i->iter, hash) in bch2_cached_btree_nodes_read()
530 bch2_cached_btree_node_to_text(&i->buf, c, b); in bch2_cached_btree_nodes_read()
531 i->iter++; in bch2_cached_btree_nodes_read()
535 --i->buf.atomic; in bch2_cached_btree_nodes_read()
539 if (i->buf.allocation_failure) in bch2_cached_btree_nodes_read()
540 ret = -ENOMEM; in bch2_cached_btree_nodes_read()
545 return ret ?: i->ret; in bch2_cached_btree_nodes_read()
552 .read = bch2_cached_btree_nodes_read,
563 cmp(pos, pos->next) > 0) { in list_sort()
564 struct list_head *pos2, *next = pos->next; in list_sort()
584 struct dump_iter *i = file->private_data; in bch2_btree_transactions_read()
585 struct bch_fs *c = i->c; in bch2_btree_transactions_read()
589 i->ubuf = buf; in bch2_btree_transactions_read()
590 i->size = size; in bch2_btree_transactions_read()
591 i->ret = 0; in bch2_btree_transactions_read()
593 seqmutex_lock(&c->btree_trans_lock); in bch2_btree_transactions_read()
594 list_sort(&c->btree_trans_list, list_ptr_order_cmp); in bch2_btree_transactions_read()
596 list_for_each_entry(trans, &c->btree_trans_list, list) { in bch2_btree_transactions_read()
597 if ((ulong) trans <= i->iter) in bch2_btree_transactions_read()
600 i->iter = (ulong) trans; in bch2_btree_transactions_read()
602 if (!closure_get_not_zero(&trans->ref)) in bch2_btree_transactions_read()
605 u32 seq = seqmutex_unlock(&c->btree_trans_lock); in bch2_btree_transactions_read()
607 bch2_btree_trans_to_text(&i->buf, trans); in bch2_btree_transactions_read()
609 prt_printf(&i->buf, "backtrace:\n"); in bch2_btree_transactions_read()
610 printbuf_indent_add(&i->buf, 2); in bch2_btree_transactions_read()
611 bch2_prt_task_backtrace(&i->buf, trans->locking_wait.task, 0, GFP_KERNEL); in bch2_btree_transactions_read()
612 printbuf_indent_sub(&i->buf, 2); in bch2_btree_transactions_read()
613 prt_newline(&i->buf); in bch2_btree_transactions_read()
615 closure_put(&trans->ref); in bch2_btree_transactions_read()
621 if (!seqmutex_relock(&c->btree_trans_lock, seq)) in bch2_btree_transactions_read()
624 seqmutex_unlock(&c->btree_trans_lock); in bch2_btree_transactions_read()
626 if (i->buf.allocation_failure) in bch2_btree_transactions_read()
627 ret = -ENOMEM; in bch2_btree_transactions_read()
632 return ret ?: i->ret; in bch2_btree_transactions_read()
639 .read = bch2_btree_transactions_read,
645 struct dump_iter *i = file->private_data; in bch2_journal_pins_read()
646 struct bch_fs *c = i->c; in bch2_journal_pins_read()
650 i->ubuf = buf; in bch2_journal_pins_read()
651 i->size = size; in bch2_journal_pins_read()
652 i->ret = 0; in bch2_journal_pins_read()
659 if (!i->size) in bch2_journal_pins_read()
665 done = bch2_journal_seq_pins_to_text(&i->buf, &c->journal, &i->iter); in bch2_journal_pins_read()
666 i->iter++; in bch2_journal_pins_read()
669 if (i->buf.allocation_failure) in bch2_journal_pins_read()
670 return -ENOMEM; in bch2_journal_pins_read()
672 return i->ret; in bch2_journal_pins_read()
679 .read = bch2_journal_pins_read,
685 struct dump_iter *i = file->private_data; in bch2_btree_updates_read()
686 struct bch_fs *c = i->c; in bch2_btree_updates_read()
689 i->ubuf = buf; in bch2_btree_updates_read()
690 i->size = size; in bch2_btree_updates_read()
691 i->ret = 0; in bch2_btree_updates_read()
693 if (!i->iter) { in bch2_btree_updates_read()
694 bch2_btree_updates_to_text(&i->buf, c); in bch2_btree_updates_read()
695 i->iter++; in bch2_btree_updates_read()
702 if (i->buf.allocation_failure) in bch2_btree_updates_read()
703 return -ENOMEM; in bch2_btree_updates_read()
705 return i->ret; in bch2_btree_updates_read()
712 .read = bch2_btree_updates_read,
717 struct bch_fs *c = inode->i_private; in btree_transaction_stats_open()
722 return -ENOMEM; in btree_transaction_stats_open()
724 i->iter = 1; in btree_transaction_stats_open()
725 i->c = c; in btree_transaction_stats_open()
726 i->buf = PRINTBUF; in btree_transaction_stats_open()
727 file->private_data = i; in btree_transaction_stats_open()
734 struct dump_iter *i = file->private_data; in btree_transaction_stats_release()
736 printbuf_exit(&i->buf); in btree_transaction_stats_release()
745 struct dump_iter *i = file->private_data; in btree_transaction_stats_read()
746 struct bch_fs *c = i->c; in btree_transaction_stats_read()
749 i->ubuf = buf; in btree_transaction_stats_read()
750 i->size = size; in btree_transaction_stats_read()
751 i->ret = 0; in btree_transaction_stats_read()
754 struct btree_transaction_stats *s = &c->btree_transaction_stats[i->iter]; in btree_transaction_stats_read()
760 if (!i->size) in btree_transaction_stats_read()
763 if (i->iter == ARRAY_SIZE(bch2_btree_transaction_fns) || in btree_transaction_stats_read()
764 !bch2_btree_transaction_fns[i->iter]) in btree_transaction_stats_read()
767 prt_printf(&i->buf, "%s:\n", bch2_btree_transaction_fns[i->iter]); in btree_transaction_stats_read()
768 printbuf_indent_add(&i->buf, 2); in btree_transaction_stats_read()
770 mutex_lock(&s->lock); in btree_transaction_stats_read()
772 prt_printf(&i->buf, "Max mem used: %u\n", s->max_mem); in btree_transaction_stats_read()
773 prt_printf(&i->buf, "Transaction duration:\n"); in btree_transaction_stats_read()
775 printbuf_indent_add(&i->buf, 2); in btree_transaction_stats_read()
776 bch2_time_stats_to_text(&i->buf, &s->duration); in btree_transaction_stats_read()
777 printbuf_indent_sub(&i->buf, 2); in btree_transaction_stats_read()
780 prt_printf(&i->buf, "Lock hold times:\n"); in btree_transaction_stats_read()
782 printbuf_indent_add(&i->buf, 2); in btree_transaction_stats_read()
783 bch2_time_stats_to_text(&i->buf, &s->lock_hold_times); in btree_transaction_stats_read()
784 printbuf_indent_sub(&i->buf, 2); in btree_transaction_stats_read()
787 if (s->max_paths_text) { in btree_transaction_stats_read()
788 prt_printf(&i->buf, "Maximum allocated btree paths (%u):\n", s->nr_max_paths); in btree_transaction_stats_read()
790 printbuf_indent_add(&i->buf, 2); in btree_transaction_stats_read()
791 prt_str_indented(&i->buf, s->max_paths_text); in btree_transaction_stats_read()
792 printbuf_indent_sub(&i->buf, 2); in btree_transaction_stats_read()
795 mutex_unlock(&s->lock); in btree_transaction_stats_read()
797 printbuf_indent_sub(&i->buf, 2); in btree_transaction_stats_read()
798 prt_newline(&i->buf); in btree_transaction_stats_read()
799 i->iter++; in btree_transaction_stats_read()
802 if (i->buf.allocation_failure) in btree_transaction_stats_read()
803 return -ENOMEM; in btree_transaction_stats_read()
805 return i->ret; in btree_transaction_stats_read()
812 .read = btree_transaction_stats_read,
816 static void btree_deadlock_to_text(struct printbuf *out, struct bch_fs *c) in btree_deadlock_to_text() argument
821 seqmutex_lock(&c->btree_trans_lock); in btree_deadlock_to_text()
822 list_sort(&c->btree_trans_list, list_ptr_order_cmp); in btree_deadlock_to_text()
824 list_for_each_entry(trans, &c->btree_trans_list, list) { in btree_deadlock_to_text()
830 if (!closure_get_not_zero(&trans->ref)) in btree_deadlock_to_text()
833 u32 seq = seqmutex_unlock(&c->btree_trans_lock); in btree_deadlock_to_text()
835 bool found = bch2_check_for_deadlock(trans, out) != 0; in btree_deadlock_to_text()
837 closure_put(&trans->ref); in btree_deadlock_to_text()
842 if (!seqmutex_relock(&c->btree_trans_lock, seq)) in btree_deadlock_to_text()
845 seqmutex_unlock(&c->btree_trans_lock); in btree_deadlock_to_text()
854 struct dump_iter *i = file->private_data; in bch2_simple_print()
855 struct bch_fs *c = i->c; in bch2_simple_print()
858 i->ubuf = buf; in bch2_simple_print()
859 i->size = size; in bch2_simple_print()
860 i->ret = 0; in bch2_simple_print()
862 if (!i->iter) { in bch2_simple_print()
863 fn(&i->buf, c); in bch2_simple_print()
864 i->iter++; in bch2_simple_print()
867 if (i->buf.allocation_failure) in bch2_simple_print()
868 ret = -ENOMEM; in bch2_simple_print()
873 return ret ?: i->ret; in bch2_simple_print()
886 .read = bch2_btree_deadlock_read,
899 .read = bch2_write_points_read,
904 if (!IS_ERR_OR_NULL(c->fs_debug_dir)) in bch2_fs_debug_exit()
905 debugfs_remove_recursive(c->fs_debug_dir); in bch2_fs_debug_exit()
912 d = debugfs_create_dir(bch2_btree_id_str(bd->id), c->btree_debug_dir); in bch2_fs_debug_btree_init()
918 debugfs_create_file("bfloat-failed", 0400, d, bd, in bch2_fs_debug_btree_init()
930 snprintf(name, sizeof(name), "%pU", c->sb.user_uuid.b); in bch2_fs_debug_init()
931 c->fs_debug_dir = debugfs_create_dir(name, bch_debug); in bch2_fs_debug_init()
932 if (IS_ERR_OR_NULL(c->fs_debug_dir)) in bch2_fs_debug_init()
935 debugfs_create_file("cached_btree_nodes", 0400, c->fs_debug_dir, in bch2_fs_debug_init()
936 c->btree_debug, &cached_btree_nodes_ops); in bch2_fs_debug_init()
938 debugfs_create_file("btree_transactions", 0400, c->fs_debug_dir, in bch2_fs_debug_init()
939 c->btree_debug, &btree_transactions_ops); in bch2_fs_debug_init()
941 debugfs_create_file("journal_pins", 0400, c->fs_debug_dir, in bch2_fs_debug_init()
942 c->btree_debug, &journal_pins_ops); in bch2_fs_debug_init()
944 debugfs_create_file("btree_updates", 0400, c->fs_debug_dir, in bch2_fs_debug_init()
945 c->btree_debug, &btree_updates_ops); in bch2_fs_debug_init()
947 debugfs_create_file("btree_transaction_stats", 0400, c->fs_debug_dir, in bch2_fs_debug_init()
950 debugfs_create_file("btree_deadlock", 0400, c->fs_debug_dir, in bch2_fs_debug_init()
951 c->btree_debug, &btree_deadlock_ops); in bch2_fs_debug_init()
953 debugfs_create_file("write_points", 0400, c->fs_debug_dir, in bch2_fs_debug_init()
954 c->btree_debug, &write_points_ops); in bch2_fs_debug_init()
956 c->btree_debug_dir = debugfs_create_dir("btrees", c->fs_debug_dir); in bch2_fs_debug_init()
957 if (IS_ERR_OR_NULL(c->btree_debug_dir)) in bch2_fs_debug_init()
960 for (bd = c->btree_debug; in bch2_fs_debug_init()
961 bd < c->btree_debug + ARRAY_SIZE(c->btree_debug); in bch2_fs_debug_init()
963 bd->id = bd - c->btree_debug; in bch2_fs_debug_init()