sysfs-class-pktcdvd 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. sysfs interface
  2. ---------------
  3. The pktcdvd module (packet writing driver) creates the following files in the
  4. sysfs: (<devid> is in the format major:minor)
  5. What: /sys/class/pktcdvd/add
  6. What: /sys/class/pktcdvd/remove
  7. What: /sys/class/pktcdvd/device_map
  8. Date: Oct. 2006
  9. KernelVersion: 2.6.20
  10. Contact: Thomas Maier <balagi@justmail.de>
  11. Description:
  12. add: (WO) Write a block device id (major:minor) to
  13. create a new pktcdvd device and map it to the
  14. block device.
  15. remove: (WO) Write the pktcdvd device id (major:minor)
  16. to remove the pktcdvd device.
  17. device_map: (RO) Shows the device mapping in format:
  18. pktcdvd[0-7] <pktdevid> <blkdevid>
  19. What: /sys/class/pktcdvd/pktcdvd[0-7]/dev
  20. What: /sys/class/pktcdvd/pktcdvd[0-7]/uevent
  21. Date: Oct. 2006
  22. KernelVersion: 2.6.20
  23. Contact: Thomas Maier <balagi@justmail.de>
  24. Description:
  25. dev: (RO) Device id
  26. uevent: (WO) To send a uevent
  27. What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_started
  28. What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_finished
  29. What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_written
  30. What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read
  31. What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read_gather
  32. What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/reset
  33. Date: Oct. 2006
  34. KernelVersion: 2.6.20
  35. Contact: Thomas Maier <balagi@justmail.de>
  36. Description:
  37. packets_started: (RO) Number of started packets.
  38. packets_finished: (RO) Number of finished packets.
  39. kb_written: (RO) kBytes written.
  40. kb_read: (RO) kBytes read.
  41. kb_read_gather: (RO) kBytes read to fill write packets.
  42. reset: (WO) Write any value to it to reset
  43. pktcdvd device statistic values, like
  44. bytes read/written.
  45. What: /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/size
  46. What: /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_off
  47. What: /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_on
  48. Date: Oct. 2006
  49. KernelVersion: 2.6.20
  50. Contact: Thomas Maier <balagi@justmail.de>
  51. Description:
  52. size: (RO) Contains the size of the bio write queue.
  53. congestion_off: (RW) If bio write queue size is below this mark,
  54. accept new bio requests from the block layer.
  55. congestion_on: (RW) If bio write queue size is higher as this
  56. mark, do no longer accept bio write requests
  57. from the block layer and wait till the pktcdvd
  58. device has processed enough bio's so that bio
  59. write queue size is below congestion off mark.
  60. A value of <= 0 disables congestion control.
  61. Example:
  62. --------
  63. To use the pktcdvd sysfs interface directly, you can do:
  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