diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-06-03 16:21:35 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2020-06-03 19:56:33 -0400 |
commit | 1952c0790c74e4e81d7066a19aabc5c55a13f10f (patch) | |
tree | 501fa5db6a5f1fd3b2412a2660e995c74ebf0bba /libbcachefs/btree_update_leaf.c | |
parent | 90d54b388666b258c97be6a4e632824d136356c4 (diff) |
Update bcachefs sources to c9b4a210f9 fixup! bcachefs: Fixes for going RO
Diffstat (limited to 'libbcachefs/btree_update_leaf.c')
-rw-r--r-- | libbcachefs/btree_update_leaf.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/libbcachefs/btree_update_leaf.c b/libbcachefs/btree_update_leaf.c index 7faf98fd..e343d80f 100644 --- a/libbcachefs/btree_update_leaf.c +++ b/libbcachefs/btree_update_leaf.c @@ -413,6 +413,15 @@ bch2_trans_commit_write_locked(struct btree_trans *trans, goto err; } + if (unlikely(trans->extra_journal_entry_u64s)) { + memcpy_u64s_small(journal_res_entry(&c->journal, &trans->journal_res), + trans->extra_journal_entries, + trans->extra_journal_entry_u64s); + + trans->journal_res.offset += trans->extra_journal_entry_u64s; + trans->journal_res.u64s -= trans->extra_journal_entry_u64s; + } + /* * Not allowed to fail after we've gotten our journal reservation - we * have to use it: @@ -511,6 +520,10 @@ static inline int do_bch2_trans_commit(struct btree_trans *trans, bch2_btree_node_unlock_write_inlined(iter_l(i->iter)->b, i->iter); + if (!ret && trans->journal_pin) + bch2_journal_pin_add(&trans->c->journal, trans->journal_res.seq, + trans->journal_pin, NULL); + /* * Drop journal reservation after dropping write locks, since dropping * the journal reservation may kick off a journal write: @@ -800,7 +813,7 @@ int __bch2_trans_commit(struct btree_trans *trans) memset(&trans->journal_preres, 0, sizeof(trans->journal_preres)); - trans->journal_u64s = 0; + trans->journal_u64s = trans->extra_journal_entry_u64s; trans->journal_preres_u64s = 0; if (!(trans->flags & BTREE_INSERT_NOCHECK_RW) && |