From 82f6cdcc3676c68abaad2aac51a32f4e5d67d01e Mon Sep 17 00:00:00 2001 From: Mike Snitzer Date: Fri, 18 Mar 2022 00:15:28 -0400 Subject: dm: switch dm_io booleans over to proper flags Add flags to dm_io and manage them using the same pattern used for bi_flags in struct bio. Signed-off-by: Mike Snitzer --- drivers/md/dm-core.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'drivers/md/dm-core.h') diff --git a/drivers/md/dm-core.h b/drivers/md/dm-core.h index 8d3d11887343..e127cbcaf33d 100644 --- a/drivers/md/dm-core.h +++ b/drivers/md/dm-core.h @@ -232,18 +232,36 @@ struct dm_io { struct mapped_device *md; struct bio *orig_bio; blk_status_t status; - bool start_io_acct:1; - int was_accounted; + unsigned short flags; unsigned long start_time; void *data; struct hlist_node node; struct task_struct *map_task; + spinlock_t startio_lock; spinlock_t endio_lock; struct dm_stats_aux stats_aux; /* last member of dm_target_io is 'struct bio' */ struct dm_target_io tio; }; +/* + * dm_io flags + */ +enum { + DM_IO_START_ACCT, + DM_IO_ACCOUNTED +}; + +static inline bool dm_io_flagged(struct dm_io *io, unsigned int bit) +{ + return (io->flags & (1U << bit)) != 0; +} + +static inline void dm_io_set_flag(struct dm_io *io, unsigned int bit) +{ + io->flags |= (1U << bit); +} + static inline void dm_io_inc_pending(struct dm_io *io) { atomic_inc(&io->io_count); -- cgit v1.2.3-70-g09d2