summaryrefslogtreecommitdiff
path: root/fs/bcachefs/journal.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-05-26 02:29:48 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:40 +0300
commit96e2aa1be5eebd81ed572baf69f8cb82d56e39bd (patch)
tree546d8c9a8b1f179e68e1af5ba7143aa119c01da1 /fs/bcachefs/journal.h
parentb29303966b9e07dda5f21c667909eb87849453f2 (diff)
downloadlinux-96e2aa1be5eebd81ed572baf69f8cb82d56e39bd.tar.xz
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.h11
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,