[dm-devel] [PATCH 02/11] block: introduce bio zone helpers

Damien Le Moal Damien.LeMoal at wdc.com
Wed May 19 08:27:39 UTC 2021


On 2021/05/19 16:42, Chaitanya Kulkarni wrote:
>> On May 19, 2021, at 12:17 AM, Johannes Thumshirn <Johannes.Thumshirn at wdc.com> wrote:
>>
>> On 19/05/2021 04:56, Damien Le Moal wrote:
>>> +static inline unsigned int bio_zone_no(struct request_queue *q,
>>> +                       struct bio *bio)
>>> +{
>>> +    return blk_queue_zone_no(q, bio->bi_iter.bi_sector);
>>> +}
>>> +
>>> +static inline unsigned int bio_zone_is_seq(struct request_queue *q,
>>> +                       struct bio *bio)
>>> +{
>>> +    return blk_queue_zone_is_seq(q, bio->bi_iter.bi_sector);
>>> +}
>>> +
>>
>> Can't we derive the queue from the bio via bio->bi_bdev->bd_disk->queue
>> or would this be too much pointer chasing for a small helper like this?
> 
> We have made such code changes to get rid of separate argument q and derive it from bio for block trace cleanup. Unless there is a strong reason (such as q is not available in this call which I have not looked into), we should avoid passing q as separate argument. 

Will fix that in v2.

-- 
Damien Le Moal
Western Digital Research




More information about the dm-devel mailing list