diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-05-25 19:29:48 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:40 -0400 |
commit | 96e2aa1be5eebd81ed572baf69f8cb82d56e39bd (patch) | |
tree | 546d8c9a8b1f179e68e1af5ba7143aa119c01da1 /fs/bcachefs/journal.h | |
parent | b29303966b9e07dda5f21c667909eb87849453f2 (diff) | |
download | lwn-96e2aa1be5eebd81ed572baf69f8cb82d56e39bd.tar.gz lwn-96e2aa1be5eebd81ed572baf69f8cb82d56e39bd.zip |
bcachefs: Add a mechanism for passing extra journal entries to bch2_trans_commit()
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal.h')
-rw-r--r-- | fs/bcachefs/journal.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/bcachefs/journal.h b/fs/bcachefs/journal.h index 81e26ba43fa1..6630db6ecc14 100644 --- a/fs/bcachefs/journal.h +++ b/fs/bcachefs/journal.h @@ -199,13 +199,18 @@ bch2_journal_add_entry_noreservation(struct journal_buf *buf, size_t u64s) return entry; } +static inline struct jset_entry * +bch2_journal_reservation_entry(struct journal *j, struct journal_res *res) +{ + return vstruct_idx(j->buf[res->idx].data, res->offset); +} + static inline void bch2_journal_add_entry(struct journal *j, struct journal_res *res, unsigned type, enum btree_id id, unsigned level, const void *data, unsigned u64s) { - struct journal_buf *buf = &j->buf[res->idx]; - struct jset_entry *entry = vstruct_idx(buf->data, res->offset); + struct jset_entry *entry = bch2_journal_reservation_entry(j, res); unsigned actual = jset_u64s(u64s); EBUG_ON(!res->ref); @@ -221,7 +226,7 @@ static inline void bch2_journal_add_entry(struct journal *j, struct journal_res entry->pad[0] = 0; entry->pad[1] = 0; entry->pad[2] = 0; - memcpy_u64s(entry->_data, data, u64s); + memcpy_u64s_small(entry->_data, data, u64s); } static inline void bch2_journal_add_keys(struct journal *j, struct journal_res *res, |