aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/bio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/bio.h')
-rw-r--r--include/linux/bio.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 23d29b39f71e..d0eb659fa733 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -300,6 +300,29 @@ static inline void bio_get_last_bvec(struct bio *bio, struct bio_vec *bv)
300 bv->bv_len = iter.bi_bvec_done; 300 bv->bv_len = iter.bi_bvec_done;
301} 301}
302 302
303static inline unsigned bio_pages_all(struct bio *bio)
304{
305 WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED));
306 return bio->bi_vcnt;
307}
308
309static inline struct bio_vec *bio_first_bvec_all(struct bio *bio)
310{
311 WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED));
312 return bio->bi_io_vec;
313}
314
315static inline struct page *bio_first_page_all(struct bio *bio)
316{
317 return bio_first_bvec_all(bio)->bv_page;
318}
319
320static inline struct bio_vec *bio_last_bvec_all(struct bio *bio)
321{
322 WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED));
323 return &bio->bi_io_vec[bio->bi_vcnt - 1];
324}
325
303enum bip_flags { 326enum bip_flags {
304 BIP_BLOCK_INTEGRITY = 1 << 0, /* block layer owns integrity data */ 327 BIP_BLOCK_INTEGRITY = 1 << 0, /* block layer owns integrity data */
305 BIP_MAPPED_INTEGRITY = 1 << 1, /* ref tag has been remapped */ 328 BIP_MAPPED_INTEGRITY = 1 << 1, /* ref tag has been remapped */
@@ -477,7 +500,6 @@ static inline void bio_flush_dcache_pages(struct bio *bi)
477#endif 500#endif
478 501
479extern void bio_copy_data(struct bio *dst, struct bio *src); 502extern void bio_copy_data(struct bio *dst, struct bio *src);
480extern int bio_alloc_pages(struct bio *bio, gfp_t gfp);
481extern void bio_free_pages(struct bio *bio); 503extern void bio_free_pages(struct bio *bio);
482 504
483extern struct bio *bio_copy_user_iov(struct request_queue *, 505extern struct bio *bio_copy_user_iov(struct request_queue *,