From: "Steven J. Hill" <sjhill@realitydiluted.com>
To: Jeremy Higdon <jeremy@sgi.com>
Cc: Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] 2.6.2, Partition support for SCSI CDROM...
Date: Tue, 24 Feb 2004 11:51:20 -0500 [thread overview]
Message-ID: <403B8108.6080606@realitydiluted.com> (raw)
In-Reply-To: <20040224061130.GC503530@sgi.com>
[-- Attachment #1: Type: text/plain, Size: 45 bytes --]
Here is the second try at the patch.
-Steve
[-- Attachment #2: scsi-sr-partitions-2.6.2-2.patch --]
[-- Type: text/x-patch, Size: 1402 bytes --]
diff -urN linux-2.6.2/drivers/scsi/sr.c linux-2.6.2-patched/drivers/scsi/sr.c
--- linux-2.6.2/drivers/scsi/sr.c 2004-02-22 20:15:08.000000000 -0500
+++ linux-2.6.2-patched/drivers/scsi/sr.c 2004-02-24 11:48:16.000000000 -0500
@@ -55,6 +55,23 @@
#include "scsi_logging.h"
#include "sr.h"
+/*
+ * Device node mappings are as follows:
+ *
+ * sr0 - first CDROM, whole disk
+ * sr1 - first CDROM, first partition
+ *
+ * [...]
+ *
+ * sr16 - first CDROM, sixteenth partition
+ * sr17 - second CDROM, whole disk
+ * sr18 - second CDROM, first partition
+ *
+ * [...]
+ */
+static int partitions = 16;
+MODULE_PARM(partitions, "i");
+MODULE_PARM_DESC(partitions, "number of SCSI CDROM partitions to support");
MODULE_PARM(xa_test, "i"); /* see sr_ioctl.c */
@@ -518,7 +535,7 @@
goto fail;
memset(cd, 0, sizeof(*cd));
- disk = alloc_disk(1);
+ disk = alloc_disk(partitions + 1);
if (!disk)
goto fail_free;
@@ -533,7 +550,7 @@
spin_unlock(&sr_index_lock);
disk->major = SCSI_CDROM_MAJOR;
- disk->first_minor = minor;
+ disk->first_minor = minor * (partitions + 1);
sprintf(disk->disk_name, "sr%d", minor);
disk->fops = &sr_bdops;
disk->flags = GENHD_FL_CD;
@@ -868,6 +885,10 @@
{
int rc;
+ /* Check number of partitions specified. */
+ if (partitions < 0)
+ partitions = 0;
+
rc = register_blkdev(SCSI_CDROM_MAJOR, "sr");
if (rc)
return rc;
next prev parent reply other threads:[~2004-02-24 16:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-23 2:11 [PATCH] 2.6.2, Partition support for SCSI CDROM Steven J. Hill
2004-02-23 3:00 ` Andrew Morton
2004-02-23 3:07 ` Steven J. Hill
2004-02-23 3:13 ` Andrew Morton
2004-02-24 6:11 ` Jeremy Higdon
2004-02-24 16:51 ` Steven J. Hill [this message]
2004-02-24 17:06 ` Christoph Hellwig
2004-02-26 22:51 ` Rusty Russell
2004-02-24 17:09 ` Matthew Wilcox
2004-02-25 1:58 ` Miles Bader
2004-02-25 10:19 ` Andries Brouwer
2004-02-27 3:22 ` Bill Davidsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=403B8108.6080606@realitydiluted.com \
--to=sjhill@realitydiluted.com \
--cc=akpm@osdl.org \
--cc=jeremy@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox