aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-core.h
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@kernel.org>2022-03-25 14:12:47 -0400
committerMike Snitzer <snitzer@kernel.org>2022-05-05 17:31:34 -0400
commit3b03f7c1242c754f0c474b37eec7d79107b9f375 (patch)
tree7f9f9f10e9b34539382daa24b4f8404b09608283 /drivers/md/dm-core.h
parentdm: simplify dm_io access in dm_split_and_process_bio (diff)
downloadlinux-dev-3b03f7c1242c754f0c474b37eec7d79107b9f375.tar.xz
linux-dev-3b03f7c1242c754f0c474b37eec7d79107b9f375.zip
dm: simplify dm_start_io_acct
Pull common DM_IO_ACCOUNTED check out to beginning of dm_start_io_acct. Also, use dm_tio_is_normal (and move it to dm-core.h). Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md/dm-core.h')
-rw-r--r--drivers/md/dm-core.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/md/dm-core.h b/drivers/md/dm-core.h
index 4277853c7535..db069fa9cee5 100644
--- a/drivers/md/dm-core.h
+++ b/drivers/md/dm-core.h
@@ -237,6 +237,12 @@ static inline void dm_tio_set_flag(struct dm_target_io *tio, unsigned int bit)
tio->flags |= (1U << bit);
}
+static inline bool dm_tio_is_normal(struct dm_target_io *tio)
+{
+ return (dm_tio_flagged(tio, DM_TIO_INSIDE_DM_IO) &&
+ !dm_tio_flagged(tio, DM_TIO_IS_DUPLICATE_BIO));
+}
+
/*
* One of these is allocated per original bio.
* It contains the first clone used for that original.