summaryrefslogtreecommitdiff
path: root/include/linux/genhd.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/genhd.h')
-rw-r--r--include/linux/genhd.h27
1 files changed, 9 insertions, 18 deletions
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 0b48a0cf4262..690b7f7996d1 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -60,24 +60,15 @@ struct partition_meta_info {
* (``BLOCK_EXT_MAJOR``).
* This affects the maximum number of partitions.
*
- * ``GENHD_FL_NATIVE_CAPACITY`` (0x0080): based on information in the
- * partition table, the device's capacity has been extended to its
- * native capacity; i.e. the device has hidden capacity used by one
- * of the partitions (this is a flag used so that native capacity is
- * only ever unlocked once).
- *
- * ``GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE`` (0x0100): event polling is
- * blocked whenever a writer holds an exclusive lock.
- *
- * ``GENHD_FL_NO_PART_SCAN`` (0x0200): partition scanning is disabled.
- * Used for loop devices in their default settings and some MMC
- * devices.
+ * ``GENHD_FL_NO_PART`` (0x0200): partition support is disabled.
+ * The kernel will not scan for partitions from add_disk, and users
+ * can't add partitions manually.
*
* ``GENHD_FL_HIDDEN`` (0x0400): the block device is hidden; it
* doesn't produce events, doesn't appear in sysfs, and doesn't have
* an associated ``bdev``.
* Implies ``GENHD_FL_SUPPRESS_PARTITION_INFO`` and
- * ``GENHD_FL_NO_PART_SCAN``.
+ * ``GENHD_FL_NO_PART``.
* Used for multipath devices.
*/
#define GENHD_FL_REMOVABLE 0x0001
@@ -86,9 +77,7 @@ struct partition_meta_info {
#define GENHD_FL_CD 0x0008
#define GENHD_FL_SUPPRESS_PARTITION_INFO 0x0020
#define GENHD_FL_EXT_DEVT 0x0040
-#define GENHD_FL_NATIVE_CAPACITY 0x0080
-#define GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE 0x0100
-#define GENHD_FL_NO_PART_SCAN 0x0200
+#define GENHD_FL_NO_PART 0x0200
#define GENHD_FL_HIDDEN 0x0400
enum {
@@ -101,6 +90,8 @@ enum {
DISK_EVENT_FLAG_POLL = 1 << 0,
/* Forward events to udev */
DISK_EVENT_FLAG_UEVENT = 1 << 1,
+ /* Block event polling when open for exclusive write */
+ DISK_EVENT_FLAG_BLOCK_ON_EXCL_WRITE = 1 << 2,
};
struct disk_events;
@@ -140,6 +131,7 @@ struct gendisk {
#define GD_NEED_PART_SCAN 0
#define GD_READ_ONLY 1
#define GD_DEAD 2
+#define GD_NATIVE_CAPACITY 3
struct mutex open_mutex; /* open/close mutex */
unsigned open_partitions; /* number of open partitions */
@@ -193,8 +185,7 @@ static inline int disk_max_parts(struct gendisk *disk)
static inline bool disk_part_scan_enabled(struct gendisk *disk)
{
- return disk_max_parts(disk) > 1 &&
- !(disk->flags & GENHD_FL_NO_PART_SCAN);
+ return disk_max_parts(disk) > 1 && !(disk->flags & GENHD_FL_NO_PART);
}
static inline dev_t disk_devt(struct gendisk *disk)