sysfs-class-pktcdvd 2.7 KB

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