Re: Devices not supporting read-6....

From: Eric Youngdale (eric@andante.org)
Date: Sun Feb 06 2000 - 14:43:52 EST


    Actually I had another thought. There is an even easier way of doing
things now. When I cleaned up the queueing code, a lot of the similar code
between sd and sr got moved into scsi_lib.c. Thus teaching sr.c to handle
writes would be quite trivial. Mainly adjusting sr_init_command() to
generate a WRITE_10 if the command is a write and the device has the
writable flag set.

    There are a couple of places where it tries to ensure that access is
read-only (possibly in sr_open) These would need to be modified so that
they check the writable flag first.

-Eric

----- Original Message -----
From: "Rogier Wolff" <R.E.Wolff@BitWizard.nl>
To: "Eric Youngdale" <eric@andante.org>
Cc: "Drew Eckhardt" <drew@Poohsticks.Org>; "Rogier Wolff"
<R.E.Wolff@BitWizard.nl>; "Kenneth D. Merry" <ken@kdm.org>; "Jonas Nickel"
<jonas.nickel@tu-berlin.de>; <linux-kernel@vger.rutgers.edu>;
<linux-scsi@vger.rutgers.edu>; <phoenix@thesindicate.com>
Sent: Thursday, February 03, 2000 3:51 AM
Subject: Re: Devices not supporting read-6....

> Eric Youngdale wrote:
>
> > Is this what that ghost stuff is really for? There is a much easier
> > way of doing this, you know. There is no technical reason why the
> > same Scsi_Device cannot be driven by both drivers - the only thing
> > you would need to do is to teach sd.c that it should also attach to
> > DVD RAM drives.
>
> Which is what the ghost stuff does, maybe not in the cleanest way, but
> that is still the only thing that it does.
>
> > If I had to guess, all you would need to do is to fix it so that
> > scsi_scan() first marked the Scsi_Device as writable, and then a
> > couple of minor edits to sd.c so that it treats the combination of
> > TYPE_ROM with the writable flag set as equivalent to TYPE_MOD.
>
> The end result is exactly the same as what the ghost stuff does now.
>
> The common code between sd and sr is "read a block". This is code that
> should be shared. Moreover, that's about the only "real" thing that
> should be in those drivers. Of course "sr" also supports a few ioctls,
> and "sd" also does writing.
>
> Roger.
>
> --
> ** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
> *-- BitWizard writes Linux device drivers for any device you may have! --*
> "I didn't say it was your fault. I said I was going to blame it on you."
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.rutgers.edu
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Feb 07 2000 - 21:00:13 EST