aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-08-26 07:34:34 -0400
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 02:56:09 -0400
commit605401618ce4409045bc4db86e88d4b38f2ad585 (patch)
tree1abcf85f04c407c5f18268c1e84acb99244a7e38 /block
parentab780f1ece0dc8d5e8e8e85435acc5e4747ccda3 (diff)
block: don't use bio_has_data() in the completion path
We should just check for rq->bio, as that is really the information we are looking for. Even if the bio attached doesn't carry data, we still need to do IO post processing on it. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index b9a252cae4df..5bf806adc770 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1817,7 +1817,7 @@ static int blk_end_io(struct request *rq, int error, unsigned int nr_bytes,
1817 struct request_queue *q = rq->q; 1817 struct request_queue *q = rq->q;
1818 unsigned long flags = 0UL; 1818 unsigned long flags = 0UL;
1819 1819
1820 if (bio_has_data(rq->bio) || blk_discard_rq(rq)) { 1820 if (rq->bio) {
1821 if (__end_that_request_first(rq, error, nr_bytes)) 1821 if (__end_that_request_first(rq, error, nr_bytes))
1822 return 1; 1822 return 1;
1823 1823
@@ -1875,8 +1875,7 @@ EXPORT_SYMBOL_GPL(blk_end_request);
1875 **/ 1875 **/
1876int __blk_end_request(struct request *rq, int error, unsigned int nr_bytes) 1876int __blk_end_request(struct request *rq, int error, unsigned int nr_bytes)
1877{ 1877{
1878 if ((bio_has_data(rq->bio) || blk_discard_rq(rq)) && 1878 if (rq->bio && __end_that_request_first(rq, error, nr_bytes))
1879 __end_that_request_first(rq, error, nr_bytes))
1880 return 1; 1879 return 1;
1881 1880
1882 add_disk_randomness(rq->rq_disk); 1881 add_disk_randomness(rq->rq_disk);