Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Christoph Hellwig and committed by
Jens Axboe
e439ab71 833f84e2

+1 -2
+1 -2
block/blk-core.c
··· 974 974 generic_make_request_checks(struct bio *bio) 975 975 { 976 976 struct request_queue *q = bio->bi_disk->queue; 977 - int nr_sectors = bio_sectors(bio); 978 977 blk_status_t status = BLK_STS_IOERR; 979 978 980 979 might_sleep(); ··· 1006 1007 if (op_is_flush(bio->bi_opf) && 1007 1008 !test_bit(QUEUE_FLAG_WC, &q->queue_flags)) { 1008 1009 bio->bi_opf &= ~(REQ_PREFLUSH | REQ_FUA); 1009 - if (!nr_sectors) { 1010 + if (!bio_sectors(bio)) { 1010 1011 status = BLK_STS_OK; 1011 1012 goto end_io; 1012 1013 }