aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMilan Broz <mbroz@redhat.com>2009-06-22 05:12:30 -0400
committerAlasdair G Kergon <agk@redhat.com>2009-06-22 05:12:30 -0400
commit60935eb21d3c5bac79618000f38f92c249d153c4 (patch)
tree0fcd78d7d69e23cd062e5214ddf2959d5c74e605 /include
parent486d220fe4909b5745c4faa67faddd30a707abe2 (diff)
dm ioctl: support cookies for udev
Add support for passing a 32 bit "cookie" into the kernel with the DM_SUSPEND, DM_DEV_RENAME and DM_DEV_REMOVE ioctls. The (unsigned) value of this cookie is returned to userspace alongside the uevents issued by these ioctls in the variable DM_COOKIE. This means the userspace process issuing these ioctls can be notified by udev after udev has completed any actions triggered. To minimise the interface extension, we pass the cookie into the kernel in the event_nr field which is otherwise unused when calling these ioctls. Incrementing the version number allows userspace to determine in advance whether or not the kernel supports the cookie. If the kernel does support this but userspace does not, there should be no impact as the new variable will just get ignored. Signed-off-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/dm-ioctl.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h
index 48e44ee2b466..2ab84c83c31a 100644
--- a/include/linux/dm-ioctl.h
+++ b/include/linux/dm-ioctl.h
@@ -123,6 +123,16 @@ struct dm_ioctl {
123 __u32 target_count; /* in/out */ 123 __u32 target_count; /* in/out */
124 __s32 open_count; /* out */ 124 __s32 open_count; /* out */
125 __u32 flags; /* in/out */ 125 __u32 flags; /* in/out */
126
127 /*
128 * event_nr holds either the event number (input and output) or the
129 * udev cookie value (input only).
130 * The DM_DEV_WAIT ioctl takes an event number as input.
131 * The DM_SUSPEND, DM_DEV_REMOVE and DM_DEV_RENAME ioctls
132 * use the field as a cookie to return in the DM_COOKIE
133 * variable with the uevents they issue.
134 * For output, the ioctls return the event number, not the cookie.
135 */
126 __u32 event_nr; /* in/out */ 136 __u32 event_nr; /* in/out */
127 __u32 padding; 137 __u32 padding;
128 138
@@ -256,9 +266,9 @@ enum {
256#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) 266#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
257 267
258#define DM_VERSION_MAJOR 4 268#define DM_VERSION_MAJOR 4
259#define DM_VERSION_MINOR 14 269#define DM_VERSION_MINOR 15
260#define DM_VERSION_PATCHLEVEL 0 270#define DM_VERSION_PATCHLEVEL 0
261#define DM_VERSION_EXTRA "-ioctl (2008-04-23)" 271#define DM_VERSION_EXTRA "-ioctl (2009-04-01)"
262 272
263/* Status bits */ 273/* Status bits */
264#define DM_READONLY_FLAG (1 << 0) /* In/Out */ 274#define DM_READONLY_FLAG (1 << 0) /* In/Out */