summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-10-12 18:18:00 +0200
committerJens Axboe <axboe@kernel.dk>2021-10-18 14:17:35 +0200
commitb6559d8f9fdd7f0e139161cffea2645bd8d084c6 (patch)
tree89a116d9bdc2e5fc2306d6ce7acc118cd5869abb /include
parentblock: move bio_mergeable out of bio.h (diff)
downloadlinux-b6559d8f9fdd7f0e139161cffea2645bd8d084c6.tar.xz
linux-b6559d8f9fdd7f0e139161cffea2645bd8d084c6.zip
block: fold bio_cur_bytes into blk_rq_cur_bytes
Fold bio_cur_bytes into the only caller. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20211012161804.991559-5-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include')
-rw-r--r--include/linux/bio.h8
-rw-r--r--include/linux/blk-mq.h6
2 files changed, 5 insertions, 9 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index ec255f282994..cffd5eba401e 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -69,14 +69,6 @@ static inline bool bio_no_advance_iter(const struct bio *bio)
bio_op(bio) == REQ_OP_WRITE_ZEROES;
}
-static inline unsigned int bio_cur_bytes(struct bio *bio)
-{
- if (bio_has_data(bio))
- return bio_iovec(bio).bv_len;
- else /* dataless requests such as discard */
- return bio->bi_iter.bi_size;
-}
-
static inline void *bio_data(struct bio *bio)
{
if (bio_has_data(bio))
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index 0e941f217578..2219e9277118 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -927,7 +927,11 @@ static inline unsigned int blk_rq_bytes(const struct request *rq)
static inline int blk_rq_cur_bytes(const struct request *rq)
{
- return rq->bio ? bio_cur_bytes(rq->bio) : 0;
+ if (!rq->bio)
+ return 0;
+ if (!bio_has_data(rq->bio)) /* dataless requests such as discard */
+ return rq->bio->bi_iter.bi_size;
+ return bio_iovec(rq->bio).bv_len;
}
unsigned int blk_rq_err_bytes(const struct request *rq);