1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_IO_WRITE_TYPES_H
3 #define _BCACHEFS_IO_WRITE_TYPES_H
5 #include "alloc_types.h"
6 #include "btree_types.h"
7 #include "buckets_types.h"
8 #include "extents_types.h"
9 #include "keylist_types.h"
11 #include "super_types.h"
13 #include <linux/llist.h>
14 #include <linux/workqueue.h>
16 struct bch_write_bio {
19 struct bch_write_bio *parent;
25 struct bch_devs_list failed;
43 void (*end_io)(struct bch_write_op *);
46 unsigned written; /* sectors */
48 s16 error; /* dio write path expects it to hold -ERESTARTSYS... */
50 unsigned compression_opt:8;
52 unsigned nr_replicas:4;
53 unsigned nr_replicas_required:4;
55 unsigned incompressible:1;
56 unsigned stripe_waited:1;
58 struct bch_devs_list devs_have;
61 struct bch_io_opts opts;
65 struct bversion version;
67 /* For BCH_WRITE_DATA_ENCODED: */
68 struct bch_extent_crc_unpacked crc;
70 struct write_point_specifier write_point;
72 struct write_point *wp;
73 struct list_head wp_list;
75 struct disk_reservation res;
77 struct open_buckets open_buckets;
82 struct bch_devs_mask failed;
84 struct keylist insert_keys;
85 u64 inline_keys[BKEY_EXTENT_U64s_MAX * 2];
88 * Bitmask of devices that have had nocow writes issued to them since
91 struct bch_devs_mask *devs_need_flush;
94 struct bch_write_bio wbio;
97 #endif /* _BCACHEFS_IO_WRITE_TYPES_H */