Ian Kent | e9a7c2f | 2016-03-15 14:58:25 -0700 | [diff] [blame] | 1 | /* |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 2 | * Copyright 1997 Transmeta Corporation - All Rights Reserved |
| 3 | * |
| 4 | * This file is part of the Linux kernel and is made available under |
| 5 | * the terms of the GNU General Public License, version 2, or at your |
| 6 | * option, any later version, incorporated herein by reference. |
| 7 | * |
| 8 | * ----------------------------------------------------------------------- */ |
| 9 | |
| 10 | |
| 11 | #ifndef _UAPI_LINUX_AUTO_FS_H |
| 12 | #define _UAPI_LINUX_AUTO_FS_H |
| 13 | |
| 14 | #include <linux/types.h> |
Tomohiro Kusumi | f58b3c9 | 2016-10-11 13:53:10 -0700 | [diff] [blame] | 15 | #include <linux/limits.h> |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 16 | #ifndef __KERNEL__ |
| 17 | #include <sys/ioctl.h> |
| 18 | #endif /* __KERNEL__ */ |
| 19 | |
| 20 | |
| 21 | /* This file describes autofs v3 */ |
| 22 | #define AUTOFS_PROTO_VERSION 3 |
| 23 | |
| 24 | /* Range of protocol versions defined */ |
| 25 | #define AUTOFS_MAX_PROTO_VERSION AUTOFS_PROTO_VERSION |
| 26 | #define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION |
| 27 | |
| 28 | /* |
Ingo Molnar | ac6424b | 2017-06-20 12:06:13 +0200 | [diff] [blame] | 29 | * The wait_queue_entry_token (autofs_wqt_t) is part of a structure which is passed |
Helge Deller | 4f4ffc3 | 2013-02-04 19:39:52 +0000 | [diff] [blame] | 30 | * back to the kernel via ioctl from userspace. On architectures where 32- and |
| 31 | * 64-bit userspace binaries can be executed it's important that the size of |
| 32 | * autofs_wqt_t stays constant between 32- and 64-bit Linux kernels so that we |
| 33 | * do not break the binary ABI interface by changing the structure size. |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 34 | */ |
Helge Deller | 4f4ffc3 | 2013-02-04 19:39:52 +0000 | [diff] [blame] | 35 | #if defined(__ia64__) || defined(__alpha__) /* pure 64bit architectures */ |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 36 | typedef unsigned long autofs_wqt_t; |
Helge Deller | 4f4ffc3 | 2013-02-04 19:39:52 +0000 | [diff] [blame] | 37 | #else |
| 38 | typedef unsigned int autofs_wqt_t; |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 39 | #endif |
| 40 | |
| 41 | /* Packet types */ |
| 42 | #define autofs_ptype_missing 0 /* Missing entry (mount request) */ |
| 43 | #define autofs_ptype_expire 1 /* Expire entry (umount request) */ |
| 44 | |
| 45 | struct autofs_packet_hdr { |
| 46 | int proto_version; /* Protocol version */ |
| 47 | int type; /* Type of packet */ |
| 48 | }; |
| 49 | |
| 50 | struct autofs_packet_missing { |
| 51 | struct autofs_packet_hdr hdr; |
Ingo Molnar | ac6424b | 2017-06-20 12:06:13 +0200 | [diff] [blame] | 52 | autofs_wqt_t wait_queue_entry_token; |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 53 | int len; |
| 54 | char name[NAME_MAX+1]; |
| 55 | }; |
| 56 | |
| 57 | /* v3 expire (via ioctl) */ |
| 58 | struct autofs_packet_expire { |
| 59 | struct autofs_packet_hdr hdr; |
| 60 | int len; |
| 61 | char name[NAME_MAX+1]; |
| 62 | }; |
| 63 | |
Tomohiro Kusumi | 0fae77f | 2017-02-27 14:27:11 -0800 | [diff] [blame] | 64 | #define AUTOFS_IOCTL 0x93 |
| 65 | |
| 66 | enum { |
| 67 | AUTOFS_IOC_READY_CMD = 0x60, |
| 68 | AUTOFS_IOC_FAIL_CMD, |
| 69 | AUTOFS_IOC_CATATONIC_CMD, |
| 70 | AUTOFS_IOC_PROTOVER_CMD, |
| 71 | AUTOFS_IOC_SETTIMEOUT_CMD, |
| 72 | AUTOFS_IOC_EXPIRE_CMD, |
| 73 | }; |
| 74 | |
| 75 | #define AUTOFS_IOC_READY _IO(AUTOFS_IOCTL, AUTOFS_IOC_READY_CMD) |
| 76 | #define AUTOFS_IOC_FAIL _IO(AUTOFS_IOCTL, AUTOFS_IOC_FAIL_CMD) |
| 77 | #define AUTOFS_IOC_CATATONIC _IO(AUTOFS_IOCTL, AUTOFS_IOC_CATATONIC_CMD) |
| 78 | #define AUTOFS_IOC_PROTOVER _IOR(AUTOFS_IOCTL, AUTOFS_IOC_PROTOVER_CMD, int) |
| 79 | #define AUTOFS_IOC_SETTIMEOUT32 _IOWR(AUTOFS_IOCTL, AUTOFS_IOC_SETTIMEOUT_CMD, compat_ulong_t) |
| 80 | #define AUTOFS_IOC_SETTIMEOUT _IOWR(AUTOFS_IOCTL, AUTOFS_IOC_SETTIMEOUT_CMD, unsigned long) |
| 81 | #define AUTOFS_IOC_EXPIRE _IOR(AUTOFS_IOCTL, AUTOFS_IOC_EXPIRE_CMD, struct autofs_packet_expire) |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 82 | |
| 83 | #endif /* _UAPI_LINUX_AUTO_FS_H */ |