]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/io_types.h
New upstream release
[bcachefs-tools-debian] / libbcachefs / io_types.h
index e7aca7c9823aff2a5c6cfe8a21820c41d3d627fd..737f16d78c48e50c3a325124c9f4f2ea4418388e 100644 (file)
@@ -62,6 +62,7 @@ struct bch_read_bio {
        /*
         * pos we read from - different from data_pos for indirect extents:
         */
+       u32                     subvol;
        struct bpos             read_pos;
 
        /*
@@ -82,10 +83,12 @@ struct bch_read_bio {
 };
 
 struct bch_write_bio {
+       struct_group(wbio,
        struct bch_fs           *c;
        struct bch_write_bio    *parent;
 
        u64                     submit_time;
+       u64                     inode_offset;
 
        struct bch_devs_list    failed;
        u8                      dev;
@@ -94,7 +97,10 @@ struct bch_write_bio {
                                bounce:1,
                                put_bio:1,
                                have_ioref:1,
-                               used_mempool:1;
+                               nocow:1,
+                               used_mempool:1,
+                               first_btree_write:1;
+       );
 
        struct bio              bio;
 };
@@ -109,18 +115,20 @@ struct bch_write_op {
        u16                     flags;
        s16                     error; /* dio write path expects it to hold -ERESTARTSYS... */
 
+       unsigned                compression_opt:8;
        unsigned                csum_type:4;
-       unsigned                compression_type:4;
        unsigned                nr_replicas:4;
        unsigned                nr_replicas_required:4;
-       unsigned                alloc_reserve:3;
+       unsigned                watermark:3;
        unsigned                incompressible:1;
+       unsigned                stripe_waited:1;
 
        struct bch_devs_list    devs_have;
        u16                     target;
        u16                     nonce;
        struct bch_io_opts      opts;
 
+       u32                     subvol;
        struct bpos             pos;
        struct bversion         version;
 
@@ -129,28 +137,27 @@ struct bch_write_op {
 
        struct write_point_specifier write_point;
 
+       struct write_point      *wp;
+       struct list_head        wp_list;
+
        struct disk_reservation res;
 
        struct open_buckets     open_buckets;
 
-       /*
-        * If caller wants to flush but hasn't passed us a journal_seq ptr, we
-        * still need to stash the journal_seq somewhere:
-        */
-       union {
-               u64                     *journal_seq_p;
-               u64                     journal_seq;
-       };
        u64                     new_i_size;
        s64                     i_sectors_delta;
 
-       int                     (*index_update_fn)(struct bch_write_op *);
-
        struct bch_devs_mask    failed;
 
        struct keylist          insert_keys;
        u64                     inline_keys[BKEY_EXTENT_U64s_MAX * 2];
 
+       /*
+        * Bitmask of devices that have had nocow writes issued to them since
+        * last flush:
+        */
+       struct bch_devs_mask    *devs_need_flush;
+
        /* Must be last: */
        struct bch_write_bio    wbio;
 };