block: add a disk_has_partscan helper
authorChristoph Hellwig <hch@lst.de>
Thu, 2 May 2024 13:00:32 +0000 (15:00 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 3 May 2024 14:59:59 +0000 (08:59 -0600)
commit140ce28dd3bee8e53acc27f123ae474d69ef66f0
treebadd9cf1f719edebd6757cadf433821b0e93889a
parentd0487577e6e0b640d71375a6ec2f9e8a2d3555f2
block: add a disk_has_partscan helper

Add a helper to check if partition scanning is enabled instead of
open coding the check in a few places.  This now always checks for
the hidden flag even if all but one of the callers are never reachable
for hidden gendisks.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240502130033.1958492-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/genhd.c
block/partitions/core.c
include/linux/blkdev.h