]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/io_types.h
Update bcachefs sources to 7227ff07f14b Merge pull request #10 from modelrockettier...
[bcachefs-tools-debian] / libbcachefs / io_types.h
index ff18fdc90eb7822c7d5765e84d47fd9b3fa6f416..8ec846cc996f1d09aa2386f159e84f4d2832edd7 100644 (file)
@@ -14,6 +14,8 @@
 
 struct bch_read_bio {
        struct bch_fs           *c;
+       u64                     start_time;
+       u64                     submit_time;
 
        /*
         * Reads will often have to be split, and if the extent being read from
@@ -35,22 +37,24 @@ struct bch_read_bio {
         */
        struct bvec_iter        bvec_iter;
 
-       unsigned                submit_time_us;
-       u8                      flags;
+       u16                     flags;
        union {
        struct {
-       u                     bounce:1,
+       u16                     bounce:1,
                                split:1,
+                               kmalloc:1,
+                               have_ioref:1,
                                narrow_crcs:1,
+                               hole:1,
                                retry:2,
                                context:2;
        };
-       u                     _state;
+       u16                     _state;
        };
 
        struct bch_devs_list    devs_have;
 
-       struct extent_pick_ptr  pick;
+       struct extent_ptr_decoded pick;
        /* start pos of data we read (may not be pos of data we want) */
        struct bpos             pos;
        struct bversion         version;
@@ -66,24 +70,20 @@ struct bch_read_bio {
 
 struct bch_write_bio {
        struct bch_fs           *c;
-       struct bch_dev          *ca;
-       union {
        struct bch_write_bio    *parent;
-       struct closure          *cl;
-       };
+
+       u64                     submit_time;
 
        struct bch_devs_list    failed;
        u8                      order;
+       u8                      dev;
 
        unsigned                split:1,
                                bounce:1,
                                put_bio:1,
-                               have_io_ref:1,
+                               have_ioref:1,
                                used_mempool:1;
 
-       unsigned                submit_time_us;
-       void                    *data;
-
        struct bio              bio;
 };
 
@@ -91,10 +91,11 @@ struct bch_write_op {
        struct closure          cl;
        struct bch_fs           *c;
        struct workqueue_struct *io_wq;
+       u64                     start_time;
 
        unsigned                written; /* sectors */
        u16                     flags;
-       s8                      error;
+       s16                     error; /* dio write path expects it to hold -ERESTARTSYS... */
 
        unsigned                csum_type:4;
        unsigned                compression_type:4;
@@ -102,23 +103,23 @@ struct bch_write_op {
        unsigned                nr_replicas_required:4;
        unsigned                alloc_reserve:4;
 
-       u8                      open_buckets_nr;
        struct bch_devs_list    devs_have;
        u16                     target;
        u16                     nonce;
 
+       struct bch_io_opts      opts;
+
        struct bpos             pos;
        struct bversion         version;
 
        /* For BCH_WRITE_DATA_ENCODED: */
        struct bch_extent_crc_unpacked crc;
 
-       struct bch_devs_mask    *devs;
        struct write_point_specifier write_point;
 
        struct disk_reservation res;
 
-       u8                      open_buckets[16];
+       struct open_buckets     open_buckets;
 
        /*
         * If caller wants to flush but hasn't passed us a journal_seq ptr, we