1 sysfs interface 1 sysfs interface 2 --------------- 2 --------------- 3 The pktcdvd module (packet writing driver) cre 3 The pktcdvd module (packet writing driver) creates the following files in the 4 sysfs: (<devid> is in the format major:minor) 4 sysfs: (<devid> is in the format major:minor) 5 5 6 What: /sys/class/pktcdvd/add 6 What: /sys/class/pktcdvd/add 7 What: /sys/class/pktcdvd/remove 7 What: /sys/class/pktcdvd/remove 8 What: /sys/class/pktcdvd/device_map 8 What: /sys/class/pktcdvd/device_map 9 Date: Oct. 2006 9 Date: Oct. 2006 10 KernelVersion: 2.6.20 10 KernelVersion: 2.6.20 11 Contact: Thomas Maier <balagi@justmail.d 11 Contact: Thomas Maier <balagi@justmail.de> 12 Description: 12 Description: 13 13 14 ========== ============== 14 ========== ============================================== 15 add (WO) Write a b 15 add (WO) Write a block device id (major:minor) to 16 create a new p 16 create a new pktcdvd device and map it to the 17 block device. 17 block device. 18 18 19 remove (WO) Write the 19 remove (WO) Write the pktcdvd device id (major:minor) 20 to remove the 20 to remove the pktcdvd device. 21 21 22 device_map (RO) Shows the 22 device_map (RO) Shows the device mapping in format: 23 pktcdvd[0-7] < 23 pktcdvd[0-7] <pktdevid> <blkdevid> 24 ========== ============== 24 ========== ============================================== 25 25 26 26 27 What: /sys/class/pktcdvd/pktcdvd[0-7 27 What: /sys/class/pktcdvd/pktcdvd[0-7]/dev 28 What: /sys/class/pktcdvd/pktcdvd[0-7 28 What: /sys/class/pktcdvd/pktcdvd[0-7]/uevent 29 Date: Oct. 2006 29 Date: Oct. 2006 30 KernelVersion: 2.6.20 30 KernelVersion: 2.6.20 31 Contact: Thomas Maier <balagi@justmail.d 31 Contact: Thomas Maier <balagi@justmail.de> 32 Description: 32 Description: 33 dev: (RO) Device id 33 dev: (RO) Device id 34 34 35 uevent: (WO) To send a uevent 35 uevent: (WO) To send a uevent 36 36 37 37 38 What: /sys/class/pktcdvd/pktcdvd[0-7 38 What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_started 39 What: /sys/class/pktcdvd/pktcdvd[0-7 39 What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_finished 40 What: /sys/class/pktcdvd/pktcdvd[0-7 40 What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_written 41 What: /sys/class/pktcdvd/pktcdvd[0-7 41 What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read 42 What: /sys/class/pktcdvd/pktcdvd[0-7 42 What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read_gather 43 What: /sys/class/pktcdvd/pktcdvd[0-7 43 What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/reset 44 Date: Oct. 2006 44 Date: Oct. 2006 45 KernelVersion: 2.6.20 45 KernelVersion: 2.6.20 46 Contact: Thomas Maier <balagi@justmail.d 46 Contact: Thomas Maier <balagi@justmail.de> 47 Description: 47 Description: 48 packets_started: (RO) N 48 packets_started: (RO) Number of started packets. 49 49 50 packets_finished: (RO) N 50 packets_finished: (RO) Number of finished packets. 51 51 52 kb_written: (RO) k 52 kb_written: (RO) kBytes written. 53 53 54 kb_read: (RO) k 54 kb_read: (RO) kBytes read. 55 55 56 kb_read_gather: (RO) k 56 kb_read_gather: (RO) kBytes read to fill write packets. 57 57 58 reset: (WO) W 58 reset: (WO) Write any value to it to reset 59 pktcdv 59 pktcdvd device statistic values, like 60 bytes 60 bytes read/written. 61 61 62 62 63 What: /sys/class/pktcdvd/pktcdvd[0-7 63 What: /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/size 64 What: /sys/class/pktcdvd/pktcdvd[0-7 64 What: /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_off 65 What: /sys/class/pktcdvd/pktcdvd[0-7 65 What: /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_on 66 Date: Oct. 2006 66 Date: Oct. 2006 67 KernelVersion: 2.6.20 67 KernelVersion: 2.6.20 68 Contact: Thomas Maier <balagi@justmail.d 68 Contact: Thomas Maier <balagi@justmail.de> 69 Description: 69 Description: 70 ============== ============== 70 ============== ================================================ 71 size (RO) Contains 71 size (RO) Contains the size of the bio write queue. 72 72 73 congestion_off (RW) If bio wr 73 congestion_off (RW) If bio write queue size is below this mark, 74 accept new bio 74 accept new bio requests from the block layer. 75 75 76 congestion_on (RW) If bio wr 76 congestion_on (RW) If bio write queue size is higher as this 77 mark, do no lo 77 mark, do no longer accept bio write requests 78 from the block 78 from the block layer and wait till the pktcdvd 79 device has pro 79 device has processed enough bio's so that bio 80 write queue si 80 write queue size is below congestion off mark. 81 A value of <= 81 A value of <= 0 disables congestion control. 82 ============== ============== 82 ============== ================================================ 83 83 84 84 85 Example: 85 Example: 86 -------- 86 -------- 87 To use the pktcdvd sysfs interface directly, y 87 To use the pktcdvd sysfs interface directly, you can do:: 88 88 89 # create a new pktcdvd device mapped to /d 89 # create a new pktcdvd device mapped to /dev/hdc 90 echo "22:0" >/sys/class/pktcdvd/add 90 echo "22:0" >/sys/class/pktcdvd/add 91 cat /sys/class/pktcdvd/device_map 91 cat /sys/class/pktcdvd/device_map 92 # assuming device pktcdvd0 was created, lo 92 # assuming device pktcdvd0 was created, look at stat's 93 cat /sys/class/pktcdvd/pktcdvd0/stat/kb_wr 93 cat /sys/class/pktcdvd/pktcdvd0/stat/kb_written 94 # print the device id of the mapped block 94 # print the device id of the mapped block device 95 fgrep pktcdvd0 /sys/class/pktcdvd/device_m 95 fgrep pktcdvd0 /sys/class/pktcdvd/device_map 96 # remove device, using pktcdvd0 device id 96 # remove device, using pktcdvd0 device id 253:0 97 echo "253:0" >/sys/class/pktcdvd/remove 97 echo "253:0" >/sys/class/pktcdvd/remove
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.