summaryrefslogtreecommitdiff
path: root/libbcachefs/journal_reclaim.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-05-04 14:04:31 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2018-05-04 14:05:32 -0400
commit018de5aa899937a9dc3bc8cb9819cb218a59abf3 (patch)
tree554b99e5dafe04f5bf9201a3c54bd1b0f39f77f3 /libbcachefs/journal_reclaim.h
parentc598d91dcb0c7e95abdacb2711898ae14ab52ca1 (diff)
Update bcachefs sources to ed4aea2ad4 bcachefs: fix gcc warning
Diffstat (limited to 'libbcachefs/journal_reclaim.h')
-rw-r--r--libbcachefs/journal_reclaim.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/libbcachefs/journal_reclaim.h b/libbcachefs/journal_reclaim.h
new file mode 100644
index 0000000..7d460c3
--- /dev/null
+++ b/libbcachefs/journal_reclaim.h
@@ -0,0 +1,36 @@
+#ifndef _BCACHEFS_JOURNAL_RECLAIM_H
+#define _BCACHEFS_JOURNAL_RECLAIM_H
+
+#define JOURNAL_PIN (32 * 1024)
+
+static inline bool journal_pin_active(struct journal_entry_pin *pin)
+{
+ return pin->pin_list != NULL;
+}
+
+static inline struct journal_entry_pin_list *
+journal_seq_pin(struct journal *j, u64 seq)
+{
+ BUG_ON(seq < j->pin.front || seq >= j->pin.back);
+
+ return &j->pin.data[seq & j->pin.mask];
+}
+
+u64 bch2_journal_pin_seq(struct journal *, struct journal_entry_pin *);
+
+void bch2_journal_pin_add(struct journal *, u64, 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 *,
+ struct journal_entry_pin *,
+ journal_pin_flush_fn);
+
+void bch2_journal_reclaim_fast(struct journal *);
+void bch2_journal_reclaim_work(struct work_struct *);
+
+int bch2_journal_flush_pins(struct journal *, u64);
+int bch2_journal_flush_all_pins(struct journal *);
+int bch2_journal_flush_device_pins(struct journal *, int);
+
+#endif /* _BCACHEFS_JOURNAL_RECLAIM_H */