]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
block: remove disk_zone_is_full()
authorDamien Le Moal <dlemoal@kernel.org>
Fri, 27 Feb 2026 13:19:47 +0000 (22:19 +0900)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 Mar 2026 20:30:00 +0000 (14:30 -0600)
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>
block/blk-zoned.c

index 185651a0d6173a8b8108f6623a7d144f90a0ed91..26c2aa79faf625d11d436267b5287723f79eee30 100644 (file)
@@ -492,18 +492,12 @@ static bool disk_zone_is_last(struct gendisk *disk, struct blk_zone *zone)
        return zone->start + zone->len >= get_capacity(disk);
 }
 
-static bool disk_zone_is_full(struct gendisk *disk,
-                             unsigned int zno, unsigned int offset_in_zone)
-{
-       if (zno < disk->nr_zones - 1)
-               return offset_in_zone >= disk->zone_capacity;
-       return offset_in_zone >= disk->last_zone_capacity;
-}
-
 static bool disk_zone_wplug_is_full(struct gendisk *disk,
                                    struct blk_zone_wplug *zwplug)
 {
-       return disk_zone_is_full(disk, zwplug->zone_no, zwplug->wp_offset);
+       if (zwplug->zone_no < disk->nr_zones - 1)
+               return zwplug->wp_offset >= disk->zone_capacity;
+       return zwplug->wp_offset >= disk->last_zone_capacity;
 }
 
 static bool disk_insert_zone_wplug(struct gendisk *disk,