aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2009-05-11 17:56:07 +0900
committerJens Axboe <jens.axboe@oracle.com>2009-05-11 11:06:47 +0200
commit1822952ba2b9f22f79019d07ebbeca31dc14b718 (patch)
treede3a727e811f33bc908cd6c4d2f0cf5a1693dab3
parent9934c8c04561413609d2bc38c6b9f268cba774a4 (diff)
block: let blk_end_request_all handle bidi requests
blk_end_request_all() and __blk_end_request_all() should finish all bytes including bidi, by definition. That's what all bidi users need , bidi requests must be complete as a whole (partial completion is impossible). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r--include/linux/blkdev.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 6e59d3b92ff..1069f4483c6 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -910,8 +910,12 @@ static inline bool blk_end_request(struct request *rq, int error,
static inline void blk_end_request_all(struct request *rq, int error)
{
bool pending;
+ unsigned int bidi_bytes = 0;
- pending = blk_end_request(rq, error, blk_rq_bytes(rq));
+ if (unlikely(blk_bidi_rq(rq)))
+ bidi_bytes = blk_rq_bytes(rq->next_rq);
+
+ pending = blk_end_bidi_request(rq, error, blk_rq_bytes(rq), bidi_bytes);
BUG_ON(pending);
}
@@ -962,8 +966,12 @@ static inline bool __blk_end_request(struct request *rq, int error,
static inline void __blk_end_request_all(struct request *rq, int error)
{
bool pending;
+ unsigned int bidi_bytes = 0;
+
+ if (unlikely(blk_bidi_rq(rq)))
+ bidi_bytes = blk_rq_bytes(rq->next_rq);
- pending = __blk_end_request(rq, error, blk_rq_bytes(rq));
+ pending = __blk_end_bidi_request(rq, error, blk_rq_bytes(rq), bidi_bytes);
BUG_ON(pending);
}