We're going to have btree updates that don't need to be journalled; add
a flag for that.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
enum btree_update_flags {
__BTREE_UPDATE_INTERNAL_SNAPSHOT_NODE,
+ __BTREE_UPDATE_NOJOURNAL,
__BTREE_TRIGGER_NORUN, /* Don't run triggers at all */
};
#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)
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,
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) {