--- 1.96/drivers/scsi/sr.c Mon Jan 19 07:28:35 2004 +++ edited/drivers/scsi/sr.c Thu Jan 22 14:12:22 2004 @@ -55,6 +55,24 @@ #include "scsi_logging.h" #include "sr.h" +/* + * Define this to see partitions on CDROM devices. + * + * With SD_PARTITIONS = 7 you'll have the following devices: + * + * sr0 - first CDROM, whole disk + * sr1 - first CDROM, first partition + * ... + * sr7 - first CDROM, seventh partition + * sr8 - second CDROM, whole disk + * sr9 - second CDROM, first partition + * ... + */ +/*#define SD_PARTITIONS 7*/ +#ifndef SD_PARTITIONS +#define SD_PARTITIONS 0 +#endif + MODULE_PARM(xa_test, "i"); /* see sr_ioctl.c */ @@ -518,7 +536,7 @@ goto fail; memset(cd, 0, sizeof(*cd)); - disk = alloc_disk(1); + disk = alloc_disk(SD_PARTITIONS+1); if (!disk) goto fail_free; @@ -533,7 +551,7 @@ spin_unlock(&sr_index_lock); disk->major = SCSI_CDROM_MAJOR; - disk->first_minor = minor; + disk->first_minor = minor * (SD_PARTITIONS+1); sprintf(disk->disk_name, "sr%d", minor); disk->fops = &sr_bdops; disk->flags = GENHD_FL_CD;