aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2008-08-25 06:56:16 -0400
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 02:56:08 -0400
commit689d6fac40b41c7bf154f362deaf442548e4dc81 (patch)
tree5989dc5767f657272194ee8c7d69c6db1e62dab7 /drivers/ide
parent540eed5637b766bb1e881ef744c42617760b4815 (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 'drivers/ide')
-rw-r--r--drivers/ide/ide-disk.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index a072df5053ae..29c8ae752683 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -41,16 +41,12 @@
41#include <asm/io.h> 41#include <asm/io.h>
42#include <asm/div64.h> 42#include <asm/div64.h>
43 43
44#define IDE_DISK_PARTS (1 << PARTN_BITS)
45
46#if !defined(CONFIG_DEBUG_BLOCK_EXT_DEVT) 44#if !defined(CONFIG_DEBUG_BLOCK_EXT_DEVT)
47#define IDE_DISK_MINORS IDE_DISK_PARTS 45#define IDE_DISK_MINORS (1 << PARTN_BITS)
48#else 46#else
49#define IDE_DISK_MINORS 1 47#define IDE_DISK_MINORS 1
50#endif 48#endif
51 49
52#define IDE_DISK_EXT_MINORS (IDE_DISK_PARTS - IDE_DISK_MINORS)
53
54struct ide_disk_obj { 50struct ide_disk_obj {
55 ide_drive_t *drive; 51 ide_drive_t *drive;
56 ide_driver_t *driver; 52 ide_driver_t *driver;
@@ -1161,8 +1157,7 @@ static int ide_disk_probe(ide_drive_t *drive)
1161 if (!idkp) 1157 if (!idkp)
1162 goto failed; 1158 goto failed;
1163 1159
1164 g = alloc_disk_ext_node(IDE_DISK_MINORS, IDE_DISK_EXT_MINORS, 1160 g = alloc_disk_node(IDE_DISK_MINORS, hwif_to_node(drive->hwif));
1165 hwif_to_node(drive->hwif));
1166 if (!g) 1161 if (!g)
1167 goto out_free_idkp; 1162 goto out_free_idkp;
1168 1163
@@ -1189,9 +1184,10 @@ static int ide_disk_probe(ide_drive_t *drive)
1189 drive->attach = 1; 1184 drive->attach = 1;
1190 1185
1191 g->minors = IDE_DISK_MINORS; 1186 g->minors = IDE_DISK_MINORS;
1192 g->ext_minors = IDE_DISK_EXT_MINORS;
1193 g->driverfs_dev = &drive->gendev; 1187 g->driverfs_dev = &drive->gendev;
1194 g->flags = drive->removable ? GENHD_FL_REMOVABLE : 0; 1188 g->flags |= GENHD_FL_EXT_DEVT;
1189 if (drive->removable)
1190 g->flags |= GENHD_FL_REMOVABLE;
1195 set_capacity(g, idedisk_capacity(drive)); 1191 set_capacity(g, idedisk_capacity(drive));
1196 g->fops = &idedisk_ops; 1192 g->fops = &idedisk_ops;
1197 add_disk(g); 1193 add_disk(g);