netfilter: nf_conntrack: support conntrack templates
[safe/jmp/linux-2.6] / include / linux / dm-ioctl.h
index 8853fc4..aa95508 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2001 - 2003 Sistina Software (UK) Limited.
- * Copyright (C) 2004 - 2005 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004 - 2009 Red Hat, Inc. All rights reserved.
  *
  * This file is released under the LGPL.
  */
@@ -113,24 +113,35 @@ struct dm_ioctl {
         * return -ENOTTY) fill out this field, even if the
         * command failed.
         */
-       uint32_t version[3];    /* in/out */
-       uint32_t data_size;     /* total size of data passed in
+       __u32 version[3];       /* in/out */
+       __u32 data_size;        /* total size of data passed in
                                 * including this struct */
 
-       uint32_t data_start;    /* offset to start of data
+       __u32 data_start;       /* offset to start of data
                                 * relative to start of this struct */
 
-       uint32_t target_count;  /* in/out */
-       int32_t open_count;     /* out */
-       uint32_t flags;         /* in/out */
-       uint32_t event_nr;              /* in/out */
-       uint32_t padding;
+       __u32 target_count;     /* in/out */
+       __s32 open_count;       /* out */
+       __u32 flags;            /* in/out */
 
-       uint64_t dev;           /* in/out */
+       /*
+        * event_nr holds either the event number (input and output) or the
+        * udev cookie value (input only).
+        * The DM_DEV_WAIT ioctl takes an event number as input.
+        * The DM_SUSPEND, DM_DEV_REMOVE and DM_DEV_RENAME ioctls
+        * use the field as a cookie to return in the DM_COOKIE
+        * variable with the uevents they issue.
+        * For output, the ioctls return the event number, not the cookie.
+        */
+       __u32 event_nr;         /* in/out */
+       __u32 padding;
+
+       __u64 dev;              /* in/out */
 
        char name[DM_NAME_LEN]; /* device name */
        char uuid[DM_UUID_LEN]; /* unique identifier for
                                 * the block device */
+       char data[7];           /* padding or data */
 };
 
 /*
@@ -138,9 +149,9 @@ struct dm_ioctl {
  * dm_ioctl.
  */
 struct dm_target_spec {
-       uint64_t sector_start;
-       uint64_t length;
-       int32_t status;         /* used when reading from kernel only */
+       __u64 sector_start;
+       __u64 length;
+       __s32 status;           /* used when reading from kernel only */
 
        /*
         * Location of the next dm_target_spec.
@@ -152,7 +163,7 @@ struct dm_target_spec {
         *   (that follows the dm_ioctl struct) to the start of the "next"
         *   dm_target_spec.
         */
-       uint32_t next;
+       __u32 next;
 
        char target_type[DM_MAX_TYPE_NAME];
 
@@ -167,17 +178,17 @@ struct dm_target_spec {
  * Used to retrieve the target dependencies.
  */
 struct dm_target_deps {
-       uint32_t count; /* Array size */
-       uint32_t padding;       /* unused */
-       uint64_t dev[0];        /* out */
+       __u32 count;    /* Array size */
+       __u32 padding;  /* unused */
+       __u64 dev[0];   /* out */
 };
 
 /*
  * Used to get a list of all dm devices.
  */
 struct dm_name_list {
-       uint64_t dev;
-       uint32_t next;          /* offset to the next record from
+       __u64 dev;
+       __u32 next;             /* offset to the next record from
                                   the _start_ of this */
        char name[0];
 };
@@ -186,8 +197,8 @@ struct dm_name_list {
  * Used to retrieve the target versions
  */
 struct dm_target_versions {
-        uint32_t next;
-        uint32_t version[3];
+        __u32 next;
+        __u32 version[3];
 
         char name[0];
 };
@@ -196,7 +207,7 @@ struct dm_target_versions {
  * Used to pass message to a target
  */
 struct dm_target_msg {
-       uint64_t sector;        /* Device sector */
+       __u64 sector;   /* Device sector */
 
        char message[0];
 };
@@ -231,36 +242,6 @@ enum {
        DM_DEV_SET_GEOMETRY_CMD
 };
 
-/*
- * The dm_ioctl struct passed into the ioctl is just the header
- * on a larger chunk of memory.  On x86-64 and other
- * architectures the dm-ioctl struct will be padded to an 8 byte
- * boundary so the size will be different, which would change the
- * ioctl code - yes I really messed up.  This hack forces these
- * architectures to have the correct ioctl code.
- */
-#ifdef CONFIG_COMPAT
-typedef char ioctl_struct[308];
-#define DM_VERSION_32       _IOWR(DM_IOCTL, DM_VERSION_CMD, ioctl_struct)
-#define DM_REMOVE_ALL_32    _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD, ioctl_struct)
-#define DM_LIST_DEVICES_32  _IOWR(DM_IOCTL, DM_LIST_DEVICES_CMD, ioctl_struct)
-
-#define DM_DEV_CREATE_32    _IOWR(DM_IOCTL, DM_DEV_CREATE_CMD, ioctl_struct)
-#define DM_DEV_REMOVE_32    _IOWR(DM_IOCTL, DM_DEV_REMOVE_CMD, ioctl_struct)
-#define DM_DEV_RENAME_32    _IOWR(DM_IOCTL, DM_DEV_RENAME_CMD, ioctl_struct)
-#define DM_DEV_SUSPEND_32   _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD, ioctl_struct)
-#define DM_DEV_STATUS_32    _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD, ioctl_struct)
-#define DM_DEV_WAIT_32      _IOWR(DM_IOCTL, DM_DEV_WAIT_CMD, ioctl_struct)
-
-#define DM_TABLE_LOAD_32    _IOWR(DM_IOCTL, DM_TABLE_LOAD_CMD, ioctl_struct)
-#define DM_TABLE_CLEAR_32   _IOWR(DM_IOCTL, DM_TABLE_CLEAR_CMD, ioctl_struct)
-#define DM_TABLE_DEPS_32    _IOWR(DM_IOCTL, DM_TABLE_DEPS_CMD, ioctl_struct)
-#define DM_TABLE_STATUS_32  _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, ioctl_struct)
-#define DM_LIST_VERSIONS_32 _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, ioctl_struct)
-#define DM_TARGET_MSG_32    _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, ioctl_struct)
-#define DM_DEV_SET_GEOMETRY_32 _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, ioctl_struct)
-#endif
-
 #define DM_IOCTL 0xfd
 
 #define DM_VERSION       _IOWR(DM_IOCTL, DM_VERSION_CMD, struct dm_ioctl)
@@ -285,9 +266,9 @@ typedef char ioctl_struct[308];
 #define DM_DEV_SET_GEOMETRY    _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
 
 #define DM_VERSION_MAJOR       4
-#define DM_VERSION_MINOR       10
+#define DM_VERSION_MINOR       16
 #define DM_VERSION_PATCHLEVEL  0
-#define DM_VERSION_EXTRA       "-ioctl (2006-09-14)"
+#define DM_VERSION_EXTRA       "-ioctl (2009-11-05)"
 
 /* Status bits */
 #define DM_READONLY_FLAG       (1 << 0) /* In/Out */
@@ -323,4 +304,16 @@ typedef char ioctl_struct[308];
  */
 #define DM_SKIP_LOCKFS_FLAG    (1 << 10) /* In */
 
+/*
+ * Set this to suspend without flushing queued ios.
+ */
+#define DM_NOFLUSH_FLAG                (1 << 11) /* In */
+
+/*
+ * If set, any table information returned will relate to the inactive
+ * table instead of the live one.  Always check DM_INACTIVE_PRESENT_FLAG
+ * is set before using the data returned.
+ */
+#define DM_QUERY_INACTIVE_TABLE_FLAG   (1 << 12) /* In */
+
 #endif                         /* _LINUX_DM_IOCTL_H */