Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / include / uapi / linux / auto_dev-ioctl.h
blob08be539605fcab76bcb06593be4c2cd2676f6cf8
1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2 /*
3 * Copyright 2008 Red Hat, Inc. All rights reserved.
4 * Copyright 2008 Ian Kent <raven@themaw.net>
6 * This file is part of the Linux kernel and is made available under
7 * the terms of the GNU General Public License, version 2, or at your
8 * option, any later version, incorporated herein by reference.
9 */
11 #ifndef _UAPI_LINUX_AUTO_DEV_IOCTL_H
12 #define _UAPI_LINUX_AUTO_DEV_IOCTL_H
14 #include <linux/auto_fs.h>
15 #include <linux/string.h>
17 #define AUTOFS_DEVICE_NAME "autofs"
19 #define AUTOFS_DEV_IOCTL_VERSION_MAJOR 1
20 #define AUTOFS_DEV_IOCTL_VERSION_MINOR 1
22 #define AUTOFS_DEV_IOCTL_SIZE sizeof(struct autofs_dev_ioctl)
25 * An ioctl interface for autofs mount point control.
28 struct args_protover {
29 __u32 version;
32 struct args_protosubver {
33 __u32 sub_version;
36 struct args_openmount {
37 __u32 devid;
40 struct args_ready {
41 __u32 token;
44 struct args_fail {
45 __u32 token;
46 __s32 status;
49 struct args_setpipefd {
50 __s32 pipefd;
53 struct args_timeout {
54 __u64 timeout;
57 struct args_requester {
58 __u32 uid;
59 __u32 gid;
62 struct args_expire {
63 __u32 how;
66 struct args_askumount {
67 __u32 may_umount;
70 struct args_ismountpoint {
71 union {
72 struct args_in {
73 __u32 type;
74 } in;
75 struct args_out {
76 __u32 devid;
77 __u32 magic;
78 } out;
83 * All the ioctls use this structure.
84 * When sending a path size must account for the total length
85 * of the chunk of memory otherwise it is the size of the
86 * structure.
89 struct autofs_dev_ioctl {
90 __u32 ver_major;
91 __u32 ver_minor;
92 __u32 size; /* total size of data passed in
93 * including this struct */
94 __s32 ioctlfd; /* automount command fd */
96 /* Command parameters */
98 union {
99 struct args_protover protover;
100 struct args_protosubver protosubver;
101 struct args_openmount openmount;
102 struct args_ready ready;
103 struct args_fail fail;
104 struct args_setpipefd setpipefd;
105 struct args_timeout timeout;
106 struct args_requester requester;
107 struct args_expire expire;
108 struct args_askumount askumount;
109 struct args_ismountpoint ismountpoint;
112 char path[];
115 static inline void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in)
117 memset(in, 0, AUTOFS_DEV_IOCTL_SIZE);
118 in->ver_major = AUTOFS_DEV_IOCTL_VERSION_MAJOR;
119 in->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR;
120 in->size = AUTOFS_DEV_IOCTL_SIZE;
121 in->ioctlfd = -1;
124 enum {
125 /* Get various version info */
126 AUTOFS_DEV_IOCTL_VERSION_CMD = 0x71,
127 AUTOFS_DEV_IOCTL_PROTOVER_CMD,
128 AUTOFS_DEV_IOCTL_PROTOSUBVER_CMD,
130 /* Open mount ioctl fd */
131 AUTOFS_DEV_IOCTL_OPENMOUNT_CMD,
133 /* Close mount ioctl fd */
134 AUTOFS_DEV_IOCTL_CLOSEMOUNT_CMD,
136 /* Mount/expire status returns */
137 AUTOFS_DEV_IOCTL_READY_CMD,
138 AUTOFS_DEV_IOCTL_FAIL_CMD,
140 /* Activate/deactivate autofs mount */
141 AUTOFS_DEV_IOCTL_SETPIPEFD_CMD,
142 AUTOFS_DEV_IOCTL_CATATONIC_CMD,
144 /* Expiry timeout */
145 AUTOFS_DEV_IOCTL_TIMEOUT_CMD,
147 /* Get mount last requesting uid and gid */
148 AUTOFS_DEV_IOCTL_REQUESTER_CMD,
150 /* Check for eligible expire candidates */
151 AUTOFS_DEV_IOCTL_EXPIRE_CMD,
153 /* Request busy status */
154 AUTOFS_DEV_IOCTL_ASKUMOUNT_CMD,
156 /* Check if path is a mountpoint */
157 AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD,
160 #define AUTOFS_DEV_IOCTL_VERSION \
161 _IOWR(AUTOFS_IOCTL, \
162 AUTOFS_DEV_IOCTL_VERSION_CMD, struct autofs_dev_ioctl)
164 #define AUTOFS_DEV_IOCTL_PROTOVER \
165 _IOWR(AUTOFS_IOCTL, \
166 AUTOFS_DEV_IOCTL_PROTOVER_CMD, struct autofs_dev_ioctl)
168 #define AUTOFS_DEV_IOCTL_PROTOSUBVER \
169 _IOWR(AUTOFS_IOCTL, \
170 AUTOFS_DEV_IOCTL_PROTOSUBVER_CMD, struct autofs_dev_ioctl)
172 #define AUTOFS_DEV_IOCTL_OPENMOUNT \
173 _IOWR(AUTOFS_IOCTL, \
174 AUTOFS_DEV_IOCTL_OPENMOUNT_CMD, struct autofs_dev_ioctl)
176 #define AUTOFS_DEV_IOCTL_CLOSEMOUNT \
177 _IOWR(AUTOFS_IOCTL, \
178 AUTOFS_DEV_IOCTL_CLOSEMOUNT_CMD, struct autofs_dev_ioctl)
180 #define AUTOFS_DEV_IOCTL_READY \
181 _IOWR(AUTOFS_IOCTL, \
182 AUTOFS_DEV_IOCTL_READY_CMD, struct autofs_dev_ioctl)
184 #define AUTOFS_DEV_IOCTL_FAIL \
185 _IOWR(AUTOFS_IOCTL, \
186 AUTOFS_DEV_IOCTL_FAIL_CMD, struct autofs_dev_ioctl)
188 #define AUTOFS_DEV_IOCTL_SETPIPEFD \
189 _IOWR(AUTOFS_IOCTL, \
190 AUTOFS_DEV_IOCTL_SETPIPEFD_CMD, struct autofs_dev_ioctl)
192 #define AUTOFS_DEV_IOCTL_CATATONIC \
193 _IOWR(AUTOFS_IOCTL, \
194 AUTOFS_DEV_IOCTL_CATATONIC_CMD, struct autofs_dev_ioctl)
196 #define AUTOFS_DEV_IOCTL_TIMEOUT \
197 _IOWR(AUTOFS_IOCTL, \
198 AUTOFS_DEV_IOCTL_TIMEOUT_CMD, struct autofs_dev_ioctl)
200 #define AUTOFS_DEV_IOCTL_REQUESTER \
201 _IOWR(AUTOFS_IOCTL, \
202 AUTOFS_DEV_IOCTL_REQUESTER_CMD, struct autofs_dev_ioctl)
204 #define AUTOFS_DEV_IOCTL_EXPIRE \
205 _IOWR(AUTOFS_IOCTL, \
206 AUTOFS_DEV_IOCTL_EXPIRE_CMD, struct autofs_dev_ioctl)
208 #define AUTOFS_DEV_IOCTL_ASKUMOUNT \
209 _IOWR(AUTOFS_IOCTL, \
210 AUTOFS_DEV_IOCTL_ASKUMOUNT_CMD, struct autofs_dev_ioctl)
212 #define AUTOFS_DEV_IOCTL_ISMOUNTPOINT \
213 _IOWR(AUTOFS_IOCTL, \
214 AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD, struct autofs_dev_ioctl)
216 #endif /* _UAPI_LINUX_AUTO_DEV_IOCTL_H */