From 478259b749d442baaccbe18b02a7352ca1e012ae Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Fri, 5 Apr 2019 00:20:02 -0400 Subject: bcachefs: delete duplicated code Signed-off-by: Kent Overstreet --- fs/bcachefs/journal.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'fs/bcachefs/journal.h') diff --git a/fs/bcachefs/journal.h b/fs/bcachefs/journal.h index 3447b4ad462d..36066ea7de7a 100644 --- a/fs/bcachefs/journal.h +++ b/fs/bcachefs/journal.h @@ -231,6 +231,19 @@ static inline void bch2_journal_add_keys(struct journal *j, struct journal_res * id, 0, k, k->k.u64s); } +static inline bool journal_entry_empty(struct jset *j) +{ + struct jset_entry *i; + + if (j->seq != j->last_seq) + return false; + + vstruct_for_each(j, i) + if (i->type == BCH_JSET_ENTRY_btree_keys && i->u64s) + return false; + return true; +} + void __bch2_journal_buf_put(struct journal *, bool); static inline void bch2_journal_buf_put(struct journal *j, unsigned idx, -- cgit