All of lore.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: Linux-SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: scsi sysfs design, ch driver
Date: Sun, 16 Oct 2005 15:50:19 +1000	[thread overview]
Message-ID: <4351EA1B.6020402@torque.net> (raw)

I am trying to map programmatically from an sg device
to whatever [if it has a corresponding upper level device].
The code is looking at this directory:
/sys/devices/pseudo_0/adapter0/host1/target1:0:0/1:0:0:0

and is confronted with these choices:

bus             iocounterbits  power        scsi_changer:sch0    timeout
delete          iodone_cnt     queue_depth  scsi_device:1:0:0:0  type
device_blocked  ioerr_cnt      queue_type   scsi_generic:sg0     vendor
driver          iorequest_cnt  rescan       scsi_level
generic         model          rev          state

Now if it was a block device (sd or sr) there would be a
"block" symlink to follow; if it was a tape device there
would be a "tape" symlink to follow. However as can be seen
it is a medium changer, so why not a "changer" symlink?
The "scsi_changer:sch0" symlink has a useless appendage IMO.
The directory needs to be scanned to find it, and when followed,
if my code is interested, then there are several ways to
determine that its sysfs name is sch0.

So my question is why was "scsi_generic:sg0" form introduced,
especially the ":sg0" part? It may help visually but it
is a nuisance programmatically.

Doug Gilbert

             reply	other threads:[~2005-10-16  5:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-16  5:50 Douglas Gilbert [this message]
2005-10-16  6:39 ` scsi sysfs design, ch driver Matthew Wilcox

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=4351EA1B.6020402@torque.net \
    --to=dougg@torque.net \
    --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.