2 * Copyright 1999-2000 Jeremy Fitzhardinge <jeremy@goop.org>
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.
9 #ifndef _LINUX_AUTO_FS4_H
10 #define _LINUX_AUTO_FS4_H
12 /* Include common v3 definitions */
13 #include <linux/types.h>
14 #include <linux/auto_fs.h>
16 /* autofs v4 definitions */
17 #undef AUTOFS_PROTO_VERSION
18 #undef AUTOFS_MIN_PROTO_VERSION
19 #undef AUTOFS_MAX_PROTO_VERSION
21 #define AUTOFS_PROTO_VERSION 5
22 #define AUTOFS_MIN_PROTO_VERSION 3
23 #define AUTOFS_MAX_PROTO_VERSION 5
25 #define AUTOFS_PROTO_SUBVERSION 2
27 /* Mask for expire behaviour */
28 #define AUTOFS_EXP_IMMEDIATE 1
29 #define AUTOFS_EXP_LEAVES 2
31 #define AUTOFS_TYPE_ANY 0U
32 #define AUTOFS_TYPE_INDIRECT 1U
33 #define AUTOFS_TYPE_DIRECT 2U
34 #define AUTOFS_TYPE_OFFSET 4U
36 static inline void set_autofs_type_indirect(unsigned int *type
)
38 *type
= AUTOFS_TYPE_INDIRECT
;
41 static inline unsigned int autofs_type_indirect(unsigned int type
)
43 return (type
== AUTOFS_TYPE_INDIRECT
);
46 static inline void set_autofs_type_direct(unsigned int *type
)
48 *type
= AUTOFS_TYPE_DIRECT
;
51 static inline unsigned int autofs_type_direct(unsigned int type
)
53 return (type
== AUTOFS_TYPE_DIRECT
);
56 static inline void set_autofs_type_offset(unsigned int *type
)
58 *type
= AUTOFS_TYPE_OFFSET
;
61 static inline unsigned int autofs_type_offset(unsigned int type
)
63 return (type
== AUTOFS_TYPE_OFFSET
);
66 static inline unsigned int autofs_type_trigger(unsigned int type
)
68 return (type
== AUTOFS_TYPE_DIRECT
|| type
== AUTOFS_TYPE_OFFSET
);
72 * This isn't really a type as we use it to say "no type set" to
73 * indicate we want to search for "any" mount in the
74 * autofs_dev_ioctl_ismountpoint() device ioctl function.
76 static inline void set_autofs_type_any(unsigned int *type
)
78 *type
= AUTOFS_TYPE_ANY
;
81 static inline unsigned int autofs_type_any(unsigned int type
)
83 return (type
== AUTOFS_TYPE_ANY
);
86 /* Daemon notification packet types */
93 /* Kernel protocol version 4 packet types */
95 /* Expire entry (umount request) */
96 #define autofs_ptype_expire_multi 2
98 /* Kernel protocol version 5 packet types */
100 /* Indirect mount missing and expire requests. */
101 #define autofs_ptype_missing_indirect 3
102 #define autofs_ptype_expire_indirect 4
104 /* Direct mount missing and expire requests */
105 #define autofs_ptype_missing_direct 5
106 #define autofs_ptype_expire_direct 6
108 /* v4 multi expire (via pipe) */
109 struct autofs_packet_expire_multi
{
110 struct autofs_packet_hdr hdr
;
111 autofs_wqt_t wait_queue_token
;
113 char name
[NAME_MAX
+1];
116 union autofs_packet_union
{
117 struct autofs_packet_hdr hdr
;
118 struct autofs_packet_missing missing
;
119 struct autofs_packet_expire expire
;
120 struct autofs_packet_expire_multi expire_multi
;
123 /* autofs v5 common packet struct */
124 struct autofs_v5_packet
{
125 struct autofs_packet_hdr hdr
;
126 autofs_wqt_t wait_queue_token
;
134 char name
[NAME_MAX
+1];
137 typedef struct autofs_v5_packet autofs_packet_missing_indirect_t
;
138 typedef struct autofs_v5_packet autofs_packet_expire_indirect_t
;
139 typedef struct autofs_v5_packet autofs_packet_missing_direct_t
;
140 typedef struct autofs_v5_packet autofs_packet_expire_direct_t
;
142 union autofs_v5_packet_union
{
143 struct autofs_packet_hdr hdr
;
144 struct autofs_v5_packet v5_packet
;
145 autofs_packet_missing_indirect_t missing_indirect
;
146 autofs_packet_expire_indirect_t expire_indirect
;
147 autofs_packet_missing_direct_t missing_direct
;
148 autofs_packet_expire_direct_t expire_direct
;
151 #define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93, 0x66, int)
152 #define AUTOFS_IOC_EXPIRE_INDIRECT AUTOFS_IOC_EXPIRE_MULTI
153 #define AUTOFS_IOC_EXPIRE_DIRECT AUTOFS_IOC_EXPIRE_MULTI
154 #define AUTOFS_IOC_PROTOSUBVER _IOR(0x93, 0x67, int)
155 #define AUTOFS_IOC_ASKUMOUNT _IOR(0x93, 0x70, int)
157 #endif /* _LINUX_AUTO_FS4_H */