Debian Codegraph @

include/linux/auto_fs4.h

raw
1 /* -*- c -*-
2 * linux/include/linux/auto_fs4.h
3 *
4 * Copyright 1999-2000 Jeremy Fitzhardinge <[email protected]>
5 *
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 */
10
11 #ifndef _LINUX_AUTO_FS4_H
12 #define _LINUX_AUTO_FS4_H
13
14 /* Include common v3 definitions */
15 #include <linux/types.h>
16 #include <linux/auto_fs.h>
17
18 /* autofs v4 definitions */
19 #undef AUTOFS_PROTO_VERSION
20 #undef AUTOFS_MIN_PROTO_VERSION
21 #undef AUTOFS_MAX_PROTO_VERSION
22
23 #define AUTOFS_PROTO_VERSION 5
24 #define AUTOFS_MIN_PROTO_VERSION 3
25 #define AUTOFS_MAX_PROTO_VERSION 5
26
27 #define AUTOFS_PROTO_SUBVERSION 2
28
29 /* Mask for expire behaviour */
30 #define AUTOFS_EXP_NORMAL 0x00
31 #define AUTOFS_EXP_IMMEDIATE 0x01
32 #define AUTOFS_EXP_LEAVES 0x02
33 #define AUTOFS_EXP_FORCE 0x04
34
35 #define AUTOFS_TYPE_ANY 0U
36 #define AUTOFS_TYPE_INDIRECT 1U
37 #define AUTOFS_TYPE_DIRECT 2U
38 #define AUTOFS_TYPE_OFFSET 4U
39
40 static inline void set_autofs_type_indirect(unsigned int *type)
41 {
42 *type = AUTOFS_TYPE_INDIRECT;
43 return;
44 }
45
46 static inline unsigned int autofs_type_indirect(unsigned int type)
47 {
48 return (type == AUTOFS_TYPE_INDIRECT);
49 }
50
51 static inline void set_autofs_type_direct(unsigned int *type)
52 {
53 *type = AUTOFS_TYPE_DIRECT;
54 return;
55 }
56
57 static inline unsigned int autofs_type_direct(unsigned int type)
58 {
59 return (type == AUTOFS_TYPE_DIRECT);
60 }
61
62 static inline void set_autofs_type_offset(unsigned int *type)
63 {
64 *type = AUTOFS_TYPE_OFFSET;
65 return;
66 }
67
68 static inline unsigned int autofs_type_offset(unsigned int type)
69 {
70 return (type == AUTOFS_TYPE_OFFSET);
71 }
72
73 static inline unsigned int autofs_type_trigger(unsigned int type)
74 {
75 return (type == AUTOFS_TYPE_DIRECT || type == AUTOFS_TYPE_OFFSET);
76 }
77
78 /*
79 * This isn't really a type as we use it to say "no type set" to
80 * indicate we want to search for "any" mount in the
81 * autofs_dev_ioctl_ismountpoint() device ioctl function.
82 */
83 static inline void set_autofs_type_any(unsigned int *type)
84 {
85 *type = AUTOFS_TYPE_ANY;
86 return;
87 }
88
89 static inline unsigned int autofs_type_any(unsigned int type)
90 {
91 return (type == AUTOFS_TYPE_ANY);
92 }
93
94 /* Daemon notification packet types */
95 enum autofs_notify {
96 NFY_NONE,
97 NFY_MOUNT,
98 NFY_EXPIRE
99 };
100
101 /* Kernel protocol version 4 packet types */
102
103 /* Expire entry (umount request) */
104 #define autofs_ptype_expire_multi 2
105
106 /* Kernel protocol version 5 packet types */
107
108 /* Indirect mount missing and expire requests. */
109 #define autofs_ptype_missing_indirect 3
110 #define autofs_ptype_expire_indirect 4
111
112 /* Direct mount missing and expire requests */
113 #define autofs_ptype_missing_direct 5
114 #define autofs_ptype_expire_direct 6
115
116 /* v4 multi expire (via pipe) */
117 struct autofs_packet_expire_multi {
118 struct autofs_packet_hdr hdr;
119 autofs_wqt_t wait_queue_token;
120 int len;
121 char name[NAME_MAX+1];
122 };
123
124 union autofs_packet_union {
125 struct autofs_packet_hdr hdr;
126 struct autofs_packet_missing missing;
127 struct autofs_packet_expire expire;
128 struct autofs_packet_expire_multi expire_multi;
129 };
130
131 /* autofs v5 common packet struct */
132 struct autofs_v5_packet {
133 struct autofs_packet_hdr hdr;
134 autofs_wqt_t wait_queue_token;
135 __u32 dev;
136 __u64 ino;
137 __u32 uid;
138 __u32 gid;
139 __u32 pid;
140 __u32 tgid;
141 __u32 len;
142 char name[NAME_MAX+1];
143 };
144
145 typedef struct autofs_v5_packet autofs_packet_missing_indirect_t;
146 typedef struct autofs_v5_packet autofs_packet_expire_indirect_t;
147 typedef struct autofs_v5_packet autofs_packet_missing_direct_t;
148 typedef struct autofs_v5_packet autofs_packet_expire_direct_t;
149
150 union autofs_v5_packet_union {
151 struct autofs_packet_hdr hdr;
152 struct autofs_v5_packet v5_packet;
153 autofs_packet_missing_indirect_t missing_indirect;
154 autofs_packet_expire_indirect_t expire_indirect;
155 autofs_packet_missing_direct_t missing_direct;
156 autofs_packet_expire_direct_t expire_direct;
157 };
158
159 #define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int)
160 #define AUTOFS_IOC_EXPIRE_INDIRECT AUTOFS_IOC_EXPIRE_MULTI
161 #define AUTOFS_IOC_EXPIRE_DIRECT AUTOFS_IOC_EXPIRE_MULTI
162 #define AUTOFS_IOC_PROTOSUBVER _IOR(0x93,0x67,int)
163 #define AUTOFS_IOC_ASKUMOUNT _IOR(0x93,0x70,int)
164
165
166 #endif /* _LINUX_AUTO_FS4_H */