2 * Copyright 2008 Red Hat, Inc. All rights reserved.
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 _LINUX_AUTO_DEV_IOCTL_H
11 #define _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_DEVID_LEN 16
23 #define AUTOFS_DEV_IOCTL_SIZE sizeof(struct autofs_dev_ioctl)
26 * An ioctl interface for autofs mount point control.
29 struct args_protover {
33 struct args_protosubver {
37 struct args_openmount {
50 struct args_setpipefd {
58 struct args_requester {
67 struct args_askumount {
71 struct args_ismountpoint {
84 * All the ioctls use this structure.
85 * When sending a path size must account for the total length
86 * of the chunk of memory otherwise is is the size of the
90 struct autofs_dev_ioctl {
93 __u32 size; /* total size of data passed in
94 * including this struct */
95 __s32 ioctlfd; /* automount command fd */
97 /* Command parameters */
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;
116 static inline void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in)
118 memset(in, 0, sizeof(struct autofs_dev_ioctl));
119 in->ver_major = AUTOFS_DEV_IOCTL_VERSION_MAJOR;
120 in->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR;
121 in->size = sizeof(struct autofs_dev_ioctl);
126 * If you change this make sure you make the corresponding change
127 * to autofs-dev-ioctl.c:lookup_ioctl()
130 /* Get various version info */
131 AUTOFS_DEV_IOCTL_VERSION_CMD = 0x71,
132 AUTOFS_DEV_IOCTL_PROTOVER_CMD,
133 AUTOFS_DEV_IOCTL_PROTOSUBVER_CMD,
135 /* Open mount ioctl fd */
136 AUTOFS_DEV_IOCTL_OPENMOUNT_CMD,
138 /* Close mount ioctl fd */
139 AUTOFS_DEV_IOCTL_CLOSEMOUNT_CMD,
141 /* Mount/expire status returns */
142 AUTOFS_DEV_IOCTL_READY_CMD,
143 AUTOFS_DEV_IOCTL_FAIL_CMD,
145 /* Activate/deactivate autofs mount */
146 AUTOFS_DEV_IOCTL_SETPIPEFD_CMD,
147 AUTOFS_DEV_IOCTL_CATATONIC_CMD,
150 AUTOFS_DEV_IOCTL_TIMEOUT_CMD,
152 /* Get mount last requesting uid and gid */
153 AUTOFS_DEV_IOCTL_REQUESTER_CMD,
155 /* Check for eligible expire candidates */
156 AUTOFS_DEV_IOCTL_EXPIRE_CMD,
158 /* Request busy status */
159 AUTOFS_DEV_IOCTL_ASKUMOUNT_CMD,
161 /* Check if path is a mountpoint */
162 AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD,
165 #define AUTOFS_IOCTL 0x93
167 #define AUTOFS_DEV_IOCTL_VERSION \
168 _IOWR(AUTOFS_IOCTL, \
169 AUTOFS_DEV_IOCTL_VERSION_CMD, struct autofs_dev_ioctl)
171 #define AUTOFS_DEV_IOCTL_PROTOVER \
172 _IOWR(AUTOFS_IOCTL, \
173 AUTOFS_DEV_IOCTL_PROTOVER_CMD, struct autofs_dev_ioctl)
175 #define AUTOFS_DEV_IOCTL_PROTOSUBVER \
176 _IOWR(AUTOFS_IOCTL, \
177 AUTOFS_DEV_IOCTL_PROTOSUBVER_CMD, struct autofs_dev_ioctl)
179 #define AUTOFS_DEV_IOCTL_OPENMOUNT \
180 _IOWR(AUTOFS_IOCTL, \
181 AUTOFS_DEV_IOCTL_OPENMOUNT_CMD, struct autofs_dev_ioctl)
183 #define AUTOFS_DEV_IOCTL_CLOSEMOUNT \
184 _IOWR(AUTOFS_IOCTL, \
185 AUTOFS_DEV_IOCTL_CLOSEMOUNT_CMD, struct autofs_dev_ioctl)
187 #define AUTOFS_DEV_IOCTL_READY \
188 _IOWR(AUTOFS_IOCTL, \
189 AUTOFS_DEV_IOCTL_READY_CMD, struct autofs_dev_ioctl)
191 #define AUTOFS_DEV_IOCTL_FAIL \
192 _IOWR(AUTOFS_IOCTL, \
193 AUTOFS_DEV_IOCTL_FAIL_CMD, struct autofs_dev_ioctl)
195 #define AUTOFS_DEV_IOCTL_SETPIPEFD \
196 _IOWR(AUTOFS_IOCTL, \
197 AUTOFS_DEV_IOCTL_SETPIPEFD_CMD, struct autofs_dev_ioctl)
199 #define AUTOFS_DEV_IOCTL_CATATONIC \
200 _IOWR(AUTOFS_IOCTL, \
201 AUTOFS_DEV_IOCTL_CATATONIC_CMD, struct autofs_dev_ioctl)
203 #define AUTOFS_DEV_IOCTL_TIMEOUT \
204 _IOWR(AUTOFS_IOCTL, \
205 AUTOFS_DEV_IOCTL_TIMEOUT_CMD, struct autofs_dev_ioctl)
207 #define AUTOFS_DEV_IOCTL_REQUESTER \
208 _IOWR(AUTOFS_IOCTL, \
209 AUTOFS_DEV_IOCTL_REQUESTER_CMD, struct autofs_dev_ioctl)
211 #define AUTOFS_DEV_IOCTL_EXPIRE \
212 _IOWR(AUTOFS_IOCTL, \
213 AUTOFS_DEV_IOCTL_EXPIRE_CMD, struct autofs_dev_ioctl)
215 #define AUTOFS_DEV_IOCTL_ASKUMOUNT \
216 _IOWR(AUTOFS_IOCTL, \
217 AUTOFS_DEV_IOCTL_ASKUMOUNT_CMD, struct autofs_dev_ioctl)
219 #define AUTOFS_DEV_IOCTL_ISMOUNTPOINT \
220 _IOWR(AUTOFS_IOCTL, \
221 AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD, struct autofs_dev_ioctl)
223 #endif /* _LINUX_AUTO_DEV_IOCTL_H */