block: use bio_has_data() in the IO completion path
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
parent
a9c701e594
commit
051cc3952a
1 changed files with 4 additions and 5 deletions
|
@ -1885,7 +1885,7 @@ static int blk_end_io(struct request *rq, int error, unsigned int nr_bytes,
|
||||||
struct request_queue *q = rq->q;
|
struct request_queue *q = rq->q;
|
||||||
unsigned long flags = 0UL;
|
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))
|
if (__end_that_request_first(rq, error, nr_bytes))
|
||||||
return 1;
|
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)
|
int __blk_end_request(struct request *rq, int error, unsigned int nr_bytes)
|
||||||
{
|
{
|
||||||
if (blk_fs_request(rq) || blk_pc_request(rq)) {
|
if (bio_has_data(rq->bio) &&
|
||||||
if (__end_that_request_first(rq, error, nr_bytes))
|
__end_that_request_first(rq, error, nr_bytes))
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
|
|
||||||
add_disk_randomness(rq->rq_disk);
|
add_disk_randomness(rq->rq_disk);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue