1 /*
2 * This header was generated from the Linux kernel headers by update_headers.py,
3 * to provide necessary information from kernel to userspace, such as constants,
4 * structures, and macros, and thus, contains no copyrightable information.
5 */
6 #ifndef _UAPI_LINUX_AUTO_FS_H
7 #define _UAPI_LINUX_AUTO_FS_H
8 #include <linux/types.h>
9 #include <linux/limits.h>
10 #ifndef __KERNEL__
11 #include <sys/ioctl.h>
12 #endif
13 #define AUTOFS_PROTO_VERSION 5
14 #define AUTOFS_MIN_PROTO_VERSION 3
15 #define AUTOFS_MAX_PROTO_VERSION 5
16 #define AUTOFS_PROTO_SUBVERSION 3
17 #if defined(__ia64__) || defined(__alpha__)
18 typedef unsigned long autofs_wqt_t;
19 #else
20 typedef unsigned int autofs_wqt_t;
21 #endif
22 #define autofs_ptype_missing 0
23 #define autofs_ptype_expire 1
24 struct autofs_packet_hdr {
25 int proto_version;
26 int type;
27 };
28 struct autofs_packet_missing {
29 struct autofs_packet_hdr hdr;
30 autofs_wqt_t wait_queue_token;
31 int len;
32 char name[NAME_MAX+1];
33 };
34 struct autofs_packet_expire {
35 struct autofs_packet_hdr hdr;
36 int len;
37 char name[NAME_MAX+1];
38 };
39 #define AUTOFS_IOCTL 0x93
40 enum {
41 AUTOFS_IOC_READY_CMD = 0x60,
42 AUTOFS_IOC_FAIL_CMD,
43 AUTOFS_IOC_CATATONIC_CMD,
44 AUTOFS_IOC_PROTOVER_CMD,
45 AUTOFS_IOC_SETTIMEOUT_CMD,
46 AUTOFS_IOC_EXPIRE_CMD,
47 };
48 #define AUTOFS_IOC_READY _IO(AUTOFS_IOCTL, AUTOFS_IOC_READY_CMD)
49 #define AUTOFS_IOC_FAIL _IO(AUTOFS_IOCTL, AUTOFS_IOC_FAIL_CMD)
50 #define AUTOFS_IOC_CATATONIC _IO(AUTOFS_IOCTL, AUTOFS_IOC_CATATONIC_CMD)
51 #define AUTOFS_IOC_PROTOVER _IOR(AUTOFS_IOCTL, \
52 AUTOFS_IOC_PROTOVER_CMD, int)
53 #define AUTOFS_IOC_SETTIMEOUT32 _IOWR(AUTOFS_IOCTL, \
54 AUTOFS_IOC_SETTIMEOUT_CMD, \
55 compat_ulong_t)
56 #define AUTOFS_IOC_SETTIMEOUT _IOWR(AUTOFS_IOCTL, \
57 AUTOFS_IOC_SETTIMEOUT_CMD, \
58 unsigned long)
59 #define AUTOFS_IOC_EXPIRE _IOR(AUTOFS_IOCTL, \
60 AUTOFS_IOC_EXPIRE_CMD, \
61 struct autofs_packet_expire)
62 #define AUTOFS_EXP_NORMAL 0x00
63 #define AUTOFS_EXP_IMMEDIATE 0x01
64 #define AUTOFS_EXP_LEAVES 0x02
65 #define AUTOFS_EXP_FORCED 0x04
66 #define AUTOFS_TYPE_ANY 0U
67 #define AUTOFS_TYPE_INDIRECT 1U
68 #define AUTOFS_TYPE_DIRECT 2U
69 #define AUTOFS_TYPE_OFFSET 4U
set_autofs_type_indirect(unsigned int * type)70 static inline void set_autofs_type_indirect(unsigned int *type)
71 {
72 *type = AUTOFS_TYPE_INDIRECT;
73 }
autofs_type_indirect(unsigned int type)74 static inline unsigned int autofs_type_indirect(unsigned int type)
75 {
76 return (type == AUTOFS_TYPE_INDIRECT);
77 }
set_autofs_type_direct(unsigned int * type)78 static inline void set_autofs_type_direct(unsigned int *type)
79 {
80 *type = AUTOFS_TYPE_DIRECT;
81 }
autofs_type_direct(unsigned int type)82 static inline unsigned int autofs_type_direct(unsigned int type)
83 {
84 return (type == AUTOFS_TYPE_DIRECT);
85 }
set_autofs_type_offset(unsigned int * type)86 static inline void set_autofs_type_offset(unsigned int *type)
87 {
88 *type = AUTOFS_TYPE_OFFSET;
89 }
autofs_type_offset(unsigned int type)90 static inline unsigned int autofs_type_offset(unsigned int type)
91 {
92 return (type == AUTOFS_TYPE_OFFSET);
93 }
autofs_type_trigger(unsigned int type)94 static inline unsigned int autofs_type_trigger(unsigned int type)
95 {
96 return (type == AUTOFS_TYPE_DIRECT || type == AUTOFS_TYPE_OFFSET);
97 }
set_autofs_type_any(unsigned int * type)98 static inline void set_autofs_type_any(unsigned int *type)
99 {
100 *type = AUTOFS_TYPE_ANY;
101 }
autofs_type_any(unsigned int type)102 static inline unsigned int autofs_type_any(unsigned int type)
103 {
104 return (type == AUTOFS_TYPE_ANY);
105 }
106 enum autofs_notify {
107 NFY_NONE,
108 NFY_MOUNT,
109 NFY_EXPIRE
110 };
111 #define autofs_ptype_expire_multi 2
112 #define autofs_ptype_missing_indirect 3
113 #define autofs_ptype_expire_indirect 4
114 #define autofs_ptype_missing_direct 5
115 #define autofs_ptype_expire_direct 6
116 struct autofs_packet_expire_multi {
117 struct autofs_packet_hdr hdr;
118 autofs_wqt_t wait_queue_token;
119 int len;
120 char name[NAME_MAX+1];
121 };
122 union autofs_packet_union {
123 struct autofs_packet_hdr hdr;
124 struct autofs_packet_missing missing;
125 struct autofs_packet_expire expire;
126 struct autofs_packet_expire_multi expire_multi;
127 };
128 struct autofs_v5_packet {
129 struct autofs_packet_hdr hdr;
130 autofs_wqt_t wait_queue_token;
131 __u32 dev;
132 __u64 ino;
133 __u32 uid;
134 __u32 gid;
135 __u32 pid;
136 __u32 tgid;
137 __u32 len;
138 char name[NAME_MAX+1];
139 };
140 typedef struct autofs_v5_packet autofs_packet_missing_indirect_t;
141 typedef struct autofs_v5_packet autofs_packet_expire_indirect_t;
142 typedef struct autofs_v5_packet autofs_packet_missing_direct_t;
143 typedef struct autofs_v5_packet autofs_packet_expire_direct_t;
144 union autofs_v5_packet_union {
145 struct autofs_packet_hdr hdr;
146 struct autofs_v5_packet v5_packet;
147 autofs_packet_missing_indirect_t missing_indirect;
148 autofs_packet_expire_indirect_t expire_indirect;
149 autofs_packet_missing_direct_t missing_direct;
150 autofs_packet_expire_direct_t expire_direct;
151 };
152 enum {
153 AUTOFS_IOC_EXPIRE_MULTI_CMD = 0x66,
154 AUTOFS_IOC_PROTOSUBVER_CMD,
155 AUTOFS_IOC_ASKUMOUNT_CMD = 0x70,
156 };
157 #define AUTOFS_IOC_EXPIRE_MULTI _IOW(AUTOFS_IOCTL, \
158 AUTOFS_IOC_EXPIRE_MULTI_CMD, int)
159 #define AUTOFS_IOC_PROTOSUBVER _IOR(AUTOFS_IOCTL, \
160 AUTOFS_IOC_PROTOSUBVER_CMD, int)
161 #define AUTOFS_IOC_ASKUMOUNT _IOR(AUTOFS_IOCTL, \
162 AUTOFS_IOC_ASKUMOUNT_CMD, int)
163 #endif
164