On 5/30/24 16:37, Niklas Cassel wrote:
[...]

>> +static bool disk_zone_is_full(struct gendisk *disk,
>> +                          unsigned int zno, unsigned int offset_in_zone)
> 
> Why not just call the third parameter wp?

Because it does not have to be a plug write pointer. And even then, zone write
plugging uses offset in a zone as write pointer values :)

[...]

>>  static void disk_remove_zone_wplug(struct gendisk *disk,
>> @@ -669,13 +683,12 @@ static void disk_zone_wplug_abort(struct 
>> blk_zone_wplug *zwplug)
>>  static void disk_zone_wplug_abort_unaligned(struct gendisk *disk,
>>                                          struct blk_zone_wplug *zwplug)
>>  {
>> -    unsigned int zone_capacity = disk->zone_capacity;
>>      unsigned int wp_offset = zwplug->wp_offset;
>>      struct bio_list bl = BIO_EMPTY_LIST;
>>      struct bio *bio;
>>  
>>      while ((bio = bio_list_pop(&zwplug->bio_list))) {
>> -            if (wp_offset >= zone_capacity ||
>> +            if (disk_zone_is_full(disk, zwplug->zone_no, wp_offset) ||
> 
> Why don't you use disk_zone_wplug_is_full() here?

Because this function does not modify the zone write plug write offset. So we
cannot use it.



-- 
Damien Le Moal
Western Digital Research


Reply via email to