summaryrefslogtreecommitdiff
path: root/libbcachefs/journal.h
diff options
context:
space:
mode:
Diffstat (limited to 'libbcachefs/journal.h')
-rw-r--r--libbcachefs/journal.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/libbcachefs/journal.h b/libbcachefs/journal.h
index 3825f0dc..9ad82c60 100644
--- a/libbcachefs/journal.h
+++ b/libbcachefs/journal.h
@@ -121,15 +121,21 @@ struct journal_replay {
struct jset j;
};
-#define JOURNAL_PIN ((32 * 1024) - 1)
+#define JOURNAL_PIN (32 * 1024)
static inline bool journal_pin_active(struct journal_entry_pin *pin)
{
return pin->pin_list != NULL;
}
-void bch2_journal_pin_add(struct journal *, struct journal_entry_pin *,
- journal_pin_flush_fn);
+static inline struct journal_entry_pin_list *
+journal_seq_pin(struct journal *j, u64 seq)
+{
+ return &j->pin.data[(size_t) seq & j->pin.mask];
+}
+
+void bch2_journal_pin_add(struct journal *, struct journal_res *,
+ struct journal_entry_pin *, journal_pin_flush_fn);
void bch2_journal_pin_drop(struct journal *, struct journal_entry_pin *);
void bch2_journal_pin_add_if_older(struct journal *,
struct journal_entry_pin *,
@@ -343,12 +349,8 @@ int bch2_journal_replay(struct bch_fs *, struct list_head *);
static inline void bch2_journal_set_replay_done(struct journal *j)
{
- spin_lock(&j->lock);
BUG_ON(!test_bit(JOURNAL_STARTED, &j->flags));
-
set_bit(JOURNAL_REPLAY_DONE, &j->flags);
- j->cur_pin_list = &fifo_peek_back(&j->pin);
- spin_unlock(&j->lock);
}
ssize_t bch2_journal_print_debug(struct journal *, char *);
@@ -368,6 +370,6 @@ void bch2_fs_journal_stop(struct journal *);
void bch2_dev_journal_exit(struct bch_dev *);
int bch2_dev_journal_init(struct bch_dev *, struct bch_sb *);
void bch2_fs_journal_exit(struct journal *);
-int bch2_fs_journal_init(struct journal *, unsigned);
+int bch2_fs_journal_init(struct journal *);
#endif /* _BCACHE_JOURNAL_H */