]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/journal_types.h
Update bcachefs sources to 940d6ca657 bcachefs: acl code improvements
[bcachefs-tools-debian] / libbcachefs / journal_types.h
index 55b41c56a3f2f276bf474580dbfad43e3eb71bc2..effbeece1ed98c8822d7bcc593071891db9e9e13 100644 (file)
@@ -17,6 +17,8 @@ struct journal_res;
 struct journal_buf {
        struct jset             *data;
 
+       BKEY_PADDED(key);
+
        struct closure_waitlist wait;
 
        unsigned                size;
@@ -34,6 +36,7 @@ struct journal_entry_pin_list {
        struct list_head                list;
        struct list_head                flushed;
        atomic_t                        count;
+       struct bch_devs_list            devs;
 };
 
 struct journal;
@@ -56,8 +59,9 @@ struct blacklisted_node {
 
 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;
@@ -113,6 +117,7 @@ enum {
        JOURNAL_REPLAY_DONE,
        JOURNAL_STARTED,
        JOURNAL_NEED_WRITE,
+       JOURNAL_NOT_EMPTY,
 };
 
 /* Embedded in struct bch_fs */
@@ -137,10 +142,10 @@ struct journal {
 
        /* 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;
@@ -164,20 +169,19 @@ struct journal {
         * 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;
@@ -229,7 +233,6 @@ struct journal_device {
 
        /* Bio for journal reads/writes to this device */
        struct bio              *bio;
-       u8                      ptr_idx;
 
        /* for bch_journal_read_device */
        struct closure          read;