aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/auto_dev-ioctl.h
diff options
context:
space:
mode:
authorIan Kent <raven@themaw.net>2009-01-06 17:42:06 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-06 18:59:23 -0500
commit730c9eeca9808fc2cfb506cc68c90aa330da17b0 (patch)
tree95de85ecf2ee6c071af151ba4e33f1017868a776 /include/linux/auto_dev-ioctl.h
parentf70f582f0072f37790d2984647198deb3e7782a3 (diff)
autofs4: improve parameter usage
The parameter usage in the device node ioctl code uses arg1 and arg2 as parameter names. This patch redefines the parameter names to reflect what they actually are in an effort to make the code more readable. Signed-off-by: Ian Kent <raven@themaw.net> Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/auto_dev-ioctl.h')
-rw-r--r--include/linux/auto_dev-ioctl.h75
1 files changed, 71 insertions, 4 deletions
diff --git a/include/linux/auto_dev-ioctl.h b/include/linux/auto_dev-ioctl.h
index f4d05ccd731f..91a773993a5c 100644
--- a/include/linux/auto_dev-ioctl.h
+++ b/include/linux/auto_dev-ioctl.h
@@ -10,6 +10,7 @@
10#ifndef _LINUX_AUTO_DEV_IOCTL_H 10#ifndef _LINUX_AUTO_DEV_IOCTL_H
11#define _LINUX_AUTO_DEV_IOCTL_H 11#define _LINUX_AUTO_DEV_IOCTL_H
12 12
13#include <linux/string.h>
13#include <linux/types.h> 14#include <linux/types.h>
14 15
15#define AUTOFS_DEVICE_NAME "autofs" 16#define AUTOFS_DEVICE_NAME "autofs"
@@ -25,6 +26,60 @@
25 * An ioctl interface for autofs mount point control. 26 * An ioctl interface for autofs mount point control.
26 */ 27 */
27 28
29struct args_protover {
30 __u32 version;
31};
32
33struct args_protosubver {
34 __u32 sub_version;
35};
36
37struct args_openmount {
38 __u32 devid;
39};
40
41struct args_ready {
42 __u32 token;
43};
44
45struct args_fail {
46 __u32 token;
47 __s32 status;
48};
49
50struct args_setpipefd {
51 __s32 pipefd;
52};
53
54struct args_timeout {
55 __u64 timeout;
56};
57
58struct args_requester {
59 __u32 uid;
60 __u32 gid;
61};
62
63struct args_expire {
64 __u32 how;
65};
66
67struct args_askumount {
68 __u32 may_umount;
69};
70
71struct args_ismountpoint {
72 union {
73 struct args_in {
74 __u32 type;
75 } in;
76 struct args_out {
77 __u32 devid;
78 __u32 magic;
79 } out;
80 };
81};
82
28/* 83/*
29 * All the ioctls use this structure. 84 * All the ioctls use this structure.
30 * When sending a path size must account for the total length 85 * When sending a path size must account for the total length
@@ -39,20 +94,32 @@ struct autofs_dev_ioctl {
39 * including this struct */ 94 * including this struct */
40 __s32 ioctlfd; /* automount command fd */ 95 __s32 ioctlfd; /* automount command fd */
41 96
42 __u32 arg1; /* Command parameters */ 97 /* Command parameters */
43 __u32 arg2; 98
99 union {
100 struct args_protover protover;
101 struct args_protosubver protosubver;
102 struct args_openmount openmount;
103 struct args_ready ready;
104 struct args_fail fail;
105 struct args_setpipefd setpipefd;
106 struct args_timeout timeout;
107 struct args_requester requester;
108 struct args_expire expire;
109 struct args_askumount askumount;
110 struct args_ismountpoint ismountpoint;
111 };
44 112
45 char path[0]; 113 char path[0];
46}; 114};
47 115
48static inline void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in) 116static inline void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in)
49{ 117{
118 memset(in, 0, sizeof(struct autofs_dev_ioctl));
50 in->ver_major = AUTOFS_DEV_IOCTL_VERSION_MAJOR; 119 in->ver_major = AUTOFS_DEV_IOCTL_VERSION_MAJOR;
51 in->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR; 120 in->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR;
52 in->size = sizeof(struct autofs_dev_ioctl); 121 in->size = sizeof(struct autofs_dev_ioctl);
53 in->ioctlfd = -1; 122 in->ioctlfd = -1;
54 in->arg1 = 0;
55 in->arg2 = 0;
56 return; 123 return;
57} 124}
58 125