[PATCH 18/28] blkdev.h: move blk_op_is_passthrough() to blk_types.h

Max Kellermann
2024-01-31T14:50:32Z

This is a very low-level function without any additional dependencies,
and moving it will allow certain sources to omit the "blkdev.h"
dependency.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
---
include/linux/blk_types.h | 6 ++++++
include/linux/blkdev.h | 6 ------
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 96a37f399928..ad48c3f5ddd6 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -434,6 +434,12 @@ static inline enum req_op bio_op(const struct bio *bio)
return bio->bi_opf & REQ_OP_MASK;
}

+static inline bool blk_op_is_passthrough(blk_opf_t op)
+{
+ op &= REQ_OP_MASK;
+ return op == REQ_OP_DRV_IN || op == REQ_OP_DRV_OUT;
+}
+
static inline bool op_is_write(blk_opf_t op)
{
return !!(op & (__force blk_opf_t)1);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index d2c0934a7224..a5e41a54de18 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -259,12 +259,6 @@ static inline int blk_validate_block_size(unsigned long bsize)
return 0;
}

-static inline bool blk_op_is_passthrough(blk_opf_t op)
-{
- op &= REQ_OP_MASK;
- return op == REQ_OP_DRV_IN || op == REQ_OP_DRV_OUT;
-}
-
/*
* BLK_BOUNCE_NONE: never bounce (default)
* BLK_BOUNCE_HIGH: bounce all highmem pages
--
2.39.2