Commit 34d74830 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: BTREE_UPDATE_NOJOURNAL

We're going to have btree updates that don't need to be journalled; add
a flag for that.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent c27314b4
......@@ -630,6 +630,7 @@ static inline bool btree_type_has_snapshots(enum btree_id id)
enum btree_update_flags {
__BTREE_UPDATE_INTERNAL_SNAPSHOT_NODE,
__BTREE_UPDATE_NOJOURNAL,
__BTREE_TRIGGER_NORUN, /* Don't run triggers at all */
......@@ -642,6 +643,7 @@ enum btree_update_flags {
};
#define BTREE_UPDATE_INTERNAL_SNAPSHOT_NODE (1U << __BTREE_UPDATE_INTERNAL_SNAPSHOT_NODE)
#define BTREE_UPDATE_NOJOURNAL (1U << __BTREE_UPDATE_NOJOURNAL)
#define BTREE_TRIGGER_NORUN (1U << __BTREE_TRIGGER_NORUN)
......
......@@ -356,7 +356,8 @@ static inline void do_btree_insert_one(struct btree_trans *trans,
if (!did_work)
return;
if (likely(!(trans->flags & BTREE_INSERT_JOURNAL_REPLAY))) {
if (likely(!(trans->flags & BTREE_INSERT_JOURNAL_REPLAY)) &&
!(i->flags & BTREE_UPDATE_NOJOURNAL)) {
bch2_journal_add_keys(j, &trans->journal_res,
i->btree_id,
i->level,
......@@ -897,7 +898,9 @@ int __bch2_trans_commit(struct btree_trans *trans)
if (i->cached &&
likely(!(trans->flags & BTREE_INSERT_JOURNAL_REPLAY)))
trans->journal_preres_u64s += u64s;
trans->journal_u64s += u64s;
if (!(i->flags & BTREE_UPDATE_NOJOURNAL))
trans->journal_u64s += u64s;
}
if (trans->extra_journal_res) {
......
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