On Fri, Apr 21, 2023 at 01:31:01PM +0900, Damien Le Moal wrote: > The code for setting a block device capacity (bd_nr_sectors field of > struct block_device) is duplicated in set_capacity() and > bdev_set_nr_sectors(). Clean this up by turning set_capacity() into an > inline function calling bdev_set_nr_sectors() and move > bdev_set_nr_sectors() code to block/bdev.c instead of having this > function in block/partitions/core.c. I don't think bdev_set_nr_sectors should be exported. So given that all this is a slow path anyway, please keep set_capacity out of line as well and don't export bdev_set_nr_sectors.