diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-04-05 00:20:02 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:20 -0400 |
commit | 478259b749d442baaccbe18b02a7352ca1e012ae (patch) | |
tree | 1823d2613d9d317d9e915fd7f665281d29d6ed93 /fs/bcachefs/journal.h | |
parent | 330581f16f3041e7cd4e4d8c3b7a569d663a8035 (diff) |
bcachefs: delete duplicated code
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal.h')
-rw-r--r-- | fs/bcachefs/journal.h | 13 |
1 files changed, 13 insertions, 0 deletions
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, |