]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/btree_iter.c
Update bcachefs sources to 3e0c5b0722 fixup! bcachefs: Btree write buffer
[bcachefs-tools-debian] / libbcachefs / btree_iter.c
index 077d72bfa6826088da1be6ee27a95a7177a388df..dc2b2a0819bd886330b6a910dcc74448c6c2b870 100644 (file)
@@ -1374,6 +1374,7 @@ noinline __cold
 void bch2_trans_updates_to_text(struct printbuf *buf, struct btree_trans *trans)
 {
        struct btree_insert_entry *i;
+       struct btree_write_buffered_key *wb;
 
        prt_printf(buf, "transaction updates for %s journal seq %llu",
               trans->fn, trans->journal_res.seq);
@@ -1398,6 +1399,17 @@ void bch2_trans_updates_to_text(struct printbuf *buf, struct btree_trans *trans)
                prt_newline(buf);
        }
 
+       trans_for_each_wb_update(trans, wb) {
+               prt_printf(buf, "update: btree=%s wb=1 %pS",
+                      bch2_btree_ids[wb->btree],
+                      (void *) i->ip_allocated);
+               prt_newline(buf);
+
+               prt_printf(buf, "  new ");
+               bch2_bkey_val_to_text(buf, trans->c, bkey_i_to_s_c(&wb->k));
+               prt_newline(buf);
+       }
+
        printbuf_indent_sub(buf, 2);
 }
 
@@ -2931,8 +2943,11 @@ void __bch2_trans_init(struct btree_trans *trans, struct bch_fs *c, unsigned fn_
                        trans->mem_bytes = expected_mem_bytes;
                }
        }
-       if (s)
+
+       if (s) {
                trans->nr_max_paths = s->nr_max_paths;
+               trans->wb_updates_size = s->wb_updates_size;
+       }
 
        trans->srcu_idx = srcu_read_lock(&c->btree_trans_barrier);
        trans->srcu_lock_time   = jiffies;