diff options
| author | Christoph Hellwig <hch@lst.de> | 2019-03-03 11:14:01 -0500 |
|---|---|---|
| committer | Christoph Hellwig <hch@lst.de> | 2019-04-05 02:07:57 -0400 |
| commit | 3aef3cae4342c1d8137a1c0782cbb66f1be3943c (patch) | |
| tree | b3395af3de378c1cc00c6a85375a8a6dff8146c8 /include/linux/blkdev.h | |
| parent | 39f8e36401142d73e33a954ac4bdf844fb5de9ae (diff) | |
block: add a req_bvec helper
Return the currently active bvec segment, potentially spanning multiple
pages.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Diffstat (limited to 'include/linux/blkdev.h')
| -rw-r--r-- | include/linux/blkdev.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 5c58a3b2bf00..84ce76f92d83 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -932,6 +932,17 @@ static inline unsigned int blk_rq_payload_bytes(struct request *rq) | |||
| 932 | return blk_rq_bytes(rq); | 932 | return blk_rq_bytes(rq); |
| 933 | } | 933 | } |
| 934 | 934 | ||
| 935 | /* | ||
| 936 | * Return the first full biovec in the request. The caller needs to check that | ||
| 937 | * there are any bvecs before calling this helper. | ||
| 938 | */ | ||
| 939 | static inline struct bio_vec req_bvec(struct request *rq) | ||
| 940 | { | ||
| 941 | if (rq->rq_flags & RQF_SPECIAL_PAYLOAD) | ||
| 942 | return rq->special_vec; | ||
| 943 | return mp_bvec_iter_bvec(rq->bio->bi_io_vec, rq->bio->bi_iter); | ||
| 944 | } | ||
| 945 | |||
| 935 | static inline unsigned int blk_queue_get_max_sectors(struct request_queue *q, | 946 | static inline unsigned int blk_queue_get_max_sectors(struct request_queue *q, |
| 936 | int op) | 947 | int op) |
| 937 | { | 948 | { |
