]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/io_types.h
Update bcachefs sources to 367a8fad45 bcachefs: Reset journal flush delay to default...
[bcachefs-tools-debian] / libbcachefs / io_types.h
index a022ab3354287c77509d15c3d2868910bead01da..78bff13d36f27cb46c6a28c5bcc9dd65cb0ecac6 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 #ifndef _BCACHEFS_IO_TYPES_H
 #define _BCACHEFS_IO_TYPES_H
 
@@ -14,6 +15,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,24 +38,39 @@ struct bch_read_bio {
         */
        struct bvec_iter        bvec_iter;
 
-       unsigned                submit_time_us;
-       u8                      flags;
+       unsigned                offset_into_extent;
+
+       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;
-       /* start pos of data we read (may not be pos of data we want) */
-       struct bpos             pos;
+       struct extent_ptr_decoded pick;
+
+       /*
+        * pos we read from - different from data_pos for indirect extents:
+        */
+       u32                     subvol;
+       struct bpos             read_pos;
+
+       /*
+        * start pos of data we read (may not be pos of data we want) - for
+        * promote, narrow extents paths:
+        */
+       enum btree_id           data_btree;
+       struct bpos             data_pos;
        struct bversion         version;
 
        struct promote_op       *promote;
@@ -66,19 +84,19 @@ struct bch_read_bio {
 
 struct bch_write_bio {
        struct bch_fs           *c;
-       struct bch_dev          *ca;
        struct bch_write_bio    *parent;
 
+       u64                     submit_time;
+
        struct bch_devs_list    failed;
-       u8                      order;
+       u8                      dev;
 
        unsigned                split:1,
                                bounce:1,
                                put_bio:1,
-                               have_io_ref:1,
-                               used_mempool:1;
-
-       unsigned                submit_time_us;
+                               have_ioref:1,
+                               used_mempool:1,
+                               first_btree_write:1;
 
        struct bio              bio;
 };
@@ -86,7 +104,8 @@ struct bch_write_bio {
 struct bch_write_op {
        struct closure          cl;
        struct bch_fs           *c;
-       struct workqueue_struct *io_wq;
+       void                    (*end_io)(struct bch_write_op *);
+       u64                     start_time;
 
        unsigned                written; /* sectors */
        u16                     flags;
@@ -96,15 +115,15 @@ struct bch_write_op {
        unsigned                compression_type:4;
        unsigned                nr_replicas:4;
        unsigned                nr_replicas_required:4;
-       unsigned                alloc_reserve:4;
+       unsigned                alloc_reserve:3;
+       unsigned                incompressible:1;
 
-       u8                      open_buckets_nr;
        struct bch_devs_list    devs_have;
        u16                     target;
        u16                     nonce;
-
        struct bch_io_opts      opts;
 
+       u32                     subvol;
        struct bpos             pos;
        struct bversion         version;
 
@@ -115,7 +134,7 @@ struct bch_write_op {
 
        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
@@ -125,6 +144,8 @@ struct bch_write_op {
                u64                     *journal_seq_p;
                u64                     journal_seq;
        };
+       u64                     new_i_size;
+       s64                     i_sectors_delta;
 
        int                     (*index_update_fn)(struct bch_write_op *);