devmapper_doc.go 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. package devmapper
  2. // Definition of struct dm_task and sub structures (from lvm2)
  3. //
  4. // struct dm_ioctl {
  5. // /*
  6. // * The version number is made up of three parts:
  7. // * major - no backward or forward compatibility,
  8. // * minor - only backwards compatible,
  9. // * patch - both backwards and forwards compatible.
  10. // *
  11. // * All clients of the ioctl interface should fill in the
  12. // * version number of the interface that they were
  13. // * compiled with.
  14. // *
  15. // * All recognized ioctl commands (ie. those that don't
  16. // * return -ENOTTY) fill out this field, even if the
  17. // * command failed.
  18. // */
  19. // uint32_t version[3]; /* in/out */
  20. // uint32_t data_size; /* total size of data passed in
  21. // * including this struct */
  22. // uint32_t data_start; /* offset to start of data
  23. // * relative to start of this struct */
  24. // uint32_t target_count; /* in/out */
  25. // int32_t open_count; /* out */
  26. // uint32_t flags; /* in/out */
  27. // /*
  28. // * event_nr holds either the event number (input and output) or the
  29. // * udev cookie value (input only).
  30. // * The DM_DEV_WAIT ioctl takes an event number as input.
  31. // * The DM_SUSPEND, DM_DEV_REMOVE and DM_DEV_RENAME ioctls
  32. // * use the field as a cookie to return in the DM_COOKIE
  33. // * variable with the uevents they issue.
  34. // * For output, the ioctls return the event number, not the cookie.
  35. // */
  36. // uint32_t event_nr; /* in/out */
  37. // uint32_t padding;
  38. // uint64_t dev; /* in/out */
  39. // char name[DM_NAME_LEN]; /* device name */
  40. // char uuid[DM_UUID_LEN]; /* unique identifier for
  41. // * the block device */
  42. // char data[7]; /* padding or data */
  43. // };
  44. // struct target {
  45. // uint64_t start;
  46. // uint64_t length;
  47. // char *type;
  48. // char *params;
  49. // struct target *next;
  50. // };
  51. // typedef enum {
  52. // DM_ADD_NODE_ON_RESUME, /* add /dev/mapper node with dmsetup resume */
  53. // DM_ADD_NODE_ON_CREATE /* add /dev/mapper node with dmsetup create */
  54. // } dm_add_node_t;
  55. // struct dm_task {
  56. // int type;
  57. // char *dev_name;
  58. // char *mangled_dev_name;
  59. // struct target *head, *tail;
  60. // int read_only;
  61. // uint32_t event_nr;
  62. // int major;
  63. // int minor;
  64. // int allow_default_major_fallback;
  65. // uid_t uid;
  66. // gid_t gid;
  67. // mode_t mode;
  68. // uint32_t read_ahead;
  69. // uint32_t read_ahead_flags;
  70. // union {
  71. // struct dm_ioctl *v4;
  72. // } dmi;
  73. // char *newname;
  74. // char *message;
  75. // char *geometry;
  76. // uint64_t sector;
  77. // int no_flush;
  78. // int no_open_count;
  79. // int skip_lockfs;
  80. // int query_inactive_table;
  81. // int suppress_identical_reload;
  82. // dm_add_node_t add_node;
  83. // uint64_t existing_table_size;
  84. // int cookie_set;
  85. // int new_uuid;
  86. // int secure_data;
  87. // int retry_remove;
  88. // int enable_checks;
  89. // int expected_errno;
  90. // char *uuid;
  91. // char *mangled_uuid;
  92. // };
  93. //