]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/debug.c
Disable pristine-tar option in gbp.conf, since there is no pristine-tar branch.
[bcachefs-tools-debian] / libbcachefs / debug.c
index de5bfc0d46844166b3543b4bf3ee1a7a841bbc3a..b1f147e6be4d5cdd0ab491932db9c625b763e29e 100644 (file)
@@ -44,19 +44,19 @@ static bool bch2_btree_verify_replica(struct bch_fs *c, struct btree *b,
                return false;
 
        bio = bio_alloc_bioset(ca->disk_sb.bdev,
-                              buf_pages(n_sorted, btree_bytes(c)),
+                              buf_pages(n_sorted, btree_buf_bytes(b)),
                               REQ_OP_READ|REQ_META,
                               GFP_NOFS,
                               &c->btree_bio);
        bio->bi_iter.bi_sector  = pick.ptr.offset;
-       bch2_bio_map(bio, n_sorted, btree_bytes(c));
+       bch2_bio_map(bio, n_sorted, btree_buf_bytes(b));
 
        submit_bio_wait(bio);
 
        bio_put(bio);
        percpu_ref_put(&ca->io_ref);
 
-       memcpy(n_ondisk, n_sorted, btree_bytes(c));
+       memcpy(n_ondisk, n_sorted, btree_buf_bytes(b));
 
        v->written = 0;
        if (bch2_btree_node_read_done(c, ca, v, false, &saw_error) || saw_error)
@@ -137,7 +137,7 @@ void __bch2_btree_verify(struct bch_fs *c, struct btree *b)
        mutex_lock(&c->verify_lock);
 
        if (!c->verify_ondisk) {
-               c->verify_ondisk = kvpmalloc(btree_bytes(c), GFP_KERNEL);
+               c->verify_ondisk = kvmalloc(btree_buf_bytes(b), GFP_KERNEL);
                if (!c->verify_ondisk)
                        goto out;
        }
@@ -199,19 +199,19 @@ void bch2_btree_node_ondisk_to_text(struct printbuf *out, struct bch_fs *c,
                return;
        }
 
-       n_ondisk = kvpmalloc(btree_bytes(c), GFP_KERNEL);
+       n_ondisk = kvmalloc(btree_buf_bytes(b), GFP_KERNEL);
        if (!n_ondisk) {
                prt_printf(out, "memory allocation failure\n");
                goto out;
        }
 
        bio = bio_alloc_bioset(ca->disk_sb.bdev,
-                              buf_pages(n_ondisk, btree_bytes(c)),
+                              buf_pages(n_ondisk, btree_buf_bytes(b)),
                               REQ_OP_READ|REQ_META,
                               GFP_NOFS,
                               &c->btree_bio);
        bio->bi_iter.bi_sector  = pick.ptr.offset;
-       bch2_bio_map(bio, n_ondisk, btree_bytes(c));
+       bch2_bio_map(bio, n_ondisk, btree_buf_bytes(b));
 
        ret = submit_bio_wait(bio);
        if (ret) {
@@ -293,7 +293,7 @@ void bch2_btree_node_ondisk_to_text(struct printbuf *out, struct bch_fs *c,
 out:
        if (bio)
                bio_put(bio);
-       kvpfree(n_ondisk, btree_bytes(c));
+       kvfree(n_ondisk);
        percpu_ref_put(&ca->io_ref);
 }
 
@@ -627,7 +627,7 @@ restart:
                prt_printf(&i->buf, "backtrace:");
                prt_newline(&i->buf);
                printbuf_indent_add(&i->buf, 2);
-               bch2_prt_task_backtrace(&i->buf, task);
+               bch2_prt_task_backtrace(&i->buf, task, 0, GFP_KERNEL);
                printbuf_indent_sub(&i->buf, 2);
                prt_newline(&i->buf);
 
@@ -930,8 +930,6 @@ void bch2_debug_exit(void)
 
 int __init bch2_debug_init(void)
 {
-       int ret = 0;
-
        bch_debug = debugfs_create_dir("bcachefs", NULL);
-       return ret;
+       return 0;
 }