block: rename GENHD_FL_NO_PART_SCAN to GENHD_FL_NO_PART
[ Upstream commit46e7eac647
] The GENHD_FL_NO_PART_SCAN controls more than just partitions canning, so rename it to GENHD_FL_NO_PART. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Link: https://lore.kernel.org/r/20211122130625.1136848-7-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk> Stable-dep-of:1a721de848
("block: don't add or resize partition on the disk with GENHD_FL_NO_PART") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Родитель
6c06a7f6b4
Коммит
c6ce1c5dd3
|
@ -495,7 +495,7 @@ int device_add_disk(struct device *parent, struct gendisk *disk,
|
||||||
* and don't bother scanning for partitions either.
|
* and don't bother scanning for partitions either.
|
||||||
*/
|
*/
|
||||||
disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
|
disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
|
||||||
disk->flags |= GENHD_FL_NO_PART_SCAN;
|
disk->flags |= GENHD_FL_NO_PART;
|
||||||
} else {
|
} else {
|
||||||
ret = bdi_register(disk->bdi, "%u:%u",
|
ret = bdi_register(disk->bdi, "%u:%u",
|
||||||
disk->major, disk->first_minor);
|
disk->major, disk->first_minor);
|
||||||
|
|
|
@ -1314,7 +1314,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
|
||||||
lo->lo_flags |= LO_FLAGS_PARTSCAN;
|
lo->lo_flags |= LO_FLAGS_PARTSCAN;
|
||||||
partscan = lo->lo_flags & LO_FLAGS_PARTSCAN;
|
partscan = lo->lo_flags & LO_FLAGS_PARTSCAN;
|
||||||
if (partscan)
|
if (partscan)
|
||||||
lo->lo_disk->flags &= ~GENHD_FL_NO_PART_SCAN;
|
lo->lo_disk->flags &= ~GENHD_FL_NO_PART;
|
||||||
|
|
||||||
/* enable and uncork uevent now that we are done */
|
/* enable and uncork uevent now that we are done */
|
||||||
dev_set_uevent_suppress(disk_to_dev(lo->lo_disk), 0);
|
dev_set_uevent_suppress(disk_to_dev(lo->lo_disk), 0);
|
||||||
|
@ -1463,7 +1463,7 @@ out_unlock:
|
||||||
mutex_lock(&lo->lo_mutex);
|
mutex_lock(&lo->lo_mutex);
|
||||||
lo->lo_flags = 0;
|
lo->lo_flags = 0;
|
||||||
if (!part_shift)
|
if (!part_shift)
|
||||||
lo->lo_disk->flags |= GENHD_FL_NO_PART_SCAN;
|
lo->lo_disk->flags |= GENHD_FL_NO_PART;
|
||||||
lo->lo_state = Lo_unbound;
|
lo->lo_state = Lo_unbound;
|
||||||
mutex_unlock(&lo->lo_mutex);
|
mutex_unlock(&lo->lo_mutex);
|
||||||
|
|
||||||
|
@ -1580,7 +1580,7 @@ out_unfreeze:
|
||||||
|
|
||||||
if (!err && (lo->lo_flags & LO_FLAGS_PARTSCAN) &&
|
if (!err && (lo->lo_flags & LO_FLAGS_PARTSCAN) &&
|
||||||
!(prev_lo_flags & LO_FLAGS_PARTSCAN)) {
|
!(prev_lo_flags & LO_FLAGS_PARTSCAN)) {
|
||||||
lo->lo_disk->flags &= ~GENHD_FL_NO_PART_SCAN;
|
lo->lo_disk->flags &= ~GENHD_FL_NO_PART;
|
||||||
partscan = true;
|
partscan = true;
|
||||||
}
|
}
|
||||||
out_unlock:
|
out_unlock:
|
||||||
|
@ -2410,7 +2410,7 @@ static int loop_add(int i)
|
||||||
* userspace tools. Parameters like this in general should be avoided.
|
* userspace tools. Parameters like this in general should be avoided.
|
||||||
*/
|
*/
|
||||||
if (!part_shift)
|
if (!part_shift)
|
||||||
disk->flags |= GENHD_FL_NO_PART_SCAN;
|
disk->flags |= GENHD_FL_NO_PART;
|
||||||
disk->flags |= GENHD_FL_EXT_DEVT;
|
disk->flags |= GENHD_FL_EXT_DEVT;
|
||||||
atomic_set(&lo->lo_refcnt, 0);
|
atomic_set(&lo->lo_refcnt, 0);
|
||||||
mutex_init(&lo->lo_mutex);
|
mutex_init(&lo->lo_mutex);
|
||||||
|
|
|
@ -137,7 +137,7 @@ static int __init n64cart_probe(struct platform_device *pdev)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
disk->first_minor = 0;
|
disk->first_minor = 0;
|
||||||
disk->flags = GENHD_FL_NO_PART_SCAN;
|
disk->flags = GENHD_FL_NO_PART;
|
||||||
disk->fops = &n64cart_fops;
|
disk->fops = &n64cart_fops;
|
||||||
disk->private_data = &pdev->dev;
|
disk->private_data = &pdev->dev;
|
||||||
strcpy(disk->disk_name, "n64cart");
|
strcpy(disk->disk_name, "n64cart");
|
||||||
|
|
|
@ -2447,8 +2447,8 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
|
||||||
set_disk_ro(md->disk, md->read_only || default_ro);
|
set_disk_ro(md->disk, md->read_only || default_ro);
|
||||||
md->disk->flags = GENHD_FL_EXT_DEVT;
|
md->disk->flags = GENHD_FL_EXT_DEVT;
|
||||||
if (area_type & (MMC_BLK_DATA_AREA_RPMB | MMC_BLK_DATA_AREA_BOOT))
|
if (area_type & (MMC_BLK_DATA_AREA_RPMB | MMC_BLK_DATA_AREA_BOOT))
|
||||||
md->disk->flags |= GENHD_FL_NO_PART_SCAN
|
md->disk->flags |= GENHD_FL_NO_PART |
|
||||||
| GENHD_FL_SUPPRESS_PARTITION_INFO;
|
GENHD_FL_SUPPRESS_PARTITION_INFO;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* As discussed on lkml, GENHD_FL_REMOVABLE should:
|
* As discussed on lkml, GENHD_FL_REMOVABLE should:
|
||||||
|
|
|
@ -60,15 +60,15 @@ struct partition_meta_info {
|
||||||
* (``BLOCK_EXT_MAJOR``).
|
* (``BLOCK_EXT_MAJOR``).
|
||||||
* This affects the maximum number of partitions.
|
* This affects the maximum number of partitions.
|
||||||
*
|
*
|
||||||
* ``GENHD_FL_NO_PART_SCAN`` (0x0200): partition scanning is disabled.
|
* ``GENHD_FL_NO_PART`` (0x0200): partition support is disabled.
|
||||||
* Used for loop devices in their default settings and some MMC
|
* The kernel will not scan for partitions from add_disk, and users
|
||||||
* devices.
|
* can't add partitions manually.
|
||||||
*
|
*
|
||||||
* ``GENHD_FL_HIDDEN`` (0x0400): the block device is hidden; it
|
* ``GENHD_FL_HIDDEN`` (0x0400): the block device is hidden; it
|
||||||
* doesn't produce events, doesn't appear in sysfs, and doesn't have
|
* doesn't produce events, doesn't appear in sysfs, and doesn't have
|
||||||
* an associated ``bdev``.
|
* an associated ``bdev``.
|
||||||
* Implies ``GENHD_FL_SUPPRESS_PARTITION_INFO`` and
|
* Implies ``GENHD_FL_SUPPRESS_PARTITION_INFO`` and
|
||||||
* ``GENHD_FL_NO_PART_SCAN``.
|
* ``GENHD_FL_NO_PART``.
|
||||||
* Used for multipath devices.
|
* Used for multipath devices.
|
||||||
*/
|
*/
|
||||||
#define GENHD_FL_REMOVABLE 0x0001
|
#define GENHD_FL_REMOVABLE 0x0001
|
||||||
|
@ -77,7 +77,7 @@ struct partition_meta_info {
|
||||||
#define GENHD_FL_CD 0x0008
|
#define GENHD_FL_CD 0x0008
|
||||||
#define GENHD_FL_SUPPRESS_PARTITION_INFO 0x0020
|
#define GENHD_FL_SUPPRESS_PARTITION_INFO 0x0020
|
||||||
#define GENHD_FL_EXT_DEVT 0x0040
|
#define GENHD_FL_EXT_DEVT 0x0040
|
||||||
#define GENHD_FL_NO_PART_SCAN 0x0200
|
#define GENHD_FL_NO_PART 0x0200
|
||||||
#define GENHD_FL_HIDDEN 0x0400
|
#define GENHD_FL_HIDDEN 0x0400
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -185,8 +185,7 @@ static inline int disk_max_parts(struct gendisk *disk)
|
||||||
|
|
||||||
static inline bool disk_part_scan_enabled(struct gendisk *disk)
|
static inline bool disk_part_scan_enabled(struct gendisk *disk)
|
||||||
{
|
{
|
||||||
return disk_max_parts(disk) > 1 &&
|
return disk_max_parts(disk) > 1 && !(disk->flags & GENHD_FL_NO_PART);
|
||||||
!(disk->flags & GENHD_FL_NO_PART_SCAN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline dev_t disk_devt(struct gendisk *disk)
|
static inline dev_t disk_devt(struct gendisk *disk)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче