All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH+RFC] sg: char_devs + seq_file lk2.6.0t6
@ 2003-10-07 10:35 Douglas Gilbert
  2003-10-10 14:16 ` Douglas Gilbert
  0 siblings, 1 reply; 3+ messages in thread
From: Douglas Gilbert @ 2003-10-07 10:35 UTC (permalink / raw)
  To: linux-scsi

[-- Attachment #1: Type: text/plain, Size: 842 bytes --]

Changes to scsi generic (sg) driver [gzipped patch against
lk 2.6.0-test6]:
     - add "struct cdev" [char_devs] objects to increase
       maximum number of sg devices from 256 to 8192
     - use seq_file interface for /proc/scsi/sg/*
       pseudo files

The first change re-introduces sg devices into sysfs.
Each sg device has a directory (currently empty)
with a name of the form: "/sys/cdev/major/sg<n>". When I tried
adding 280 scsi "devices" with scsi_debug all the expected
sg directories appeared (sg0..sg279). However sd registered
the first 256 "disks" (up to /dev/sdiv) and failed thereafter
with error "-16" (is anybody working on extending sd's
disk and partition range?).

Would it be possible to put a symbolic link in the
/sys/cdev/major/sg<n> directory to the corresponding
sysfs scsi device (and vice versa)?

Doug Gilbert

[-- Attachment #2: sg260t6.diff.gz --]
[-- Type: application/x-gzip, Size: 5769 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH+RFC] sg: char_devs + seq_file lk2.6.0t6
  2003-10-07 10:35 [PATCH+RFC] sg: char_devs + seq_file lk2.6.0t6 Douglas Gilbert
@ 2003-10-10 14:16 ` Douglas Gilbert
  2003-11-07  5:57   ` [PATCH+RFC] sg: char_devs + seq_file lk2.6.0t9 Douglas Gilbert
  0 siblings, 1 reply; 3+ messages in thread
From: Douglas Gilbert @ 2003-10-10 14:16 UTC (permalink / raw)
  To: linux-scsi

[-- Attachment #1: Type: text/plain, Size: 1303 bytes --]

Douglas Gilbert wrote:
> Changes to scsi generic (sg) driver [gzipped patch against
> lk 2.6.0-test6]:
>     - add "struct cdev" [char_devs] objects to increase
>       maximum number of sg devices from 256 to 8192
>     - use seq_file interface for /proc/scsi/sg/*
>       pseudo files
> 
> The first change re-introduces sg devices into sysfs.
> Each sg device has a directory (currently empty)
> with a name of the form: "/sys/cdev/major/sg<n>". When I tried
> adding 280 scsi "devices" with scsi_debug all the expected
> sg directories appeared (sg0..sg279). However sd registered
> the first 256 "disks" (up to /dev/sdiv) and failed thereafter
> with error "-16" (is anybody working on extending sd's
> disk and partition range?).
> 
> Would it be possible to put a symbolic link in the
> /sys/cdev/major/sg<n> directory to the corresponding
> sysfs scsi device (and vice versa)?

Well nobody objected so attached is another patch on
sg (as found in lk 2.6.0-test7) that additionally sets
up two symlinks from /sys/cdev/major/sg<n> to the
corresponding scsi device in sysfs and back again. A
pruned sysfs "tree" is also attached to illustrate.

Now I need to find somewhere in sysfs to place sg's
driver attributes (e.g. "allow_dio"). char_devs seem
to be deficient in this respect.

Doug Gilbert


[-- Attachment #2: sg260t7.diff.gz --]
[-- Type: application/x-gzip, Size: 5919 bytes --]

[-- Attachment #3: sg_symlinks.txt --]
[-- Type: text/plain, Size: 1520 bytes --]

.
|-- block
|   ...
|   |-- sda
|       |-- dev
|       |-- device -> ../../devices/pseudo_0/adapter0/host1/1:0:0:0
|       |-- queue
|        .......
|-- bus
|   ......
|   |-- pseudo
|   |   |-- devices
|   |   |   `-- adapter0 -> ../../../devices/pseudo_0/adapter0
|   |   `-- drivers
|   |       `-- scsi_debug
|   |           |-- adapter0 -> ../../../../devices/pseudo_0/adapter0
|   |           |-- add_host
|   |           .....
|   |-- scsi
|       |-- devices
|       |   `-- 1:0:0:0 -> ../../../devices/pseudo_0/adapter0/host1/1:0:0:0
|       `-- drivers
|           `-- sd
|               `-- 1:0:0:0 -> ../../../../devices/pseudo_0/adapter0/host1/1:0:0:0
|-- cdev
|   ....
|   |-- major
|       |-- sg0
|       |   `-- device -> ../../../devices/pseudo_0/adapter0/host1/1:0:0:0
|-- class
|   ...
|   |-- scsi_device
|   |   `-- 1:0:0:0
|   |       |-- device -> ../../../devices/pseudo_0/adapter0/host1/1:0:0:0
|   |       `-- driver -> ../../../bus/scsi/drivers/sd
|   |-- scsi_host
|       `-- host1
|           |-- cmd_per_lun
|           |-- device -> ../../../devices/pseudo_0/adapter0/host1
|           ....
|-- devices
    ....
    |-- pseudo_0
        |-- adapter0
            |-- detach_state
            |-- host1
                |-- 1:0:0:0
                    |-- block -> ../../../../../block/sda
                    |-- delete
                    |-- detach_state
                    |-- device_blocked
                    |-- generic -> ../../../../../cdev/major/sg0
                    .....

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH+RFC] sg: char_devs + seq_file lk2.6.0t9
  2003-10-10 14:16 ` Douglas Gilbert
@ 2003-11-07  5:57   ` Douglas Gilbert
  0 siblings, 0 replies; 3+ messages in thread
From: Douglas Gilbert @ 2003-11-07  5:57 UTC (permalink / raw)
  To: linux-scsi

[-- Attachment #1: Type: text/plain, Size: 939 bytes --]

This is an updated patch for the sg driver that takes into
account Patrick LaVarre's fix for negative reserved buffer
sizes found in lk 2.6.0-test9.

So it has the same changelog to the patch I sent on 2003/10/11:
      - add "struct cdev" [char_devs] objects to increase
        maximum number of sg devices from 256 to 8192
      - use seq_file interface for /proc/scsi/sg/*
        pseudo files
      - sysfs symlinks between the sysfs scsi device and the
        corresponding sg cdev node (and vice versa)

An edited "tree" output showing an example of these symlinks
was included in my previous post.

As noted in another thread, st (and osst) may need "cdevs"
and sysfs symlinks so SCSI tape devices have sysfs visibility
in lk 2.6 .

Also if both st and sg had sysfs visibility then Patrick
Mansfield's scsi_id program could be made to work for tape
drives (enclosures, tape robots, etc) by following these
symlinks.

Doug Gilbert

[-- Attachment #2: sg260t9.diff.gz --]
[-- Type: application/x-gzip, Size: 6036 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-11-07  9:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-07 10:35 [PATCH+RFC] sg: char_devs + seq_file lk2.6.0t6 Douglas Gilbert
2003-10-10 14:16 ` Douglas Gilbert
2003-11-07  5:57   ` [PATCH+RFC] sg: char_devs + seq_file lk2.6.0t9 Douglas Gilbert

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.