Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110480
b: refs/heads/master
c: f615b48
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Oct 9, 2008
1 parent e25887a commit 19843cd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1f0142905d4812966831613847db38a66da29eb8
refs/heads/master: f615b48cc7df7cac3865ec76ac1a5bb04d3e07f4
11 changes: 8 additions & 3 deletions trunk/drivers/ide/ide-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand All @@ -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));
Expand Down
9 changes: 7 additions & 2 deletions trunk/drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ MODULE_ALIAS_SCSI_DEVICE(TYPE_DISK);
MODULE_ALIAS_SCSI_DEVICE(TYPE_MOD);
MODULE_ALIAS_SCSI_DEVICE(TYPE_RBC);

#define SD_PARTS 64
#define SD_MINORS 16
#define SD_EXT_MINORS (SD_PARTS - SD_MINORS)

static int sd_revalidate_disk(struct gendisk *);
static int sd_probe(struct device *);
static int sd_remove(struct device *);
Expand Down Expand Up @@ -1801,7 +1805,7 @@ static int sd_probe(struct device *dev)
if (!sdkp)
goto out;

gd = alloc_disk(16);
gd = alloc_disk_ext(SD_MINORS, SD_EXT_MINORS);
if (!gd)
goto out_free;

Expand Down Expand Up @@ -1845,7 +1849,8 @@ static int sd_probe(struct device *dev)

gd->major = sd_major((index & 0xf0) >> 4);
gd->first_minor = ((index & 0xf) << 4) | (index & 0xfff00);
gd->minors = 16;
gd->minors = SD_MINORS;
gd->ext_minors = SD_EXT_MINORS;
gd->fops = &sd_fops;

if (index < 26) {
Expand Down

0 comments on commit 19843cd

Please sign in to comment.