This source file includes following definitions.
- set_autofs_type_indirect
- autofs_type_indirect
- set_autofs_type_direct
- autofs_type_direct
- set_autofs_type_offset
- autofs_type_offset
- autofs_type_trigger
- set_autofs_type_any
- autofs_type_any
1
2
3
4
5
6
7
8
9
10
11
12
13 #ifndef _UAPI_LINUX_AUTO_FS_H
14 #define _UAPI_LINUX_AUTO_FS_H
15
16 #include <linux/types.h>
17 #include <linux/limits.h>
18 #ifndef __KERNEL__
19 #include <sys/ioctl.h>
20 #endif
21
22 #define AUTOFS_PROTO_VERSION 5
23 #define AUTOFS_MIN_PROTO_VERSION 3
24 #define AUTOFS_MAX_PROTO_VERSION 5
25
26 #define AUTOFS_PROTO_SUBVERSION 5
27
28
29
30
31
32
33
34
35 #if defined(__ia64__) || defined(__alpha__)
36 typedef unsigned long autofs_wqt_t;
37 #else
38 typedef unsigned int autofs_wqt_t;
39 #endif
40
41
42 #define autofs_ptype_missing 0
43 #define autofs_ptype_expire 1
44
45 struct autofs_packet_hdr {
46 int proto_version;
47 int type;
48 };
49
50 struct autofs_packet_missing {
51 struct autofs_packet_hdr hdr;
52 autofs_wqt_t wait_queue_token;
53 int len;
54 char name[NAME_MAX+1];
55 };
56
57
58 struct autofs_packet_expire {
59 struct autofs_packet_hdr hdr;
60 int len;
61 char name[NAME_MAX+1];
62 };
63
64 #define AUTOFS_IOCTL 0x93
65
66 enum {
67 AUTOFS_IOC_READY_CMD = 0x60,
68 AUTOFS_IOC_FAIL_CMD,
69 AUTOFS_IOC_CATATONIC_CMD,
70 AUTOFS_IOC_PROTOVER_CMD,
71 AUTOFS_IOC_SETTIMEOUT_CMD,
72 AUTOFS_IOC_EXPIRE_CMD,
73 };
74
75 #define AUTOFS_IOC_READY _IO(AUTOFS_IOCTL, AUTOFS_IOC_READY_CMD)
76 #define AUTOFS_IOC_FAIL _IO(AUTOFS_IOCTL, AUTOFS_IOC_FAIL_CMD)
77 #define AUTOFS_IOC_CATATONIC _IO(AUTOFS_IOCTL, AUTOFS_IOC_CATATONIC_CMD)
78 #define AUTOFS_IOC_PROTOVER _IOR(AUTOFS_IOCTL, \
79 AUTOFS_IOC_PROTOVER_CMD, int)
80 #define AUTOFS_IOC_SETTIMEOUT32 _IOWR(AUTOFS_IOCTL, \
81 AUTOFS_IOC_SETTIMEOUT_CMD, \
82 compat_ulong_t)
83 #define AUTOFS_IOC_SETTIMEOUT _IOWR(AUTOFS_IOCTL, \
84 AUTOFS_IOC_SETTIMEOUT_CMD, \
85 unsigned long)
86 #define AUTOFS_IOC_EXPIRE _IOR(AUTOFS_IOCTL, \
87 AUTOFS_IOC_EXPIRE_CMD, \
88 struct autofs_packet_expire)
89
90
91
92
93 #define AUTOFS_EXP_NORMAL 0x00
94 #define AUTOFS_EXP_IMMEDIATE 0x01
95 #define AUTOFS_EXP_LEAVES 0x02
96 #define AUTOFS_EXP_FORCED 0x04
97
98 #define AUTOFS_TYPE_ANY 0U
99 #define AUTOFS_TYPE_INDIRECT 1U
100 #define AUTOFS_TYPE_DIRECT 2U
101 #define AUTOFS_TYPE_OFFSET 4U
102
103 static inline void set_autofs_type_indirect(unsigned int *type)
104 {
105 *type = AUTOFS_TYPE_INDIRECT;
106 }
107
108 static inline unsigned int autofs_type_indirect(unsigned int type)
109 {
110 return (type == AUTOFS_TYPE_INDIRECT);
111 }
112
113 static inline void set_autofs_type_direct(unsigned int *type)
114 {
115 *type = AUTOFS_TYPE_DIRECT;
116 }
117
118 static inline unsigned int autofs_type_direct(unsigned int type)
119 {
120 return (type == AUTOFS_TYPE_DIRECT);
121 }
122
123 static inline void set_autofs_type_offset(unsigned int *type)
124 {
125 *type = AUTOFS_TYPE_OFFSET;
126 }
127
128 static inline unsigned int autofs_type_offset(unsigned int type)
129 {
130 return (type == AUTOFS_TYPE_OFFSET);
131 }
132
133 static inline unsigned int autofs_type_trigger(unsigned int type)
134 {
135 return (type == AUTOFS_TYPE_DIRECT || type == AUTOFS_TYPE_OFFSET);
136 }
137
138
139
140
141
142
143 static inline void set_autofs_type_any(unsigned int *type)
144 {
145 *type = AUTOFS_TYPE_ANY;
146 }
147
148 static inline unsigned int autofs_type_any(unsigned int type)
149 {
150 return (type == AUTOFS_TYPE_ANY);
151 }
152
153
154 enum autofs_notify {
155 NFY_NONE,
156 NFY_MOUNT,
157 NFY_EXPIRE
158 };
159
160
161
162
163 #define autofs_ptype_expire_multi 2
164
165
166
167
168 #define autofs_ptype_missing_indirect 3
169 #define autofs_ptype_expire_indirect 4
170
171
172 #define autofs_ptype_missing_direct 5
173 #define autofs_ptype_expire_direct 6
174
175
176 struct autofs_packet_expire_multi {
177 struct autofs_packet_hdr hdr;
178 autofs_wqt_t wait_queue_token;
179 int len;
180 char name[NAME_MAX+1];
181 };
182
183 union autofs_packet_union {
184 struct autofs_packet_hdr hdr;
185 struct autofs_packet_missing missing;
186 struct autofs_packet_expire expire;
187 struct autofs_packet_expire_multi expire_multi;
188 };
189
190
191 struct autofs_v5_packet {
192 struct autofs_packet_hdr hdr;
193 autofs_wqt_t wait_queue_token;
194 __u32 dev;
195 __u64 ino;
196 __u32 uid;
197 __u32 gid;
198 __u32 pid;
199 __u32 tgid;
200 __u32 len;
201 char name[NAME_MAX+1];
202 };
203
204 typedef struct autofs_v5_packet autofs_packet_missing_indirect_t;
205 typedef struct autofs_v5_packet autofs_packet_expire_indirect_t;
206 typedef struct autofs_v5_packet autofs_packet_missing_direct_t;
207 typedef struct autofs_v5_packet autofs_packet_expire_direct_t;
208
209 union autofs_v5_packet_union {
210 struct autofs_packet_hdr hdr;
211 struct autofs_v5_packet v5_packet;
212 autofs_packet_missing_indirect_t missing_indirect;
213 autofs_packet_expire_indirect_t expire_indirect;
214 autofs_packet_missing_direct_t missing_direct;
215 autofs_packet_expire_direct_t expire_direct;
216 };
217
218 enum {
219 AUTOFS_IOC_EXPIRE_MULTI_CMD = 0x66,
220 AUTOFS_IOC_PROTOSUBVER_CMD,
221 AUTOFS_IOC_ASKUMOUNT_CMD = 0x70,
222 };
223
224 #define AUTOFS_IOC_EXPIRE_MULTI _IOW(AUTOFS_IOCTL, \
225 AUTOFS_IOC_EXPIRE_MULTI_CMD, int)
226 #define AUTOFS_IOC_PROTOSUBVER _IOR(AUTOFS_IOCTL, \
227 AUTOFS_IOC_PROTOSUBVER_CMD, int)
228 #define AUTOFS_IOC_ASKUMOUNT _IOR(AUTOFS_IOCTL, \
229 AUTOFS_IOC_ASKUMOUNT_CMD, int)
230
231 #endif