From: Douglas Gilbert <dougg@torque.net>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [RFC] sgbind
Date: Thu, 15 May 2003 00:02:09 +1000 [thread overview]
Message-ID: <3EC24C61.4070203@torque.net> (raw)
In-Reply-To: <20030514140235.A20579@infradead.org>
Christoph Hellwig wrote:
> On Wed, May 14, 2003 at 10:33:32PM +1000, Douglas Gilbert wrote:
>
>>The sgbind code is in the sg driver which allows it
>>to share existing code. sgbind avoids using the sg
>>driver's upper level sysfs code (i.e. sg_driverfs_dev).
>
>
> I'd prefer to have it in the scsi midlayer as it's not really
> a traditional scsi upper driver but rather a special way to access
> scsi devices.
The sg driver is nothing if not "a special way to
access scsi devices". Sg is a pass through to the
mid level. Note that I originally suggested this
could be an addition to the mid level and Patrick
Mansfield suggested I put it in the sg driver.
To date it is about 180 extra lines of code in
sg.
Also the SCSI_IOCTL_SEND_COMMAND and SG_IO implementations
in the block layer are sub-standard. I'd prefer not to
see that hack repeated.
>>struct sgbind_nexus {
>> int descriptor_id; /* set to 0 for now */
>
>
> Why is this signed?
It is simply a guard, allowing a different toplogical
representation (perhaps with a 64 bit, multi-level
lun).
>> unsigned int host_no;
>> unsigned int channel;
>> unsigned int scsi_id;
>> unsigned int lun;
>
>
> Please use __u32/__s32 instead. Any new interface should
> use those explicit versions.
Why not int32_t and uint32_t?
Using identifiers that start with a double underscore is
a contravention of both C89 and C99.
>>The SGBIND_ADD_LU and SGBIND_REMOVE_LU ioctls are simply
>>programmatic interfaces to the code behind "scsi add-single-device"
>>and "scsi remove-single-device". [Code was moved from scsi_proc.c
>>to scsi_scan.c so that these ioctls don't require procfs to be
>>configured.]
>
>
> I don't think adding more ioctls is a good thing.
>
>
>>Multiple file descriptors may be open on /dev/sgbind, each
>>file descriptor has its own state (like normal sg device nodes).
>>The SGBIND_ATTACH ioctl will either bind:
>> - to an existing logical unit (device) which matches the
>> given nexus
>> - create a new scsi_device instance (using scsi_alloc_dev())
>> with the given nexus
>>The host number must match an existing host.
>>
>>The SGBIND_DETACH ioctl unbinds the file descriptor from an
>>existing nexus (assuming a nexus was established by a prior
>>SGBIND_ATTACH). Thereafter an new nexus can be formed with
>>SGBIND_ATTACH. Closing the file descriptor also has the effect
>>of unbinding the nexus.
>
>
> I don't like this ioctl horror. Can't you add a sgfs that just containß
> nodes for all scsi devices?
That is exactly what I'm trying to avoid. The whole idea is
to not scan all SCSI devices in the kernel and
not generate some kernel mapping of them. Rather, give
the scanning job to a user application and it can pick its
way around and only make those devices that are relevant
visible.
Doug Gilbert
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2003-05-14 13:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-14 12:33 [RFC] sgbind Douglas Gilbert
2003-05-14 13:02 ` Christoph Hellwig
2003-05-14 14:02 ` Douglas Gilbert [this message]
2003-05-14 14:49 ` Patrick Mansfield
2003-05-15 0:05 ` Patrick Mansfield
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=3EC24C61.4070203@torque.net \
--to=dougg@torque.net \
--cc=hch@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.