Commit 3b5149ac authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: remove GENHD_FL_SUPPRESS_PARTITION_INFO

This flag is not set directly anywhere and only inherited from
GENHD_FL_HIDDEN.  Just check for GENHD_FL_HIDDEN instead.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211122130625.1136848-11-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 79b0f79a
...@@ -496,10 +496,8 @@ int __must_check device_add_disk(struct device *parent, struct gendisk *disk, ...@@ -496,10 +496,8 @@ int __must_check device_add_disk(struct device *parent, struct gendisk *disk,
if (disk->flags & GENHD_FL_HIDDEN) { if (disk->flags & GENHD_FL_HIDDEN) {
/* /*
* Don't let hidden disks show up in /proc/partitions, * Don't bother scanning for partitions.
* and don't bother scanning for partitions either.
*/ */
disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
disk->flags |= GENHD_FL_NO_PART; disk->flags |= GENHD_FL_NO_PART;
} else { } else {
ret = bdi_register(disk->bdi, "%u:%u", ret = bdi_register(disk->bdi, "%u:%u",
...@@ -725,8 +723,7 @@ void __init printk_all_partitions(void) ...@@ -725,8 +723,7 @@ void __init printk_all_partitions(void)
* Don't show empty devices or things that have been * Don't show empty devices or things that have been
* suppressed * suppressed
*/ */
if (get_capacity(disk) == 0 || if (get_capacity(disk) == 0 || (disk->flags & GENHD_FL_HIDDEN))
(disk->flags & GENHD_FL_SUPPRESS_PARTITION_INFO))
continue; continue;
/* /*
...@@ -819,9 +816,7 @@ static int show_partition(struct seq_file *seqf, void *v) ...@@ -819,9 +816,7 @@ static int show_partition(struct seq_file *seqf, void *v)
struct block_device *part; struct block_device *part;
unsigned long idx; unsigned long idx;
if (!get_capacity(sgp)) if (!get_capacity(sgp) || (sgp->flags & GENHD_FL_HIDDEN))
return 0;
if (sgp->flags & GENHD_FL_SUPPRESS_PARTITION_INFO)
return 0; return 0;
rcu_read_lock(); rcu_read_lock();
......
...@@ -46,11 +46,6 @@ struct partition_meta_info { ...@@ -46,11 +46,6 @@ struct partition_meta_info {
* Must not be set for devices which are removed entirely when the * Must not be set for devices which are removed entirely when the
* media is removed. * media is removed.
* *
* ``GENHD_FL_SUPPRESS_PARTITION_INFO`` (0x0020): don't include
* partition information in ``/proc/partitions`` or in the output of
* printk_all_partitions().
* Used for the null block device and some MMC devices.
*
* ``GENHD_FL_EXT_DEVT`` (0x0040): the driver supports extended * ``GENHD_FL_EXT_DEVT`` (0x0040): the driver supports extended
* dynamic ``dev_t``, i.e. it wants extended device numbers * dynamic ``dev_t``, i.e. it wants extended device numbers
* (``BLOCK_EXT_MAJOR``). * (``BLOCK_EXT_MAJOR``).
...@@ -63,14 +58,12 @@ struct partition_meta_info { ...@@ -63,14 +58,12 @@ struct partition_meta_info {
* ``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_NO_PART``.
* ``GENHD_FL_NO_PART``.
* Used for multipath devices. * Used for multipath devices.
*/ */
#define GENHD_FL_REMOVABLE 0x0001 #define GENHD_FL_REMOVABLE 0x0001
/* 2 is unused (used to be GENHD_FL_DRIVERFS) */ /* 2 is unused (used to be GENHD_FL_DRIVERFS) */
/* 4 is unused (used to be GENHD_FL_MEDIA_CHANGE_NOTIFY) */ /* 4 is unused (used to be GENHD_FL_MEDIA_CHANGE_NOTIFY) */
#define GENHD_FL_SUPPRESS_PARTITION_INFO 0x0020
#define GENHD_FL_EXT_DEVT 0x0040 #define GENHD_FL_EXT_DEVT 0x0040
#define GENHD_FL_NO_PART 0x0200 #define GENHD_FL_NO_PART 0x0200
#define GENHD_FL_HIDDEN 0x0400 #define GENHD_FL_HIDDEN 0x0400
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment