Skip to content

Commit

Permalink
block: use bio_has_data() in the IO completion path
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Jens Axboe committed Oct 9, 2008
1 parent a9c701e commit 051cc39
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1885,7 +1885,7 @@ static int blk_end_io(struct request *rq, int error, unsigned int nr_bytes,
struct request_queue *q = rq->q;
unsigned long flags = 0UL;

if (blk_fs_request(rq) || blk_pc_request(rq)) {
if (bio_has_data(rq->bio)) {
if (__end_that_request_first(rq, error, nr_bytes))
return 1;

Expand Down Expand Up @@ -1943,10 +1943,9 @@ EXPORT_SYMBOL_GPL(blk_end_request);
**/
int __blk_end_request(struct request *rq, int error, unsigned int nr_bytes)
{
if (blk_fs_request(rq) || blk_pc_request(rq)) {
if (__end_that_request_first(rq, error, nr_bytes))
return 1;
}
if (bio_has_data(rq->bio) &&
__end_that_request_first(rq, error, nr_bytes))
return 1;

add_disk_randomness(rq->rq_disk);

Expand Down

0 comments on commit 051cc39

Please sign in to comment.