aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/bio.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2015-07-24 14:37:59 -0400
committerJens Axboe <axboe@fb.com>2015-07-29 10:55:20 -0400
commitb7c44ed9d2fc6b461378c65eaf144ccc80a47772 (patch)
tree2f38bdc1cf7ea6c924f6e1d52cf5913c370e08b6 /include/linux/bio.h
parent4246a0b63bd8f56a1469b12eafeb875b1041a451 (diff)
block: manipulate bio->bi_flags through helpers
Some places use helpers now, others don't. We only have the 'is set' helper, add helpers for setting and clearing flags too. It was a bit of a mess of atomic vs non-atomic access. With BIO_UPTODATE gone, we don't have any risk of concurrent access to the flags. So relax the restriction and don't make any of them atomic. The flags that do have serialization issues (reffed and chained), we already handle those separately. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/bio.h')
-rw-r--r--include/linux/bio.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 6b918177002d..986e6e19feb5 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -304,6 +304,21 @@ static inline void bio_cnt_set(struct bio *bio, unsigned int count)
304 atomic_set(&bio->__bi_cnt, count); 304 atomic_set(&bio->__bi_cnt, count);
305} 305}
306 306
307static inline bool bio_flagged(struct bio *bio, unsigned int bit)
308{
309 return (bio->bi_flags & (1UL << bit)) != 0;
310}
311
312static inline void bio_set_flag(struct bio *bio, unsigned int bit)
313{
314 bio->bi_flags |= (1UL << bit);
315}
316
317static inline void bio_clear_flag(struct bio *bio, unsigned int bit)
318{
319 bio->bi_flags &= ~(1UL << bit);
320}
321
307enum bip_flags { 322enum bip_flags {
308 BIP_BLOCK_INTEGRITY = 1 << 0, /* block layer owns integrity data */ 323 BIP_BLOCK_INTEGRITY = 1 << 0, /* block layer owns integrity data */
309 BIP_MAPPED_INTEGRITY = 1 << 1, /* ref tag has been remapped */ 324 BIP_MAPPED_INTEGRITY = 1 << 1, /* ref tag has been remapped */