Skip to content

Commit

Permalink
block: remove the nr_sectors variable in generic_make_request_checks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Jul 1, 2020
1 parent 833f84e commit e439ab7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit e439ab7

Please sign in to comment.