diff options
author | Tejun Heo <tj@kernel.org> | 2008-08-25 06:56:16 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-10-09 02:56:08 -0400 |
commit | 689d6fac40b41c7bf154f362deaf442548e4dc81 (patch) | |
tree | 5989dc5767f657272194ee8c7d69c6db1e62dab7 /include | |
parent | 540eed5637b766bb1e881ef744c42617760b4815 (diff) |
block: replace @ext_minors with GENHD_FL_EXT_DEVT
With previous changes, it's meaningless to limit the number of
partitions. Replace @ext_minors with GENHD_FL_EXT_DEVT such that
setting the flag allows the disk to have maximum number of allowed
partitions (only limited by the number of entries in parsed_partitions
as determined by MAX_PART constant).
This kills not-too-pretty alloc_disk_ext[_node]() functions and makes
@minors parameter to alloc_disk[_node]() unnecessary. The parameter
is left alone to avoid disturbing the users.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/genhd.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index ecf649c3deed..04524c213de1 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -58,6 +58,8 @@ enum { | |||
58 | UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */ | 58 | UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */ |
59 | }; | 59 | }; |
60 | 60 | ||
61 | #define DISK_MAX_PARTS 256 | ||
62 | |||
61 | #include <linux/major.h> | 63 | #include <linux/major.h> |
62 | #include <linux/device.h> | 64 | #include <linux/device.h> |
63 | #include <linux/smp.h> | 65 | #include <linux/smp.h> |
@@ -112,6 +114,7 @@ struct hd_struct { | |||
112 | #define GENHD_FL_CD 8 | 114 | #define GENHD_FL_CD 8 |
113 | #define GENHD_FL_UP 16 | 115 | #define GENHD_FL_UP 16 |
114 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 | 116 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 |
117 | #define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ | ||
115 | 118 | ||
116 | #define BLK_SCSI_MAX_CMDS (256) | 119 | #define BLK_SCSI_MAX_CMDS (256) |
117 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) | 120 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) |
@@ -129,15 +132,13 @@ struct disk_part_tbl { | |||
129 | }; | 132 | }; |
130 | 133 | ||
131 | struct gendisk { | 134 | struct gendisk { |
132 | /* major, first_minor, minors and ext_minors are input | 135 | /* major, first_minor and minors are input parameters only, |
133 | * parameters only, don't use directly. Use disk_devt() and | 136 | * don't use directly. Use disk_devt() and disk_max_parts(). |
134 | * disk_max_parts(). | ||
135 | */ | 137 | */ |
136 | int major; /* major number of driver */ | 138 | int major; /* major number of driver */ |
137 | int first_minor; | 139 | int first_minor; |
138 | int minors; /* maximum number of minors, =1 for | 140 | int minors; /* maximum number of minors, =1 for |
139 | * disks that can't be partitioned. */ | 141 | * disks that can't be partitioned. */ |
140 | int ext_minors; /* number of extended dynamic minors */ | ||
141 | 142 | ||
142 | char disk_name[32]; /* name of major driver */ | 143 | char disk_name[32]; /* name of major driver */ |
143 | 144 | ||
@@ -180,7 +181,9 @@ static inline struct gendisk *part_to_disk(struct hd_struct *part) | |||
180 | 181 | ||
181 | static inline int disk_max_parts(struct gendisk *disk) | 182 | static inline int disk_max_parts(struct gendisk *disk) |
182 | { | 183 | { |
183 | return disk->minors + disk->ext_minors; | 184 | if (disk->flags & GENHD_FL_EXT_DEVT) |
185 | return DISK_MAX_PARTS; | ||
186 | return disk->minors; | ||
184 | } | 187 | } |
185 | 188 | ||
186 | static inline bool disk_partitionable(struct gendisk *disk) | 189 | static inline bool disk_partitionable(struct gendisk *disk) |
@@ -527,9 +530,6 @@ extern void printk_all_partitions(void); | |||
527 | 530 | ||
528 | extern struct gendisk *alloc_disk_node(int minors, int node_id); | 531 | extern struct gendisk *alloc_disk_node(int minors, int node_id); |
529 | extern struct gendisk *alloc_disk(int minors); | 532 | extern struct gendisk *alloc_disk(int minors); |
530 | extern struct gendisk *alloc_disk_ext_node(int minors, int ext_minrs, | ||
531 | int node_id); | ||
532 | extern struct gendisk *alloc_disk_ext(int minors, int ext_minors); | ||
533 | extern struct kobject *get_disk(struct gendisk *disk); | 533 | extern struct kobject *get_disk(struct gendisk *disk); |
534 | extern void put_disk(struct gendisk *disk); | 534 | extern void put_disk(struct gendisk *disk); |
535 | extern void blk_register_region(dev_t devt, unsigned long range, | 535 | extern void blk_register_region(dev_t devt, unsigned long range, |