2 * Copyright 2008 Red Hat, Inc. All rights reserved.
3 * Copyright 2008 Ian Kent <raven@themaw.net>
5 * This file is part of the Linux kernel and is made available under
6 * the terms of the GNU General Public License, version 2, or at your
7 * option, any later version, incorporated herein by reference.
10 #ifndef _UAPI_LINUX_AUTO_DEV_IOCTL_H
11 #define _UAPI_LINUX_AUTO_DEV_IOCTL_H
13 #include <linux/auto_fs.h>
14 #include <linux/string.h>
16 #define AUTOFS_DEVICE_NAME "autofs"
18 #define AUTOFS_DEV_IOCTL_VERSION_MAJOR 1
19 #define AUTOFS_DEV_IOCTL_VERSION_MINOR 0
21 #define AUTOFS_DEV_IOCTL_SIZE sizeof(struct autofs_dev_ioctl)
24 * An ioctl interface for autofs mount point control.
27 struct args_protover {
31 struct args_protosubver {
35 struct args_openmount {
48 struct args_setpipefd {
56 struct args_requester {
65 struct args_askumount {
69 struct args_ismountpoint {
82 * All the ioctls use this structure.
83 * When sending a path size must account for the total length
84 * of the chunk of memory otherwise is is the size of the
88 struct autofs_dev_ioctl {
91 __u32 size; /* total size of data passed in
92 * including this struct */
93 __s32 ioctlfd; /* automount command fd */
95 /* Command parameters */
98 struct args_protover protover;
99 struct args_protosubver protosubver;
100 struct args_openmount openmount;
101 struct args_ready ready;
102 struct args_fail fail;
103 struct args_setpipefd setpipefd;
104 struct args_timeout timeout;
105 struct args_requester requester;
106 struct args_expire expire;
107 struct args_askumount askumount;
108 struct args_ismountpoint ismountpoint;
114 static inline void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in)
116 memset(in, 0, sizeof(struct autofs_dev_ioctl));
117 in->ver_major = AUTOFS_DEV_IOCTL_VERSION_MAJOR;
118 in->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR;
119 in->size = sizeof(struct autofs_dev_ioctl);
124 * If you change this make sure you make the corresponding change
125 * to autofs-dev-ioctl.c:lookup_ioctl()
128 /* Get various version info */
129 AUTOFS_DEV_IOCTL_VERSION_CMD = 0x71,
130 AUTOFS_DEV_IOCTL_PROTOVER_CMD,
131 AUTOFS_DEV_IOCTL_PROTOSUBVER_CMD,
133 /* Open mount ioctl fd */
134 AUTOFS_DEV_IOCTL_OPENMOUNT_CMD,
136 /* Close mount ioctl fd */
137 AUTOFS_DEV_IOCTL_CLOSEMOUNT_CMD,
139 /* Mount/expire status returns */
140 AUTOFS_DEV_IOCTL_READY_CMD,
141 AUTOFS_DEV_IOCTL_FAIL_CMD,
143 /* Activate/deactivate autofs mount */
144 AUTOFS_DEV_IOCTL_SETPIPEFD_CMD,
145 AUTOFS_DEV_IOCTL_CATATONIC_CMD,
148 AUTOFS_DEV_IOCTL_TIMEOUT_CMD,
150 /* Get mount last requesting uid and gid */
151 AUTOFS_DEV_IOCTL_REQUESTER_CMD,
153 /* Check for eligible expire candidates */
154 AUTOFS_DEV_IOCTL_EXPIRE_CMD,
156 /* Request busy status */
157 AUTOFS_DEV_IOCTL_ASKUMOUNT_CMD,
159 /* Check if path is a mountpoint */
160 AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD,
163 #define AUTOFS_IOCTL 0x93
165 #define AUTOFS_DEV_IOCTL_VERSION \
166 _IOWR(AUTOFS_IOCTL, \
167 AUTOFS_DEV_IOCTL_VERSION_CMD, struct autofs_dev_ioctl)
169 #define AUTOFS_DEV_IOCTL_PROTOVER \
170 _IOWR(AUTOFS_IOCTL, \
171 AUTOFS_DEV_IOCTL_PROTOVER_CMD, struct autofs_dev_ioctl)
173 #define AUTOFS_DEV_IOCTL_PROTOSUBVER \
174 _IOWR(AUTOFS_IOCTL, \
175 AUTOFS_DEV_IOCTL_PROTOSUBVER_CMD, struct autofs_dev_ioctl)
177 #define AUTOFS_DEV_IOCTL_OPENMOUNT \
178 _IOWR(AUTOFS_IOCTL, \
179 AUTOFS_DEV_IOCTL_OPENMOUNT_CMD, struct autofs_dev_ioctl)
181 #define AUTOFS_DEV_IOCTL_CLOSEMOUNT \
182 _IOWR(AUTOFS_IOCTL, \
183 AUTOFS_DEV_IOCTL_CLOSEMOUNT_CMD, struct autofs_dev_ioctl)
185 #define AUTOFS_DEV_IOCTL_READY \
186 _IOWR(AUTOFS_IOCTL, \
187 AUTOFS_DEV_IOCTL_READY_CMD, struct autofs_dev_ioctl)
189 #define AUTOFS_DEV_IOCTL_FAIL \
190 _IOWR(AUTOFS_IOCTL, \
191 AUTOFS_DEV_IOCTL_FAIL_CMD, struct autofs_dev_ioctl)
193 #define AUTOFS_DEV_IOCTL_SETPIPEFD \
194 _IOWR(AUTOFS_IOCTL, \
195 AUTOFS_DEV_IOCTL_SETPIPEFD_CMD, struct autofs_dev_ioctl)
197 #define AUTOFS_DEV_IOCTL_CATATONIC \
198 _IOWR(AUTOFS_IOCTL, \
199 AUTOFS_DEV_IOCTL_CATATONIC_CMD, struct autofs_dev_ioctl)
201 #define AUTOFS_DEV_IOCTL_TIMEOUT \
202 _IOWR(AUTOFS_IOCTL, \
203 AUTOFS_DEV_IOCTL_TIMEOUT_CMD, struct autofs_dev_ioctl)
205 #define AUTOFS_DEV_IOCTL_REQUESTER \
206 _IOWR(AUTOFS_IOCTL, \
207 AUTOFS_DEV_IOCTL_REQUESTER_CMD, struct autofs_dev_ioctl)
209 #define AUTOFS_DEV_IOCTL_EXPIRE \
210 _IOWR(AUTOFS_IOCTL, \
211 AUTOFS_DEV_IOCTL_EXPIRE_CMD, struct autofs_dev_ioctl)
213 #define AUTOFS_DEV_IOCTL_ASKUMOUNT \
214 _IOWR(AUTOFS_IOCTL, \
215 AUTOFS_DEV_IOCTL_ASKUMOUNT_CMD, struct autofs_dev_ioctl)
217 #define AUTOFS_DEV_IOCTL_ISMOUNTPOINT \
218 _IOWR(AUTOFS_IOCTL, \
219 AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD, struct autofs_dev_ioctl)
221 #endif /* _UAPI_LINUX_AUTO_DEV_IOCTL_H */