Skip to content

Commit

Permalink
block: let blk_end_request_all handle bidi requests
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
FUJITA Tomonori authored and Jens Axboe committed May 11, 2009
1 parent 9934c8c commit 1822952
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 1822952

Please sign in to comment.