Re: [PATCH] block: remove bdev_nonrot()

Damien Le Moal
2026-02-26T12:27:24Z

On 2/26/26 19:04, Paul Menzel wrote:
> Dear Damien,
>
>
> Thank you for your patch.
>
>
> Am 26.02.26 um 08:54 schrieb Damien Le Moal:
>> bdev_nonrot() is simply the negative return value of bdev_rot().
>> So replace all call sites of bdev_nonrot() with calls to bdev_rot()
>> and remove bdev_nonrot().
>
> Is the generated code different now?

I did not check but I doubt there is any difference at all.

This is more about having a single helper function for bdevs that is consistent
with the helper for request queues (blk_queue_rot()) which directly reflects the
setting of a block device BLK_FEAT_ROTATIONAL queue feature. This way is also in
my opinion simpler as you do not get your brain overheating when seeing things
like "!bdev_nonrot()" :)
> Is it worth the change, as it looks quite subjective if you prefer the
> one or the other way?

I think it is a nice cleanup, but I will let Jens and other maintainers decide
on the worth of this patch.

> My point above aside, the diff looks good.
>
> Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>

Thanks.

--
Damien Le Moal
Western Digital Research