1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
3 * Copyright 1997 Transmeta Corporation - 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.
9 * ----------------------------------------------------------------------- */
12 #ifndef _UAPI_LINUX_AUTO_FS_H
13 #define _UAPI_LINUX_AUTO_FS_H
15 #include <linux/types.h>
16 #include <linux/limits.h>
18 #include <sys/ioctl.h>
19 #endif /* __KERNEL__ */
22 /* This file describes autofs v3 */
23 #define AUTOFS_PROTO_VERSION 3
25 /* Range of protocol versions defined */
26 #define AUTOFS_MAX_PROTO_VERSION AUTOFS_PROTO_VERSION
27 #define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION
30 * The wait_queue_token (autofs_wqt_t) is part of a structure which is passed
31 * back to the kernel via ioctl from userspace. On architectures where 32- and
32 * 64-bit userspace binaries can be executed it's important that the size of
33 * autofs_wqt_t stays constant between 32- and 64-bit Linux kernels so that we
34 * do not break the binary ABI interface by changing the structure size.
36 #if defined(__ia64__) || defined(__alpha__) /* pure 64bit architectures */
37 typedef unsigned long autofs_wqt_t
;
39 typedef unsigned int autofs_wqt_t
;
43 #define autofs_ptype_missing 0 /* Missing entry (mount request) */
44 #define autofs_ptype_expire 1 /* Expire entry (umount request) */
46 struct autofs_packet_hdr
{
47 int proto_version
; /* Protocol version */
48 int type
; /* Type of packet */
51 struct autofs_packet_missing
{
52 struct autofs_packet_hdr hdr
;
53 autofs_wqt_t wait_queue_token
;
55 char name
[NAME_MAX
+1];
58 /* v3 expire (via ioctl) */
59 struct autofs_packet_expire
{
60 struct autofs_packet_hdr hdr
;
62 char name
[NAME_MAX
+1];
65 #define AUTOFS_IOCTL 0x93
68 AUTOFS_IOC_READY_CMD
= 0x60,
70 AUTOFS_IOC_CATATONIC_CMD
,
71 AUTOFS_IOC_PROTOVER_CMD
,
72 AUTOFS_IOC_SETTIMEOUT_CMD
,
73 AUTOFS_IOC_EXPIRE_CMD
,
76 #define AUTOFS_IOC_READY _IO(AUTOFS_IOCTL, AUTOFS_IOC_READY_CMD)
77 #define AUTOFS_IOC_FAIL _IO(AUTOFS_IOCTL, AUTOFS_IOC_FAIL_CMD)
78 #define AUTOFS_IOC_CATATONIC _IO(AUTOFS_IOCTL, AUTOFS_IOC_CATATONIC_CMD)
79 #define AUTOFS_IOC_PROTOVER _IOR(AUTOFS_IOCTL, AUTOFS_IOC_PROTOVER_CMD, int)
80 #define AUTOFS_IOC_SETTIMEOUT32 _IOWR(AUTOFS_IOCTL, AUTOFS_IOC_SETTIMEOUT_CMD, compat_ulong_t)
81 #define AUTOFS_IOC_SETTIMEOUT _IOWR(AUTOFS_IOCTL, AUTOFS_IOC_SETTIMEOUT_CMD, unsigned long)
82 #define AUTOFS_IOC_EXPIRE _IOR(AUTOFS_IOCTL, AUTOFS_IOC_EXPIRE_CMD, struct autofs_packet_expire)
84 #endif /* _UAPI_LINUX_AUTO_FS_H */