block: use bio_has_data() in the IO completion path
authorJens Axboe <jens.axboe@oracle.com>
Fri, 8 Aug 2008 09:06:45 +0000 (11:06 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 9 Oct 2008 06:56:00 +0000 (08:56 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/blk-core.c

index 54e442ba44aa14ef6c1c72234586c1e3db28e282..b5776c1fd52aca777ae9dc185a936121caf0e8a9 100644 (file)
@@ -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;
 
@@ -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);