summaryrefslogtreecommitdiff
path: root/drivers/md/dm-core.h
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@kernel.org>2022-03-19 18:04:20 -0400
committerMike Snitzer <snitzer@kernel.org>2022-03-21 14:15:35 -0400
commit655f3aad7aa4858d06cdaca6c4b14635cc3c0eba (patch)
tree811bef297498adacfa6a4597e6fc12e526b50178 /drivers/md/dm-core.h
parent82f6cdcc3676c68abaad2aac51a32f4e5d67d01e (diff)
dm: switch dm_target_io booleans over to proper flags
Add flags to dm_target_io and manage them using the same pattern used for bi_flags in struct bio. Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md/dm-core.h')
-rw-r--r--drivers/md/dm-core.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/md/dm-core.h b/drivers/md/dm-core.h
index e127cbcaf33d..feb53232d777 100644
--- a/drivers/md/dm-core.h
+++ b/drivers/md/dm-core.h
@@ -215,13 +215,30 @@ struct dm_target_io {
struct dm_io *io;
struct dm_target *ti;
unsigned int *len_ptr;
- bool inside_dm_io:1;
- bool is_duplicate_bio:1;
+ unsigned short flags;
sector_t old_sector;
struct bio clone;
};
/*
+ * dm_target_io flags
+ */
+enum {
+ DM_TIO_INSIDE_DM_IO,
+ DM_TIO_IS_DUPLICATE_BIO
+};
+
+static inline bool dm_tio_flagged(struct dm_target_io *tio, unsigned int bit)
+{
+ return (tio->flags & (1U << bit)) != 0;
+}
+
+static inline void dm_tio_set_flag(struct dm_target_io *tio, unsigned int bit)
+{
+ tio->flags |= (1U << bit);
+}
+
+/*
* One of these is allocated per original bio.
* It contains the first clone used for that original.
*/