summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2025-11-23 22:51:23 +0000
committerJens Axboe <axboe@kernel.dk>2025-12-12 12:36:44 -0700
commitd9f514d3e6ee48c34d70d637479b4c9384832d4f (patch)
treee32facab3a553fe8b091557cff8e6aae4e105cb8 /include/linux
parenta0750fae73c55112ea11a4867bee40f11e679405 (diff)
block: move around bio flagging helpers
We'll need bio_flagged() earlier in bio.h for later patches, move it together with all related helpers, and mark the bio_flagged()'s bio argument as const. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bio.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index ad2d57908c1c..c75a9b3672aa 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -46,6 +46,21 @@ static inline unsigned int bio_max_segs(unsigned int nr_segs)
#define bio_data_dir(bio) \
(op_is_write(bio_op(bio)) ? WRITE : READ)
+static inline bool bio_flagged(const struct bio *bio, unsigned int bit)
+{
+ return bio->bi_flags & (1U << bit);
+}
+
+static inline void bio_set_flag(struct bio *bio, unsigned int bit)
+{
+ bio->bi_flags |= (1U << bit);
+}
+
+static inline void bio_clear_flag(struct bio *bio, unsigned int bit)
+{
+ bio->bi_flags &= ~(1U << bit);
+}
+
/*
* Check whether this bio carries any data or not. A NULL bio is allowed.
*/
@@ -225,21 +240,6 @@ static inline void bio_cnt_set(struct bio *bio, unsigned int count)
atomic_set(&bio->__bi_cnt, count);
}
-static inline bool bio_flagged(struct bio *bio, unsigned int bit)
-{
- return bio->bi_flags & (1U << bit);
-}
-
-static inline void bio_set_flag(struct bio *bio, unsigned int bit)
-{
- bio->bi_flags |= (1U << bit);
-}
-
-static inline void bio_clear_flag(struct bio *bio, unsigned int bit)
-{
- bio->bi_flags &= ~(1U << bit);
-}
-
static inline struct bio_vec *bio_first_bvec_all(struct bio *bio)
{
WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED));