diff options
author | Kiyoshi Ueda <k-ueda@ct.jp.nec.com> | 2007-12-11 17:41:17 -0500 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-01-28 04:35:56 -0500 |
commit | 3b11313a6c2a42425bf06e92528bda6affd58dec (patch) | |
tree | c2d550b2954c106387f1ebe6badb387603002202 /include/linux/blkdev.h | |
parent | 336cdb4003200a90f4fc52a4e9ccc2baa570fffb (diff) |
blk_end_request: add/export functions to get request size (take 4)
This patch adds/exports functions to get the size of request in bytes.
They are useful because blk_end_request interfaces take bytes
as a completed I/O size instead of sectors.
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 3b212f02db8d..aa2341df7932 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -737,6 +737,14 @@ extern void end_dequeued_request(struct request *, int); | |||
737 | extern void blk_complete_request(struct request *); | 737 | extern void blk_complete_request(struct request *); |
738 | 738 | ||
739 | /* | 739 | /* |
740 | * blk_end_request() takes bytes instead of sectors as a complete size. | ||
741 | * blk_rq_bytes() returns bytes left to complete in the entire request. | ||
742 | * blk_rq_cur_bytes() returns bytes left to complete in the current segment. | ||
743 | */ | ||
744 | extern unsigned int blk_rq_bytes(struct request *rq); | ||
745 | extern unsigned int blk_rq_cur_bytes(struct request *rq); | ||
746 | |||
747 | /* | ||
740 | * end_that_request_first/chunk() takes an uptodate argument. we account | 748 | * end_that_request_first/chunk() takes an uptodate argument. we account |
741 | * any value <= as an io error. 0 means -EIO for compatability reasons, | 749 | * any value <= as an io error. 0 means -EIO for compatability reasons, |
742 | * any other < 0 value is the direct error type. An uptodate value of | 750 | * any other < 0 value is the direct error type. An uptodate value of |