summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-07-01 10:59:42 +0200
committerJens Axboe <axboe@kernel.dk>2020-07-01 15:27:24 +0200
commite439ab710fb0564dccb52b0519b3d354ea2a9c50 (patch)
tree81384c304cd9e72dd870c4f04b561c8275f9070d /block
parentblock: remove the NULL queue check in generic_make_request_checks (diff)
downloadlinux-e439ab710fb0564dccb52b0519b3d354ea2a9c50.tar.xz
linux-e439ab710fb0564dccb52b0519b3d354ea2a9c50.zip
block: remove the nr_sectors variable in generic_make_request_checks
The variable is only used once, so just open code the bio_sector() there. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 37435d0d4335..28f60985dc75 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -974,7 +974,6 @@ static noinline_for_stack bool
generic_make_request_checks(struct bio *bio)
{
struct request_queue *q = bio->bi_disk->queue;
- int nr_sectors = bio_sectors(bio);
blk_status_t status = BLK_STS_IOERR;
might_sleep();
@@ -1007,7 +1006,7 @@ generic_make_request_checks(struct bio *bio)
if (op_is_flush(bio->bi_opf) &&
!test_bit(QUEUE_FLAG_WC, &q->queue_flags)) {
bio->bi_opf &= ~(REQ_PREFLUSH | REQ_FUA);
- if (!nr_sectors) {
+ if (!bio_sectors(bio)) {
status = BLK_STS_OK;
goto end_io;
}