struct journal_buf {
struct jset *data;
+ BKEY_PADDED(key);
+
struct closure_waitlist wait;
unsigned size;
struct list_head list;
struct list_head flushed;
atomic_t count;
+ struct bch_devs_list devs;
};
struct journal;
struct journal_seq_blacklist {
struct list_head list;
- u64 seq;
- bool written;
+ u64 start;
+ u64 end;
+
struct journal_entry_pin pin;
struct blacklisted_node *entries;
JOURNAL_REPLAY_DONE,
JOURNAL_STARTED,
JOURNAL_NEED_WRITE,
+ JOURNAL_NOT_EMPTY,
};
/* Embedded in struct bch_fs */
/* Used when waiting because the journal was full */
wait_queue_head_t wait;
+ struct closure_waitlist async_wait;
struct closure io;
struct delayed_work write_work;
- unsigned long replicas_failed;
/* Sequence number of most recent journal entry (last entry in @pin) */
atomic64_t seq;
* needed. When all journal entries in the oldest journal bucket are no
* longer needed, the bucket can be discarded and reused.
*/
- DECLARE_FIFO(struct journal_entry_pin_list, pin);
- struct journal_entry_pin_list *replay_pin_list;
-
- /*
- * Protects the pin lists - the fifo itself is still protected by
- * j->lock though:
- */
- spinlock_t pin_lock;
+ struct {
+ u64 front, back, size, mask;
+ struct journal_entry_pin_list *data;
+ } pin;
+ u64 replay_journal_seq;
struct mutex blacklist_lock;
struct list_head seq_blacklist;
+ struct journal_seq_blacklist *new_blacklist;
BKEY_PADDED(key);
struct write_point wp;
+ spinlock_t err_lock;
struct delayed_work reclaim_work;
unsigned long last_flushed;
/* Bio for journal reads/writes to this device */
struct bio *bio;
- u8 ptr_idx;
/* for bch_journal_read_device */
struct closure read;