Skip to content

Commit 3269485

Browse files
sboxnetLinus Torvalds
authored andcommitted
[PATCH] pktcdvd: add sysfs and debugfs interface
Add a sysfs and debugfs interface to the pktcdvd driver. Look into the Documentation/ABI/testing/* files in the patch for more info. Signed-off-by: Thomas Maier <balagi@justmail.de> Signed-off-by: Peter Osterlund <petero2@telia.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 0a0fc96 commit 3269485

5 files changed

Lines changed: 583 additions & 5 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
What: /debug/pktcdvd/pktcdvd[0-7]
2+
Date: Oct. 2006
3+
KernelVersion: 2.6.19
4+
Contact: Thomas Maier <balagi@justmail.de>
5+
Description:
6+
7+
debugfs interface
8+
-----------------
9+
10+
The pktcdvd module (packet writing driver) creates
11+
these files in debugfs:
12+
13+
/debug/pktcdvd/pktcdvd[0-7]/
14+
info (0444) Lots of human readable driver
15+
statistics and infos. Multiple lines!
16+
17+
Example:
18+
-------
19+
20+
cat /debug/pktcdvd/pktcdvd0/info
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
What: /sys/class/pktcdvd/
2+
Date: Oct. 2006
3+
KernelVersion: 2.6.19
4+
Contact: Thomas Maier <balagi@justmail.de>
5+
Description:
6+
7+
sysfs interface
8+
---------------
9+
10+
The pktcdvd module (packet writing driver) creates
11+
these files in the sysfs:
12+
(<devid> is in format major:minor )
13+
14+
/sys/class/pktcdvd/
15+
add (0200) Write a block device id (major:minor)
16+
to create a new pktcdvd device and map
17+
it to the block device.
18+
19+
remove (0200) Write the pktcdvd device id (major:minor)
20+
to it to remove the pktcdvd device.
21+
22+
device_map (0444) Shows the device mapping in format:
23+
pktcdvd[0-7] <pktdevid> <blkdevid>
24+
25+
/sys/class/pktcdvd/pktcdvd[0-7]/
26+
dev (0444) Device id
27+
uevent (0200) To send an uevent.
28+
29+
/sys/class/pktcdvd/pktcdvd[0-7]/stat/
30+
packets_started (0444) Number of started packets.
31+
packets_finished (0444) Number of finished packets.
32+
33+
kb_written (0444) kBytes written.
34+
kb_read (0444) kBytes read.
35+
kb_read_gather (0444) kBytes read to fill write packets.
36+
37+
reset (0200) Write any value to it to reset
38+
pktcdvd device statistic values, like
39+
bytes read/written.
40+
41+
/sys/class/pktcdvd/pktcdvd[0-7]/write_queue/
42+
size (0444) Contains the size of the bio write
43+
queue.
44+
45+
congestion_off (0644) If bio write queue size is below
46+
this mark, accept new bio requests
47+
from the block layer.
48+
49+
congestion_on (0644) If bio write queue size is higher
50+
as this mark, do no longer accept
51+
bio write requests from the block
52+
layer and wait till the pktcdvd
53+
device has processed enough bio's
54+
so that bio write queue size is
55+
below congestion off mark.
56+
A value of <= 0 disables congestion
57+
control.
58+
59+
60+
Example:
61+
--------
62+
To use the pktcdvd sysfs interface directly, you can do:
63+
64+
# create a new pktcdvd device mapped to /dev/hdc
65+
echo "22:0" >/sys/class/pktcdvd/add
66+
cat /sys/class/pktcdvd/device_map
67+
# assuming device pktcdvd0 was created, look at stat's
68+
cat /sys/class/pktcdvd/pktcdvd0/stat/kb_written
69+
# print the device id of the mapped block device
70+
fgrep pktcdvd0 /sys/class/pktcdvd/device_map
71+
# remove device, using pktcdvd0 device id 253:0
72+
echo "253:0" >/sys/class/pktcdvd/remove

‎Documentation/cdrom/packet-writing.txt‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,41 @@ Notes
9090
to create an ext2 filesystem on the disc.
9191

9292

93+
Using the pktcdvd sysfs interface
94+
---------------------------------
95+
96+
Since Linux 2.6.19, the pktcdvd module has a sysfs interface
97+
and can be controlled by it. For example the "pktcdvd" tool uses
98+
this interface. (see http://people.freenet.de/BalaGi#pktcdvd )
99+
100+
"pktcdvd" works similar to "pktsetup", e.g.:
101+
102+
# pktcdvd -a dev_name /dev/hdc
103+
# mkudffs /dev/pktcdvd/dev_name
104+
# mount -t udf -o rw,noatime /dev/pktcdvd/dev_name /dvdram
105+
# cp files /dvdram
106+
# umount /dvdram
107+
# pktcdvd -r dev_name
108+
109+
110+
For a description of the sysfs interface look into the file:
111+
112+
Documentation/ABI/testing/sysfs-block-pktcdvd
113+
114+
115+
Using the pktcdvd debugfs interface
116+
-----------------------------------
117+
118+
To read pktcdvd device infos in human readable form, do:
119+
120+
# cat /debug/pktcdvd/pktcdvd[0-7]/info
121+
122+
For a description of the debugfs interface look into the file:
123+
124+
Documentation/ABI/testing/debugfs-pktcdvd
125+
126+
127+
93128
Links
94129
-----
95130

0 commit comments

Comments
 (0)