98 lines · plain
1sysfs interface2---------------3The pktcdvd module (packet writing driver) creates the following files in the4sysfs: (<devid> is in the format major:minor)5 6What: /sys/class/pktcdvd/add7What: /sys/class/pktcdvd/remove8What: /sys/class/pktcdvd/device_map9Date: Oct. 200610KernelVersion: 2.6.2011Contact: Thomas Maier <balagi@justmail.de>12Description:13 14 ========== ==============================================15 add (WO) Write a block device id (major:minor) to16 create a new pktcdvd device and map it to the17 block device.18 19 remove (WO) Write the pktcdvd device id (major:minor)20 to remove the pktcdvd device.21 22 device_map (RO) Shows the device mapping in format:23 pktcdvd[0-7] <pktdevid> <blkdevid>24 ========== ==============================================25 26 27What: /sys/class/pktcdvd/pktcdvd[0-7]/dev28What: /sys/class/pktcdvd/pktcdvd[0-7]/uevent29Date: Oct. 200630KernelVersion: 2.6.2031Contact: Thomas Maier <balagi@justmail.de>32Description:33 dev: (RO) Device id34 35 uevent: (WO) To send a uevent36 37 38What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_started39What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_finished40What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_written41What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read42What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read_gather43What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/reset44Date: Oct. 200645KernelVersion: 2.6.2046Contact: Thomas Maier <balagi@justmail.de>47Description:48 packets_started: (RO) Number of started packets.49 50 packets_finished: (RO) Number of finished packets.51 52 kb_written: (RO) kBytes written.53 54 kb_read: (RO) kBytes read.55 56 kb_read_gather: (RO) kBytes read to fill write packets.57 58 reset: (WO) Write any value to it to reset59 pktcdvd device statistic values, like60 bytes read/written.61 62 63What: /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/size64What: /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_off65What: /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_on66Date: Oct. 200667KernelVersion: 2.6.2068Contact: Thomas Maier <balagi@justmail.de>69Description:70 ============== ================================================71 size (RO) Contains the size of the bio write queue.72 73 congestion_off (RW) If bio write queue size is below this mark,74 accept new bio requests from the block layer.75 76 congestion_on (RW) If bio write queue size is higher as this77 mark, do no longer accept bio write requests78 from the block layer and wait till the pktcdvd79 device has processed enough bio's so that bio80 write queue size is below congestion off mark.81 A value of <= 0 disables congestion control.82 ============== ================================================83 84 85Example:86--------87To use the pktcdvd sysfs interface directly, you can do::88 89 # create a new pktcdvd device mapped to /dev/hdc90 echo "22:0" >/sys/class/pktcdvd/add91 cat /sys/class/pktcdvd/device_map92 # assuming device pktcdvd0 was created, look at stat's93 cat /sys/class/pktcdvd/pktcdvd0/stat/kb_written94 # print the device id of the mapped block device95 fgrep pktcdvd0 /sys/class/pktcdvd/device_map96 # remove device, using pktcdvd0 device id 253:097 echo "253:0" >/sys/class/pktcdvd/remove98