summaryrefslogtreecommitdiff
path: root/drivers/ide/ide-disk.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2008-08-25 19:47:24 +0900
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 08:56:06 +0200
commitf615b48cc7df7cac3865ec76ac1a5bb04d3e07f4 (patch)
treea61ba32641118296ecc942814e03b4b0ababfa63 /drivers/ide/ide-disk.c
parent1f0142905d4812966831613847db38a66da29eb8 (diff)
sd/ide-disk: apply extended minors to sd and ide
Update sd and ide-disk such that they can take advantage of extended minors. ide-disk already has 64 minors per device and currently doesn't use extended minors although after this patch it can be turned on by simply tweaking constants. sd only had 16 minors per device causing problems on certain peculiar configurations. This patch lifts the restriction and enables it to use upto 64 minors. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/ide/ide-disk.c')
-rw-r--r--drivers/ide/ide-disk.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 07ef88bd109b..7a88de9ada29 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -41,6 +41,10 @@
#include <asm/io.h>
#include <asm/div64.h>
+#define IDE_DISK_PARTS (1 << PARTN_BITS)
+#define IDE_DISK_MINORS IDE_DISK_PARTS
+#define IDE_DISK_EXT_MINORS (IDE_DISK_PARTS - IDE_DISK_MINORS)
+
struct ide_disk_obj {
ide_drive_t *drive;
ide_driver_t *driver;
@@ -1151,8 +1155,8 @@ static int ide_disk_probe(ide_drive_t *drive)
if (!idkp)
goto failed;
- g = alloc_disk_node(1 << PARTN_BITS,
- hwif_to_node(drive->hwif));
+ g = alloc_disk_ext_node(IDE_DISK_MINORS, IDE_DISK_EXT_MINORS,
+ hwif_to_node(drive->hwif));
if (!g)
goto out_free_idkp;
@@ -1178,7 +1182,8 @@ static int ide_disk_probe(ide_drive_t *drive)
} else
drive->attach = 1;
- g->minors = 1 << PARTN_BITS;
+ g->minors = IDE_DISK_MINORS;
+ g->ext_minors = IDE_DISK_EXT_MINORS;
g->driverfs_dev = &drive->gendev;
g->flags = drive->removable ? GENHD_FL_REMOVABLE : 0;
set_capacity(g, idedisk_capacity(drive));