Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211122130625.1136848-11-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
3b5149ac 79b0f79a

+4 -16
+3 -8
block/genhd.c
··· 496 496 497 497 if (disk->flags & GENHD_FL_HIDDEN) { 498 498 /* 499 - * Don't let hidden disks show up in /proc/partitions, 500 - * and don't bother scanning for partitions either. 499 + * Don't bother scanning for partitions. 501 500 */ 502 - disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO; 503 501 disk->flags |= GENHD_FL_NO_PART; 504 502 } else { 505 503 ret = bdi_register(disk->bdi, "%u:%u", ··· 723 725 * Don't show empty devices or things that have been 724 726 * suppressed 725 727 */ 726 - if (get_capacity(disk) == 0 || 727 - (disk->flags & GENHD_FL_SUPPRESS_PARTITION_INFO)) 728 + if (get_capacity(disk) == 0 || (disk->flags & GENHD_FL_HIDDEN)) 728 729 continue; 729 730 730 731 /* ··· 816 819 struct block_device *part; 817 820 unsigned long idx; 818 821 819 - if (!get_capacity(sgp)) 820 - return 0; 821 - if (sgp->flags & GENHD_FL_SUPPRESS_PARTITION_INFO) 822 + if (!get_capacity(sgp) || (sgp->flags & GENHD_FL_HIDDEN)) 822 823 return 0; 823 824 824 825 rcu_read_lock();
+1 -8
include/linux/genhd.h
··· 46 46 * Must not be set for devices which are removed entirely when the 47 47 * media is removed. 48 48 * 49 - * ``GENHD_FL_SUPPRESS_PARTITION_INFO`` (0x0020): don't include 50 - * partition information in ``/proc/partitions`` or in the output of 51 - * printk_all_partitions(). 52 - * Used for the null block device and some MMC devices. 53 - * 54 49 * ``GENHD_FL_EXT_DEVT`` (0x0040): the driver supports extended 55 50 * dynamic ``dev_t``, i.e. it wants extended device numbers 56 51 * (``BLOCK_EXT_MAJOR``). ··· 58 63 * ``GENHD_FL_HIDDEN`` (0x0400): the block device is hidden; it 59 64 * doesn't produce events, doesn't appear in sysfs, and doesn't have 60 65 * an associated ``bdev``. 61 - * Implies ``GENHD_FL_SUPPRESS_PARTITION_INFO`` and 62 - * ``GENHD_FL_NO_PART``. 66 + * Implies ``GENHD_FL_NO_PART``. 63 67 * Used for multipath devices. 64 68 */ 65 69 #define GENHD_FL_REMOVABLE 0x0001 66 70 /* 2 is unused (used to be GENHD_FL_DRIVERFS) */ 67 71 /* 4 is unused (used to be GENHD_FL_MEDIA_CHANGE_NOTIFY) */ 68 - #define GENHD_FL_SUPPRESS_PARTITION_INFO 0x0020 69 72 #define GENHD_FL_EXT_DEVT 0x0040 70 73 #define GENHD_FL_NO_PART 0x0200 71 74 #define GENHD_FL_HIDDEN 0x0400