On 10/21/19 11:36 AM, Johannes Thumshirn wrote:
On 21/10/2019 11:27, Guoqing Jiang wrote:
static void bdev_disk_changed(struct block_device *bdev, bool
invalidate)
{
- if (invalidate)
- invalidate_partitions(bdev->bd_disk, bdev);
- else
- rescan_partitions(bdev->bd_disk, bdev);
+ if (disk_part_scan_enabled(bdev->bd_disk)) {
+ if (invalidate)
+ invalidate_partitions(bdev->bd_disk, bdev);
+ else
+ rescan_partitions(bdev->bd_disk, bdev);
Maybe use the new common helper to replace above.
What do you mean exactly? Because there's only this place that has the
code
pattern here...
The above looks same as the new function.
The above is changed in the new bdev_disk_changed() function. Patch 1/2
factors out the pattern and this patch changes the behaviour
Oops, yes, sorry for the noise.
Thanks,
Guoqing