diff options
author | Mike Snitzer <snitzer@kernel.org> | 2022-03-18 00:15:28 -0400 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2022-03-21 14:15:34 -0400 |
commit | 82f6cdcc3676c68abaad2aac51a32f4e5d67d01e (patch) | |
tree | b9713eb1c9e5327ab47cdb5725e379eba30e3867 /drivers/md/dm-core.h | |
parent | e9567332a4a0bf3533b4126e50992d5a569ea675 (diff) |
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 <snitzer@kernel.org>
Diffstat (limited to 'drivers/md/dm-core.h')
-rw-r--r-- | drivers/md/dm-core.h | 22 |
1 files changed, 20 insertions, 2 deletions
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); |