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

Configure Feed

Select the types of activity you want to include in your feed.

block: remove disk_zone_is_full()

The helper function disk_zone_is_full() is only used in
disk_zone_wplug_is_full(). So remove it and open code it directly in
this single caller.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Damien Le Moal and committed by
Jens Axboe
c30e8c4b 1084e41d

+3 -9
+3 -9
block/blk-zoned.c
··· 492 492 return zone->start + zone->len >= get_capacity(disk); 493 493 } 494 494 495 - static bool disk_zone_is_full(struct gendisk *disk, 496 - unsigned int zno, unsigned int offset_in_zone) 497 - { 498 - if (zno < disk->nr_zones - 1) 499 - return offset_in_zone >= disk->zone_capacity; 500 - return offset_in_zone >= disk->last_zone_capacity; 501 - } 502 - 503 495 static bool disk_zone_wplug_is_full(struct gendisk *disk, 504 496 struct blk_zone_wplug *zwplug) 505 497 { 506 - return disk_zone_is_full(disk, zwplug->zone_no, zwplug->wp_offset); 498 + if (zwplug->zone_no < disk->nr_zones - 1) 499 + return zwplug->wp_offset >= disk->zone_capacity; 500 + return zwplug->wp_offset >= disk->last_zone_capacity; 507 501 } 508 502 509 503 static bool disk_insert_zone_wplug(struct gendisk *disk,