8 */ |
8 */ |
9 |
9 |
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" |
16 |
17 |
17 #define AUTOFS_DEV_IOCTL_VERSION_MAJOR 1 |
18 #define AUTOFS_DEV_IOCTL_VERSION_MAJOR 1 |
22 #define AUTOFS_DEV_IOCTL_SIZE sizeof(struct autofs_dev_ioctl) |
23 #define AUTOFS_DEV_IOCTL_SIZE sizeof(struct autofs_dev_ioctl) |
23 |
24 |
24 /* |
25 /* |
25 * An ioctl interface for autofs mount point control. |
26 * An ioctl interface for autofs mount point control. |
26 */ |
27 */ |
|
28 |
|
29 struct args_protover { |
|
30 __u32 version; |
|
31 }; |
|
32 |
|
33 struct args_protosubver { |
|
34 __u32 sub_version; |
|
35 }; |
|
36 |
|
37 struct args_openmount { |
|
38 __u32 devid; |
|
39 }; |
|
40 |
|
41 struct args_ready { |
|
42 __u32 token; |
|
43 }; |
|
44 |
|
45 struct args_fail { |
|
46 __u32 token; |
|
47 __s32 status; |
|
48 }; |
|
49 |
|
50 struct args_setpipefd { |
|
51 __s32 pipefd; |
|
52 }; |
|
53 |
|
54 struct args_timeout { |
|
55 __u64 timeout; |
|
56 }; |
|
57 |
|
58 struct args_requester { |
|
59 __u32 uid; |
|
60 __u32 gid; |
|
61 }; |
|
62 |
|
63 struct args_expire { |
|
64 __u32 how; |
|
65 }; |
|
66 |
|
67 struct args_askumount { |
|
68 __u32 may_umount; |
|
69 }; |
|
70 |
|
71 struct 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 }; |
27 |
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 |
31 * of the chunk of memory otherwise is is the size of the |
86 * of the chunk of memory otherwise is is the size of the |
37 __u32 ver_minor; |
92 __u32 ver_minor; |
38 __u32 size; /* total size of data passed in |
93 __u32 size; /* total size of data passed in |
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 |
48 static inline void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in) |
116 static 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 |
59 /* |
126 /* |
60 * If you change this make sure you make the corresponding change |
127 * If you change this make sure you make the corresponding change |