From: Jens Axboe <axboe@suse.de>
To: John McKell <mckellj@iomega.com>
Cc: linux-scsi-@vger.kernel.org
Subject: Re: [PATCH] Allow random write for PDT 5 profile 2 Removable Disk
Date: Thu, 12 Feb 2004 12:10:07 +0100 [thread overview]
Message-ID: <20040212111007.GB26397@suse.de> (raw)
In-Reply-To: <1076536919.3112.149.camel@lintest.iomegacorp.com>
On Wed, Feb 11 2004, John McKell wrote:
> Jens,
>
> I see linux-2.6.2 extends the list of writable PDT x05 DVD/CD devices
> to include MRW, not just DVD-RAM and MO.
>
> With that change in place, this small further patch allows write
> through to PDT 0x05 DVD/CD for profile x0002 Removable Disk:
>
> a) if feature x0020 "Random Writable" present (no matter if current or
> not) at plug-in time, and...
>
> b) if feature x0024 "Hardware Defect Management" present (no matter if
> current or not) at plug-in time, and...
>
> c) if both features "current" at /dev/* open time (e.g., mount time),
> and ...
>
> d) the device in question is not any of MRW, MRW_W, DVD_RAM, CD_R,
> CD_RW, DVD, DVD_R
>
> Since 1999 MMC-2, MMC says these tests in combination say this device
> writes at random like DVD-RAM: no load balancing (aka wear leveling)
> required and blocks of the size the x0020 feature reports (64 KiB if
> like CD, 32 KiB if like DVD).
>
> This composite version of this patch includes the already posted
> patch:
>
> Subject:[PATCH] DVD-R capability flag set incorrectly, /proc
> formatting fix
> http://marc.theaimsgroup.com/?l=linux-scsi&m=107637086904512&w=2
>
> Please let me know if you'd rather have an incremental patch.
I need an incremental patch, your previous one is already included in
mainline BK tree.
A few small comments, only nitpicks (as the general patch looks fine).
Since you need to rediff it anyways, can you fix these up? Then it can
be submitted. Thanks!
> --- linux-2.6.2/include/linux/cdrom.h 2004-02-03 20:43:06.000000000 -0700
> +++ linux/include/linux/cdrom.h 2004-02-07 15:21:53.000000000 -0700
> @@ -721,7 +721,9 @@ struct request_sense {
> /*
> * feature profile
> */
> -#define CDF_MRW 0x28
> +#define CDF_RWRT 0x0020
> +#define CDF_HWDM 0x0024
> +#define CDF_MRW 0x0028
Tabs
> + if (!cdrom_is_random_writable(cdi, &ram_write)) {
> + if (ram_write) {
> + CDROM_CONFIG_FLAGS(drive)->ram = 1;
> + }
> + }
Brace styling
> if (cap.lock == 0)
> CDROM_CONFIG_FLAGS(drive)->no_doorlock = 1;
> if (cap.eject)
> --- linux-2.6.2/drivers/scsi/sr.c 2004-02-03 20:43:19.000000000 -0700
> +++ linux/drivers/scsi/sr.c 2004-02-10 16:39:23.000000000 -0700
> @@ -693,7 +693,7 @@ Enomem:
> static void get_capabilities(struct scsi_cd *cd)
> {
> unsigned char *buffer;
> - int rc, n, mrw_write = 0, mrw = 1;
> + int rc, n, mrw_write = 0, mrw = 1,ram_write=0;
> struct scsi_mode_data data;
> struct scsi_request *SRpnt;
> unsigned char cmd[MAX_COMMAND_SIZE];
> @@ -775,6 +775,12 @@ static void get_capabilities(struct scsi
> if (!mrw_write)
> cd->cdi.mask |= CDC_MRW_W;
>
> + if (cdrom_is_random_writable(&cd->cdi, &ram_write)) {
> + cd->cdi.mask |= CDC_RAM;
> + }
> + if (!ram_write)
> + cd->cdi.mask |= CDC_RAM;
Brace styling again
> --- linux-2.6.2/drivers/cdrom/cdrom.c 2004-02-05 14:30:46.000000000 -0700
> +++ linux/drivers/cdrom/cdrom.c 2004-02-11 11:14:23.995187637 -0700
> @@ -641,6 +641,80 @@ static int cdrom_mrw_set_lba_space(struc
> return 0;
> }
>
> +int cdrom_get_random_writable(struct cdrom_device_info *cdi,
> + struct rwrt_feature_desc *rfd)
Little detail - but you have several lines with extra white space at the
end. You can probably make your editor high light these for you.
--
Jens Axboe
next parent reply other threads:[~2004-02-12 11:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1076536919.3112.149.camel@lintest.iomegacorp.com>
2004-02-12 11:10 ` Jens Axboe [this message]
2004-02-11 22:10 [PATCH] Allow random write for PDT 5 profile 2 Removable Disk John McKell
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=20040212111007.GB26397@suse.de \
--to=axboe@suse.de \
--cc=linux-scsi-@vger.kernel.org \
--cc=mckellj@iomega.com \
/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