github.com/gunjan5/docker@v1.8.2/daemon/graphdriver/devmapper/devmapper_doc.go (about)

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