diff options
| author | Ian Kent <raven@themaw.net> | 2018-06-07 20:11:05 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-07 20:34:39 -0400 |
| commit | ef8b42f78e883cb72fd781c2eff3a42d89c1c0c3 (patch) | |
| tree | 4fbdaa1a4b512809e1fa1c1d032217bdf7bb9bd8 /include/uapi/linux | |
| parent | 5cc41e099504b77014358b58567c5ea6293dd220 (diff) | |
autofs4: merge auto_fs.h and auto_fs4.h
The autofs module has long since been removed so there's no need to have
two separate include files for autofs.
Link: http://lkml.kernel.org/r/152626703024.28589.9571964661718767929.stgit@pluto.themaw.net
Signed-off-by: Ian Kent <raven@themaw.net>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/auto_fs.h | 169 | ||||
| -rw-r--r-- | include/uapi/linux/auto_fs4.h | 153 |
2 files changed, 160 insertions, 162 deletions
diff --git a/include/uapi/linux/auto_fs.h b/include/uapi/linux/auto_fs.h index 2a4432c7a4b4..e13eec3dfb2f 100644 --- a/include/uapi/linux/auto_fs.h +++ b/include/uapi/linux/auto_fs.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ | 1 | /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright 1997 Transmeta Corporation - All Rights Reserved | 3 | * Copyright 1997 Transmeta Corporation - All Rights Reserved |
| 4 | * Copyright 1999-2000 Jeremy Fitzhardinge <jeremy@goop.org> | ||
| 5 | * Copyright 2005-2006,2013,2017-2018 Ian Kent <raven@themaw.net> | ||
| 4 | * | 6 | * |
| 5 | * This file is part of the Linux kernel and is made available under | 7 | * 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 | 8 | * the terms of the GNU General Public License, version 2, or at your |
| @@ -8,7 +10,6 @@ | |||
| 8 | * | 10 | * |
| 9 | * ----------------------------------------------------------------------- */ | 11 | * ----------------------------------------------------------------------- */ |
| 10 | 12 | ||
| 11 | |||
| 12 | #ifndef _UAPI_LINUX_AUTO_FS_H | 13 | #ifndef _UAPI_LINUX_AUTO_FS_H |
| 13 | #define _UAPI_LINUX_AUTO_FS_H | 14 | #define _UAPI_LINUX_AUTO_FS_H |
| 14 | 15 | ||
| @@ -18,13 +19,11 @@ | |||
| 18 | #include <sys/ioctl.h> | 19 | #include <sys/ioctl.h> |
| 19 | #endif /* __KERNEL__ */ | 20 | #endif /* __KERNEL__ */ |
| 20 | 21 | ||
| 22 | #define AUTOFS_PROTO_VERSION 5 | ||
| 23 | #define AUTOFS_MIN_PROTO_VERSION 3 | ||
| 24 | #define AUTOFS_MAX_PROTO_VERSION 5 | ||
| 21 | 25 | ||
| 22 | /* This file describes autofs v3 */ | 26 | #define AUTOFS_PROTO_SUBVERSION 2 |
| 23 | #define AUTOFS_PROTO_VERSION 3 | ||
| 24 | |||
| 25 | /* Range of protocol versions defined */ | ||
| 26 | #define AUTOFS_MAX_PROTO_VERSION AUTOFS_PROTO_VERSION | ||
| 27 | #define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION | ||
| 28 | 27 | ||
| 29 | /* | 28 | /* |
| 30 | * The wait_queue_token (autofs_wqt_t) is part of a structure which is passed | 29 | * The wait_queue_token (autofs_wqt_t) is part of a structure which is passed |
| @@ -76,9 +75,155 @@ enum { | |||
| 76 | #define AUTOFS_IOC_READY _IO(AUTOFS_IOCTL, AUTOFS_IOC_READY_CMD) | 75 | #define AUTOFS_IOC_READY _IO(AUTOFS_IOCTL, AUTOFS_IOC_READY_CMD) |
| 77 | #define AUTOFS_IOC_FAIL _IO(AUTOFS_IOCTL, AUTOFS_IOC_FAIL_CMD) | 76 | #define AUTOFS_IOC_FAIL _IO(AUTOFS_IOCTL, AUTOFS_IOC_FAIL_CMD) |
| 78 | #define AUTOFS_IOC_CATATONIC _IO(AUTOFS_IOCTL, AUTOFS_IOC_CATATONIC_CMD) | 77 | #define AUTOFS_IOC_CATATONIC _IO(AUTOFS_IOCTL, AUTOFS_IOC_CATATONIC_CMD) |
| 79 | #define AUTOFS_IOC_PROTOVER _IOR(AUTOFS_IOCTL, AUTOFS_IOC_PROTOVER_CMD, int) | 78 | #define AUTOFS_IOC_PROTOVER _IOR(AUTOFS_IOCTL, \ |
| 80 | #define AUTOFS_IOC_SETTIMEOUT32 _IOWR(AUTOFS_IOCTL, AUTOFS_IOC_SETTIMEOUT_CMD, compat_ulong_t) | 79 | AUTOFS_IOC_PROTOVER_CMD, int) |
| 81 | #define AUTOFS_IOC_SETTIMEOUT _IOWR(AUTOFS_IOCTL, AUTOFS_IOC_SETTIMEOUT_CMD, unsigned long) | 80 | #define AUTOFS_IOC_SETTIMEOUT32 _IOWR(AUTOFS_IOCTL, \ |
| 82 | #define AUTOFS_IOC_EXPIRE _IOR(AUTOFS_IOCTL, AUTOFS_IOC_EXPIRE_CMD, struct autofs_packet_expire) | 81 | AUTOFS_IOC_SETTIMEOUT_CMD, \ |
| 82 | compat_ulong_t) | ||
| 83 | #define AUTOFS_IOC_SETTIMEOUT _IOWR(AUTOFS_IOCTL, \ | ||
| 84 | AUTOFS_IOC_SETTIMEOUT_CMD, \ | ||
| 85 | unsigned long) | ||
| 86 | #define AUTOFS_IOC_EXPIRE _IOR(AUTOFS_IOCTL, \ | ||
| 87 | AUTOFS_IOC_EXPIRE_CMD, \ | ||
| 88 | struct autofs_packet_expire) | ||
| 89 | |||
| 90 | /* autofs version 4 and later definitions */ | ||
| 91 | |||
| 92 | /* Mask for expire behaviour */ | ||
| 93 | #define AUTOFS_EXP_IMMEDIATE 1 | ||
| 94 | #define AUTOFS_EXP_LEAVES 2 | ||
| 95 | |||
| 96 | #define AUTOFS_TYPE_ANY 0U | ||
| 97 | #define AUTOFS_TYPE_INDIRECT 1U | ||
| 98 | #define AUTOFS_TYPE_DIRECT 2U | ||
| 99 | #define AUTOFS_TYPE_OFFSET 4U | ||
| 100 | |||
| 101 | static inline void set_autofs_type_indirect(unsigned int *type) | ||
| 102 | { | ||
| 103 | *type = AUTOFS_TYPE_INDIRECT; | ||
| 104 | } | ||
| 105 | |||
| 106 | static inline unsigned int autofs_type_indirect(unsigned int type) | ||
| 107 | { | ||
| 108 | return (type == AUTOFS_TYPE_INDIRECT); | ||
| 109 | } | ||
| 110 | |||
| 111 | static inline void set_autofs_type_direct(unsigned int *type) | ||
| 112 | { | ||
| 113 | *type = AUTOFS_TYPE_DIRECT; | ||
| 114 | } | ||
| 115 | |||
| 116 | static inline unsigned int autofs_type_direct(unsigned int type) | ||
| 117 | { | ||
| 118 | return (type == AUTOFS_TYPE_DIRECT); | ||
| 119 | } | ||
| 120 | |||
| 121 | static inline void set_autofs_type_offset(unsigned int *type) | ||
| 122 | { | ||
| 123 | *type = AUTOFS_TYPE_OFFSET; | ||
| 124 | } | ||
| 125 | |||
| 126 | static inline unsigned int autofs_type_offset(unsigned int type) | ||
| 127 | { | ||
| 128 | return (type == AUTOFS_TYPE_OFFSET); | ||
| 129 | } | ||
| 130 | |||
| 131 | static inline unsigned int autofs_type_trigger(unsigned int type) | ||
| 132 | { | ||
| 133 | return (type == AUTOFS_TYPE_DIRECT || type == AUTOFS_TYPE_OFFSET); | ||
| 134 | } | ||
| 135 | |||
| 136 | /* | ||
| 137 | * This isn't really a type as we use it to say "no type set" to | ||
| 138 | * indicate we want to search for "any" mount in the | ||
| 139 | * autofs_dev_ioctl_ismountpoint() device ioctl function. | ||
| 140 | */ | ||
| 141 | static inline void set_autofs_type_any(unsigned int *type) | ||
| 142 | { | ||
| 143 | *type = AUTOFS_TYPE_ANY; | ||
| 144 | } | ||
| 145 | |||
| 146 | static inline unsigned int autofs_type_any(unsigned int type) | ||
| 147 | { | ||
| 148 | return (type == AUTOFS_TYPE_ANY); | ||
| 149 | } | ||
| 150 | |||
| 151 | /* Daemon notification packet types */ | ||
| 152 | enum autofs_notify { | ||
| 153 | NFY_NONE, | ||
| 154 | NFY_MOUNT, | ||
| 155 | NFY_EXPIRE | ||
| 156 | }; | ||
| 157 | |||
| 158 | /* Kernel protocol version 4 packet types */ | ||
| 159 | |||
| 160 | /* Expire entry (umount request) */ | ||
| 161 | #define autofs_ptype_expire_multi 2 | ||
| 162 | |||
| 163 | /* Kernel protocol version 5 packet types */ | ||
| 164 | |||
| 165 | /* Indirect mount missing and expire requests. */ | ||
| 166 | #define autofs_ptype_missing_indirect 3 | ||
| 167 | #define autofs_ptype_expire_indirect 4 | ||
| 168 | |||
| 169 | /* Direct mount missing and expire requests */ | ||
| 170 | #define autofs_ptype_missing_direct 5 | ||
| 171 | #define autofs_ptype_expire_direct 6 | ||
| 172 | |||
| 173 | /* v4 multi expire (via pipe) */ | ||
| 174 | struct autofs_packet_expire_multi { | ||
| 175 | struct autofs_packet_hdr hdr; | ||
| 176 | autofs_wqt_t wait_queue_token; | ||
| 177 | int len; | ||
| 178 | char name[NAME_MAX+1]; | ||
| 179 | }; | ||
| 180 | |||
| 181 | union autofs_packet_union { | ||
| 182 | struct autofs_packet_hdr hdr; | ||
| 183 | struct autofs_packet_missing missing; | ||
| 184 | struct autofs_packet_expire expire; | ||
| 185 | struct autofs_packet_expire_multi expire_multi; | ||
| 186 | }; | ||
| 187 | |||
| 188 | /* autofs v5 common packet struct */ | ||
| 189 | struct autofs_v5_packet { | ||
| 190 | struct autofs_packet_hdr hdr; | ||
| 191 | autofs_wqt_t wait_queue_token; | ||
| 192 | __u32 dev; | ||
| 193 | __u64 ino; | ||
| 194 | __u32 uid; | ||
| 195 | __u32 gid; | ||
| 196 | __u32 pid; | ||
| 197 | __u32 tgid; | ||
| 198 | __u32 len; | ||
| 199 | char name[NAME_MAX+1]; | ||
| 200 | }; | ||
| 201 | |||
| 202 | typedef struct autofs_v5_packet autofs_packet_missing_indirect_t; | ||
| 203 | typedef struct autofs_v5_packet autofs_packet_expire_indirect_t; | ||
| 204 | typedef struct autofs_v5_packet autofs_packet_missing_direct_t; | ||
| 205 | typedef struct autofs_v5_packet autofs_packet_expire_direct_t; | ||
| 206 | |||
| 207 | union autofs_v5_packet_union { | ||
| 208 | struct autofs_packet_hdr hdr; | ||
| 209 | struct autofs_v5_packet v5_packet; | ||
| 210 | autofs_packet_missing_indirect_t missing_indirect; | ||
| 211 | autofs_packet_expire_indirect_t expire_indirect; | ||
| 212 | autofs_packet_missing_direct_t missing_direct; | ||
| 213 | autofs_packet_expire_direct_t expire_direct; | ||
| 214 | }; | ||
| 215 | |||
| 216 | enum { | ||
| 217 | AUTOFS_IOC_EXPIRE_MULTI_CMD = 0x66, /* AUTOFS_IOC_EXPIRE_CMD + 1 */ | ||
| 218 | AUTOFS_IOC_PROTOSUBVER_CMD, | ||
| 219 | AUTOFS_IOC_ASKUMOUNT_CMD = 0x70, /* AUTOFS_DEV_IOCTL_VERSION_CMD - 1 */ | ||
| 220 | }; | ||
| 221 | |||
| 222 | #define AUTOFS_IOC_EXPIRE_MULTI _IOW(AUTOFS_IOCTL, \ | ||
| 223 | AUTOFS_IOC_EXPIRE_MULTI_CMD, int) | ||
| 224 | #define AUTOFS_IOC_PROTOSUBVER _IOR(AUTOFS_IOCTL, \ | ||
| 225 | AUTOFS_IOC_PROTOSUBVER_CMD, int) | ||
| 226 | #define AUTOFS_IOC_ASKUMOUNT _IOR(AUTOFS_IOCTL, \ | ||
| 227 | AUTOFS_IOC_ASKUMOUNT_CMD, int) | ||
| 83 | 228 | ||
| 84 | #endif /* _UAPI_LINUX_AUTO_FS_H */ | 229 | #endif /* _UAPI_LINUX_AUTO_FS_H */ |
diff --git a/include/uapi/linux/auto_fs4.h b/include/uapi/linux/auto_fs4.h index 1f608e27a06f..d01ef0a0189c 100644 --- a/include/uapi/linux/auto_fs4.h +++ b/include/uapi/linux/auto_fs4.h | |||
| @@ -7,156 +7,9 @@ | |||
| 7 | * option, any later version, incorporated herein by reference. | 7 | * option, any later version, incorporated herein by reference. |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | #ifndef _LINUX_AUTO_FS4_H | 10 | #ifndef _UAPI_LINUX_AUTO_FS4_H |
| 11 | #define _LINUX_AUTO_FS4_H | 11 | #define _UAPI_LINUX_AUTO_FS4_H |
| 12 | 12 | ||
| 13 | /* Include common v3 definitions */ | ||
| 14 | #include <linux/types.h> | ||
| 15 | #include <linux/auto_fs.h> | 13 | #include <linux/auto_fs.h> |
| 16 | 14 | ||
| 17 | /* autofs v4 definitions */ | 15 | #endif /* _UAPI_LINUX_AUTO_FS4_H */ |
| 18 | #undef AUTOFS_PROTO_VERSION | ||
| 19 | #undef AUTOFS_MIN_PROTO_VERSION | ||
| 20 | #undef AUTOFS_MAX_PROTO_VERSION | ||
| 21 | |||
| 22 | #define AUTOFS_PROTO_VERSION 5 | ||
| 23 | #define AUTOFS_MIN_PROTO_VERSION 3 | ||
| 24 | #define AUTOFS_MAX_PROTO_VERSION 5 | ||
| 25 | |||
| 26 | #define AUTOFS_PROTO_SUBVERSION 2 | ||
| 27 | |||
| 28 | /* Mask for expire behaviour */ | ||
| 29 | #define AUTOFS_EXP_IMMEDIATE 1 | ||
| 30 | #define AUTOFS_EXP_LEAVES 2 | ||
| 31 | |||
| 32 | #define AUTOFS_TYPE_ANY 0U | ||
| 33 | #define AUTOFS_TYPE_INDIRECT 1U | ||
| 34 | #define AUTOFS_TYPE_DIRECT 2U | ||
| 35 | #define AUTOFS_TYPE_OFFSET 4U | ||
| 36 | |||
| 37 | static inline void set_autofs_type_indirect(unsigned int *type) | ||
| 38 | { | ||
| 39 | *type = AUTOFS_TYPE_INDIRECT; | ||
| 40 | } | ||
| 41 | |||
| 42 | static inline unsigned int autofs_type_indirect(unsigned int type) | ||
| 43 | { | ||
| 44 | return (type == AUTOFS_TYPE_INDIRECT); | ||
| 45 | } | ||
| 46 | |||
| 47 | static inline void set_autofs_type_direct(unsigned int *type) | ||
| 48 | { | ||
| 49 | *type = AUTOFS_TYPE_DIRECT; | ||
| 50 | } | ||
| 51 | |||
| 52 | static inline unsigned int autofs_type_direct(unsigned int type) | ||
| 53 | { | ||
| 54 | return (type == AUTOFS_TYPE_DIRECT); | ||
| 55 | } | ||
| 56 | |||
| 57 | static inline void set_autofs_type_offset(unsigned int *type) | ||
| 58 | { | ||
| 59 | *type = AUTOFS_TYPE_OFFSET; | ||
| 60 | } | ||
| 61 | |||
| 62 | static inline unsigned int autofs_type_offset(unsigned int type) | ||
| 63 | { | ||
| 64 | return (type == AUTOFS_TYPE_OFFSET); | ||
| 65 | } | ||
| 66 | |||
| 67 | static inline unsigned int autofs_type_trigger(unsigned int type) | ||
| 68 | { | ||
| 69 | return (type == AUTOFS_TYPE_DIRECT || type == AUTOFS_TYPE_OFFSET); | ||
| 70 | } | ||
| 71 | |||
| 72 | /* | ||
| 73 | * This isn't really a type as we use it to say "no type set" to | ||
| 74 | * indicate we want to search for "any" mount in the | ||
| 75 | * autofs_dev_ioctl_ismountpoint() device ioctl function. | ||
| 76 | */ | ||
| 77 | static inline void set_autofs_type_any(unsigned int *type) | ||
| 78 | { | ||
| 79 | *type = AUTOFS_TYPE_ANY; | ||
| 80 | } | ||
| 81 | |||
| 82 | static inline unsigned int autofs_type_any(unsigned int type) | ||
| 83 | { | ||
| 84 | return (type == AUTOFS_TYPE_ANY); | ||
| 85 | } | ||
| 86 | |||
| 87 | /* Daemon notification packet types */ | ||
| 88 | enum autofs_notify { | ||
| 89 | NFY_NONE, | ||
| 90 | NFY_MOUNT, | ||
| 91 | NFY_EXPIRE | ||
| 92 | }; | ||
| 93 | |||
| 94 | /* Kernel protocol version 4 packet types */ | ||
| 95 | |||
| 96 | /* Expire entry (umount request) */ | ||
| 97 | #define autofs_ptype_expire_multi 2 | ||
| 98 | |||
| 99 | /* Kernel protocol version 5 packet types */ | ||
| 100 | |||
| 101 | /* Indirect mount missing and expire requests. */ | ||
| 102 | #define autofs_ptype_missing_indirect 3 | ||
| 103 | #define autofs_ptype_expire_indirect 4 | ||
| 104 | |||
| 105 | /* Direct mount missing and expire requests */ | ||
| 106 | #define autofs_ptype_missing_direct 5 | ||
| 107 | #define autofs_ptype_expire_direct 6 | ||
| 108 | |||
| 109 | /* v4 multi expire (via pipe) */ | ||
| 110 | struct autofs_packet_expire_multi { | ||
| 111 | struct autofs_packet_hdr hdr; | ||
| 112 | autofs_wqt_t wait_queue_token; | ||
| 113 | int len; | ||
| 114 | char name[NAME_MAX+1]; | ||
| 115 | }; | ||
| 116 | |||
| 117 | union autofs_packet_union { | ||
| 118 | struct autofs_packet_hdr hdr; | ||
| 119 | struct autofs_packet_missing missing; | ||
| 120 | struct autofs_packet_expire expire; | ||
| 121 | struct autofs_packet_expire_multi expire_multi; | ||
| 122 | }; | ||
| 123 | |||
| 124 | /* autofs v5 common packet struct */ | ||
| 125 | struct autofs_v5_packet { | ||
| 126 | struct autofs_packet_hdr hdr; | ||
| 127 | autofs_wqt_t wait_queue_token; | ||
| 128 | __u32 dev; | ||
| 129 | __u64 ino; | ||
| 130 | __u32 uid; | ||
| 131 | __u32 gid; | ||
| 132 | __u32 pid; | ||
| 133 | __u32 tgid; | ||
| 134 | __u32 len; | ||
| 135 | char name[NAME_MAX+1]; | ||
| 136 | }; | ||
| 137 | |||
| 138 | typedef struct autofs_v5_packet autofs_packet_missing_indirect_t; | ||
| 139 | typedef struct autofs_v5_packet autofs_packet_expire_indirect_t; | ||
| 140 | typedef struct autofs_v5_packet autofs_packet_missing_direct_t; | ||
| 141 | typedef struct autofs_v5_packet autofs_packet_expire_direct_t; | ||
| 142 | |||
| 143 | union autofs_v5_packet_union { | ||
| 144 | struct autofs_packet_hdr hdr; | ||
| 145 | struct autofs_v5_packet v5_packet; | ||
| 146 | autofs_packet_missing_indirect_t missing_indirect; | ||
| 147 | autofs_packet_expire_indirect_t expire_indirect; | ||
| 148 | autofs_packet_missing_direct_t missing_direct; | ||
| 149 | autofs_packet_expire_direct_t expire_direct; | ||
| 150 | }; | ||
| 151 | |||
| 152 | enum { | ||
| 153 | AUTOFS_IOC_EXPIRE_MULTI_CMD = 0x66, /* AUTOFS_IOC_EXPIRE_CMD + 1 */ | ||
| 154 | AUTOFS_IOC_PROTOSUBVER_CMD, | ||
| 155 | AUTOFS_IOC_ASKUMOUNT_CMD = 0x70, /* AUTOFS_DEV_IOCTL_VERSION_CMD - 1 */ | ||
| 156 | }; | ||
| 157 | |||
| 158 | #define AUTOFS_IOC_EXPIRE_MULTI _IOW(AUTOFS_IOCTL, AUTOFS_IOC_EXPIRE_MULTI_CMD, int) | ||
| 159 | #define AUTOFS_IOC_PROTOSUBVER _IOR(AUTOFS_IOCTL, AUTOFS_IOC_PROTOSUBVER_CMD, int) | ||
| 160 | #define AUTOFS_IOC_ASKUMOUNT _IOR(AUTOFS_IOCTL, AUTOFS_IOC_ASKUMOUNT_CMD, int) | ||
| 161 | |||
| 162 | #endif /* _LINUX_AUTO_FS4_H */ | ||
