X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libbcachefs%2Fio_types.h;h=4149291c0df6f153f8f7a147eed75487767efd18;hb=17d1c4f4fe29453fbb4087eb5de8aa6f9e6605c7;hp=04f6d9a7c9a2af5c4fd71aed870f71062ab21a4e;hpb=f96ba8e0aac91f2650270e9639359243cb9ac2d1;p=bcachefs-tools-debian diff --git a/libbcachefs/io_types.h b/libbcachefs/io_types.h index 04f6d9a..4149291 100644 --- a/libbcachefs/io_types.h +++ b/libbcachefs/io_types.h @@ -38,6 +38,8 @@ struct bch_read_bio { */ struct bvec_iter bvec_iter; + unsigned offset_into_extent; + u16 flags; union { struct { @@ -56,8 +58,19 @@ struct bch_read_bio { struct bch_devs_list devs_have; struct extent_ptr_decoded pick; - /* start pos of data we read (may not be pos of data we want) */ - struct bpos pos; + + /* + * 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; @@ -70,20 +83,24 @@ 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 order; u8 dev; unsigned split:1, bounce:1, put_bio:1, have_ioref:1, - used_mempool:1; + nocow:1, + used_mempool:1, + first_btree_write:1; + ); struct bio bio; }; @@ -91,7 +108,7 @@ 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 */ @@ -102,14 +119,16 @@ 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; + 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; @@ -118,26 +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; - }; - - int (*index_update_fn)(struct bch_write_op *); + u64 new_i_size; + s64 i_sectors_delta; 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; };