Skip to content

Commit d9f514d

Browse files
isilenceaxboe
authored andcommitted
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>
1 parent a0750fa commit d9f514d

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

include/linux/bio.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,21 @@ static inline unsigned int bio_max_segs(unsigned int nr_segs)
4646
#define bio_data_dir(bio) \
4747
(op_is_write(bio_op(bio)) ? WRITE : READ)
4848

49+
static inline bool bio_flagged(const struct bio *bio, unsigned int bit)
50+
{
51+
return bio->bi_flags & (1U << bit);
52+
}
53+
54+
static inline void bio_set_flag(struct bio *bio, unsigned int bit)
55+
{
56+
bio->bi_flags |= (1U << bit);
57+
}
58+
59+
static inline void bio_clear_flag(struct bio *bio, unsigned int bit)
60+
{
61+
bio->bi_flags &= ~(1U << bit);
62+
}
63+
4964
/*
5065
* Check whether this bio carries any data or not. A NULL bio is allowed.
5166
*/
@@ -225,21 +240,6 @@ static inline void bio_cnt_set(struct bio *bio, unsigned int count)
225240
atomic_set(&bio->__bi_cnt, count);
226241
}
227242

228-
static inline bool bio_flagged(struct bio *bio, unsigned int bit)
229-
{
230-
return bio->bi_flags & (1U << bit);
231-
}
232-
233-
static inline void bio_set_flag(struct bio *bio, unsigned int bit)
234-
{
235-
bio->bi_flags |= (1U << bit);
236-
}
237-
238-
static inline void bio_clear_flag(struct bio *bio, unsigned int bit)
239-
{
240-
bio->bi_flags &= ~(1U << bit);
241-
}
242-
243243
static inline struct bio_vec *bio_first_bvec_all(struct bio *bio)
244244
{
245245
WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED));

0 commit comments

Comments
 (0)