Skip to content

Commit c30e8c4

Browse files
damien-lemoalaxboe
authored andcommitted
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 <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 1084e41 commit c30e8c4

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

block/blk-zoned.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -492,18 +492,12 @@ static bool disk_zone_is_last(struct gendisk *disk, struct blk_zone *zone)
492492
return zone->start + zone->len >= get_capacity(disk);
493493
}
494494

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-
503495
static bool disk_zone_wplug_is_full(struct gendisk *disk,
504496
struct blk_zone_wplug *zwplug)
505497
{
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;
507501
}
508502

509503
static bool disk_insert_zone_wplug(struct gendisk *disk,

0 commit comments

Comments
 (0)