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;
24 struct bch_devs_list failed;
42 void (*end_io)(struct bch_write_op *);
45 unsigned written; /* sectors */
47 s16 error; /* dio write path expects it to hold -ERESTARTSYS... */
49 unsigned compression_opt:8;
51 unsigned nr_replicas:4;
52 unsigned nr_replicas_required:4;
54 unsigned incompressible:1;
55 unsigned stripe_waited:1;
57 struct bch_devs_list devs_have;
60 struct bch_io_opts opts;
64 struct bversion version;
66 /* For BCH_WRITE_DATA_ENCODED: */
67 struct bch_extent_crc_unpacked crc;
69 struct write_point_specifier write_point;
71 struct write_point *wp;
72 struct list_head wp_list;
74 struct disk_reservation res;
76 struct open_buckets open_buckets;
81 struct bch_devs_mask failed;
83 struct keylist insert_keys;
84 u64 inline_keys[BKEY_EXTENT_U64s_MAX * 2];
87 * Bitmask of devices that have had nocow writes issued to them since
90 struct bch_devs_mask *devs_need_flush;
93 struct bch_write_bio wbio;
96 #endif /* _BCACHEFS_IO_WRITE_TYPES_H */