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 _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 1
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, AUTOFS_DEV_IOCTL_SIZE);
117 in->ver_major = AUTOFS_DEV_IOCTL_VERSION_MAJOR;
118 in->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR;
119 in->size = AUTOFS_DEV_IOCTL_SIZE;
124 /* Get various version info */
125 AUTOFS_DEV_IOCTL_VERSION_CMD = 0x71,
126 AUTOFS_DEV_IOCTL_PROTOVER_CMD,
127 AUTOFS_DEV_IOCTL_PROTOSUBVER_CMD,
129 /* Open mount ioctl fd */
130 AUTOFS_DEV_IOCTL_OPENMOUNT_CMD,
132 /* Close mount ioctl fd */
133 AUTOFS_DEV_IOCTL_CLOSEMOUNT_CMD,
135 /* Mount/expire status returns */
136 AUTOFS_DEV_IOCTL_READY_CMD,
137 AUTOFS_DEV_IOCTL_FAIL_CMD,
139 /* Activate/deactivate autofs mount */
140 AUTOFS_DEV_IOCTL_SETPIPEFD_CMD,
141 AUTOFS_DEV_IOCTL_CATATONIC_CMD,
144 AUTOFS_DEV_IOCTL_TIMEOUT_CMD,
146 /* Get mount last requesting uid and gid */
147 AUTOFS_DEV_IOCTL_REQUESTER_CMD,
149 /* Check for eligible expire candidates */
150 AUTOFS_DEV_IOCTL_EXPIRE_CMD,
152 /* Request busy status */
153 AUTOFS_DEV_IOCTL_ASKUMOUNT_CMD,
155 /* Check if path is a mountpoint */
156 AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD,
159 #define AUTOFS_DEV_IOCTL_VERSION \
160 _IOWR(AUTOFS_IOCTL, \
161 AUTOFS_DEV_IOCTL_VERSION_CMD, struct autofs_dev_ioctl)
163 #define AUTOFS_DEV_IOCTL_PROTOVER \
164 _IOWR(AUTOFS_IOCTL, \
165 AUTOFS_DEV_IOCTL_PROTOVER_CMD, struct autofs_dev_ioctl)
167 #define AUTOFS_DEV_IOCTL_PROTOSUBVER \
168 _IOWR(AUTOFS_IOCTL, \
169 AUTOFS_DEV_IOCTL_PROTOSUBVER_CMD, struct autofs_dev_ioctl)
171 #define AUTOFS_DEV_IOCTL_OPENMOUNT \
172 _IOWR(AUTOFS_IOCTL, \
173 AUTOFS_DEV_IOCTL_OPENMOUNT_CMD, struct autofs_dev_ioctl)
175 #define AUTOFS_DEV_IOCTL_CLOSEMOUNT \
176 _IOWR(AUTOFS_IOCTL, \
177 AUTOFS_DEV_IOCTL_CLOSEMOUNT_CMD, struct autofs_dev_ioctl)
179 #define AUTOFS_DEV_IOCTL_READY \
180 _IOWR(AUTOFS_IOCTL, \
181 AUTOFS_DEV_IOCTL_READY_CMD, struct autofs_dev_ioctl)
183 #define AUTOFS_DEV_IOCTL_FAIL \
184 _IOWR(AUTOFS_IOCTL, \
185 AUTOFS_DEV_IOCTL_FAIL_CMD, struct autofs_dev_ioctl)
187 #define AUTOFS_DEV_IOCTL_SETPIPEFD \
188 _IOWR(AUTOFS_IOCTL, \
189 AUTOFS_DEV_IOCTL_SETPIPEFD_CMD, struct autofs_dev_ioctl)
191 #define AUTOFS_DEV_IOCTL_CATATONIC \
192 _IOWR(AUTOFS_IOCTL, \
193 AUTOFS_DEV_IOCTL_CATATONIC_CMD, struct autofs_dev_ioctl)
195 #define AUTOFS_DEV_IOCTL_TIMEOUT \
196 _IOWR(AUTOFS_IOCTL, \
197 AUTOFS_DEV_IOCTL_TIMEOUT_CMD, struct autofs_dev_ioctl)
199 #define AUTOFS_DEV_IOCTL_REQUESTER \
200 _IOWR(AUTOFS_IOCTL, \
201 AUTOFS_DEV_IOCTL_REQUESTER_CMD, struct autofs_dev_ioctl)
203 #define AUTOFS_DEV_IOCTL_EXPIRE \
204 _IOWR(AUTOFS_IOCTL, \
205 AUTOFS_DEV_IOCTL_EXPIRE_CMD, struct autofs_dev_ioctl)
207 #define AUTOFS_DEV_IOCTL_ASKUMOUNT \
208 _IOWR(AUTOFS_IOCTL, \
209 AUTOFS_DEV_IOCTL_ASKUMOUNT_CMD, struct autofs_dev_ioctl)
211 #define AUTOFS_DEV_IOCTL_ISMOUNTPOINT \
212 _IOWR(AUTOFS_IOCTL, \
213 AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD, struct autofs_dev_ioctl)
215 #endif /* _UAPI_LINUX_AUTO_DEV_IOCTL_H */