Commit 0576ba9a authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Drop !did_work path from do_btree_insert_one()

As we've already reserved space in the journal this optimization doesn't
actually buy us anything, and when doing list_journal debugging it
deletes information we want.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 85d8cf16
...@@ -214,7 +214,7 @@ inline void bch2_btree_add_journal_pin(struct bch_fs *c, ...@@ -214,7 +214,7 @@ inline void bch2_btree_add_journal_pin(struct bch_fs *c,
/** /**
* btree_insert_key - insert a key one key into a leaf node * btree_insert_key - insert a key one key into a leaf node
*/ */
static bool btree_insert_key_leaf(struct btree_trans *trans, static void btree_insert_key_leaf(struct btree_trans *trans,
struct btree_insert_entry *insert) struct btree_insert_entry *insert)
{ {
struct bch_fs *c = trans->c; struct bch_fs *c = trans->c;
...@@ -227,7 +227,7 @@ static bool btree_insert_key_leaf(struct btree_trans *trans, ...@@ -227,7 +227,7 @@ static bool btree_insert_key_leaf(struct btree_trans *trans,
if (unlikely(!bch2_btree_bset_insert_key(trans, insert->path, b, if (unlikely(!bch2_btree_bset_insert_key(trans, insert->path, b,
&insert_l(insert)->iter, insert->k))) &insert_l(insert)->iter, insert->k)))
return false; return;
i->journal_seq = cpu_to_le64(max(trans->journal_res.seq, i->journal_seq = cpu_to_le64(max(trans->journal_res.seq,
le64_to_cpu(i->journal_seq))); le64_to_cpu(i->journal_seq)));
...@@ -248,8 +248,6 @@ static bool btree_insert_key_leaf(struct btree_trans *trans, ...@@ -248,8 +248,6 @@ static bool btree_insert_key_leaf(struct btree_trans *trans,
if (u64s_added > live_u64s_added && if (u64s_added > live_u64s_added &&
bch2_maybe_compact_whiteouts(c, b)) bch2_maybe_compact_whiteouts(c, b))
bch2_trans_node_reinit_iter(trans, b); bch2_trans_node_reinit_iter(trans, b);
return true;
} }
/* Cached btree updates: */ /* Cached btree updates: */
...@@ -401,7 +399,6 @@ static inline void do_btree_insert_one(struct btree_trans *trans, ...@@ -401,7 +399,6 @@ static inline void do_btree_insert_one(struct btree_trans *trans,
{ {
struct bch_fs *c = trans->c; struct bch_fs *c = trans->c;
struct journal *j = &c->journal; struct journal *j = &c->journal;
bool did_work;
EBUG_ON(trans->journal_res.ref != EBUG_ON(trans->journal_res.ref !=
!(trans->flags & BTREE_INSERT_JOURNAL_REPLAY)); !(trans->flags & BTREE_INSERT_JOURNAL_REPLAY));
...@@ -409,15 +406,13 @@ static inline void do_btree_insert_one(struct btree_trans *trans, ...@@ -409,15 +406,13 @@ static inline void do_btree_insert_one(struct btree_trans *trans,
i->k->k.needs_whiteout = false; i->k->k.needs_whiteout = false;
if (!i->cached) if (!i->cached)
did_work = btree_insert_key_leaf(trans, i); btree_insert_key_leaf(trans, i);
else if (!i->key_cache_already_flushed) else if (!i->key_cache_already_flushed)
did_work = bch2_btree_insert_key_cached(trans, i->path, i->k); bch2_btree_insert_key_cached(trans, i->path, i->k);
else { else {
bch2_btree_key_cache_drop(trans, i->path); bch2_btree_key_cache_drop(trans, i->path);
did_work = false;
}
if (!did_work)
return; return;
}
if (likely(!(trans->flags & BTREE_INSERT_JOURNAL_REPLAY)) && if (likely(!(trans->flags & BTREE_INSERT_JOURNAL_REPLAY)) &&
!(i->flags & BTREE_UPDATE_NOJOURNAL)) { !(i->flags & BTREE_UPDATE_NOJOURNAL)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment