xref: /linux/fs/orangefs/upcall.h (revision 132db93572821ec2fdf81e354cc40f558faf7e4f)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * (C) 2001 Clemson University and The University of Chicago
4  *
5  * See COPYING in top-level directory.
6  */
7 
8 #ifndef __UPCALL_H
9 #define __UPCALL_H
10 
11 /*
12  * Sanitized this header file to fix
13  * 32-64 bit interaction issues between
14  * client-core and device
15  */
16 struct orangefs_io_request_s {
17 	__s32 __pad1;
18 	__s32 buf_index;
19 	__s32 count;
20 	__s32 __pad2;
21 	__s64 offset;
22 	struct orangefs_object_kref refn;
23 	enum ORANGEFS_io_type io_type;
24 	__s32 readahead_size;
25 };
26 
27 struct orangefs_lookup_request_s {
28 	__s32 sym_follow;
29 	__s32 __pad1;
30 	struct orangefs_object_kref parent_refn;
31 	char d_name[ORANGEFS_NAME_MAX];
32 };
33 
34 struct orangefs_create_request_s {
35 	struct orangefs_object_kref parent_refn;
36 	struct ORANGEFS_sys_attr_s attributes;
37 	char d_name[ORANGEFS_NAME_MAX];
38 };
39 
40 struct orangefs_symlink_request_s {
41 	struct orangefs_object_kref parent_refn;
42 	struct ORANGEFS_sys_attr_s attributes;
43 	char entry_name[ORANGEFS_NAME_MAX];
44 	char target[ORANGEFS_NAME_MAX];
45 };
46 
47 struct orangefs_getattr_request_s {
48 	struct orangefs_object_kref refn;
49 	__u32 mask;
50 	__u32 __pad1;
51 };
52 
53 struct orangefs_setattr_request_s {
54 	struct orangefs_object_kref refn;
55 	struct ORANGEFS_sys_attr_s attributes;
56 };
57 
58 struct orangefs_remove_request_s {
59 	struct orangefs_object_kref parent_refn;
60 	char d_name[ORANGEFS_NAME_MAX];
61 };
62 
63 struct orangefs_mkdir_request_s {
64 	struct orangefs_object_kref parent_refn;
65 	struct ORANGEFS_sys_attr_s attributes;
66 	char d_name[ORANGEFS_NAME_MAX];
67 };
68 
69 struct orangefs_readdir_request_s {
70 	struct orangefs_object_kref refn;
71 	__u64 token;
72 	__s32 max_dirent_count;
73 	__s32 buf_index;
74 };
75 
76 struct orangefs_readdirplus_request_s {
77 	struct orangefs_object_kref refn;
78 	__u64 token;
79 	__s32 max_dirent_count;
80 	__u32 mask;
81 	__s32 buf_index;
82 	__s32 __pad1;
83 };
84 
85 struct orangefs_rename_request_s {
86 	struct orangefs_object_kref old_parent_refn;
87 	struct orangefs_object_kref new_parent_refn;
88 	char d_old_name[ORANGEFS_NAME_MAX];
89 	char d_new_name[ORANGEFS_NAME_MAX];
90 };
91 
92 struct orangefs_statfs_request_s {
93 	__s32 fs_id;
94 	__s32 __pad1;
95 };
96 
97 struct orangefs_truncate_request_s {
98 	struct orangefs_object_kref refn;
99 	__s64 size;
100 };
101 
102 struct orangefs_ra_cache_flush_request_s {
103 	struct orangefs_object_kref refn;
104 };
105 
106 struct orangefs_fs_mount_request_s {
107 	char orangefs_config_server[ORANGEFS_MAX_SERVER_ADDR_LEN];
108 };
109 
110 struct orangefs_fs_umount_request_s {
111 	__s32 id;
112 	__s32 fs_id;
113 	char orangefs_config_server[ORANGEFS_MAX_SERVER_ADDR_LEN];
114 };
115 
116 struct orangefs_getxattr_request_s {
117 	struct orangefs_object_kref refn;
118 	__s32 key_sz;
119 	__s32 __pad1;
120 	char key[ORANGEFS_MAX_XATTR_NAMELEN];
121 };
122 
123 struct orangefs_setxattr_request_s {
124 	struct orangefs_object_kref refn;
125 	struct ORANGEFS_keyval_pair keyval;
126 	__s32 flags;
127 	__s32 __pad1;
128 };
129 
130 struct orangefs_listxattr_request_s {
131 	struct orangefs_object_kref refn;
132 	__s32 requested_count;
133 	__s32 __pad1;
134 	__u64 token;
135 };
136 
137 struct orangefs_removexattr_request_s {
138 	struct orangefs_object_kref refn;
139 	__s32 key_sz;
140 	__s32 __pad1;
141 	char key[ORANGEFS_MAX_XATTR_NAMELEN];
142 };
143 
144 struct orangefs_op_cancel_s {
145 	__u64 op_tag;
146 };
147 
148 struct orangefs_fsync_request_s {
149 	struct orangefs_object_kref refn;
150 };
151 
152 enum orangefs_param_request_type {
153 	ORANGEFS_PARAM_REQUEST_SET = 1,
154 	ORANGEFS_PARAM_REQUEST_GET = 2
155 };
156 
157 enum orangefs_param_request_op {
158 	ORANGEFS_PARAM_REQUEST_OP_ACACHE_TIMEOUT_MSECS = 1,
159 	ORANGEFS_PARAM_REQUEST_OP_ACACHE_HARD_LIMIT = 2,
160 	ORANGEFS_PARAM_REQUEST_OP_ACACHE_SOFT_LIMIT = 3,
161 	ORANGEFS_PARAM_REQUEST_OP_ACACHE_RECLAIM_PERCENTAGE = 4,
162 	ORANGEFS_PARAM_REQUEST_OP_PERF_TIME_INTERVAL_SECS = 5,
163 	ORANGEFS_PARAM_REQUEST_OP_PERF_HISTORY_SIZE = 6,
164 	ORANGEFS_PARAM_REQUEST_OP_PERF_RESET = 7,
165 	ORANGEFS_PARAM_REQUEST_OP_NCACHE_TIMEOUT_MSECS = 8,
166 	ORANGEFS_PARAM_REQUEST_OP_NCACHE_HARD_LIMIT = 9,
167 	ORANGEFS_PARAM_REQUEST_OP_NCACHE_SOFT_LIMIT = 10,
168 	ORANGEFS_PARAM_REQUEST_OP_NCACHE_RECLAIM_PERCENTAGE = 11,
169 	ORANGEFS_PARAM_REQUEST_OP_STATIC_ACACHE_TIMEOUT_MSECS = 12,
170 	ORANGEFS_PARAM_REQUEST_OP_STATIC_ACACHE_HARD_LIMIT = 13,
171 	ORANGEFS_PARAM_REQUEST_OP_STATIC_ACACHE_SOFT_LIMIT = 14,
172 	ORANGEFS_PARAM_REQUEST_OP_STATIC_ACACHE_RECLAIM_PERCENTAGE = 15,
173 	ORANGEFS_PARAM_REQUEST_OP_CLIENT_DEBUG = 16,
174 	ORANGEFS_PARAM_REQUEST_OP_CCACHE_TIMEOUT_SECS = 17,
175 	ORANGEFS_PARAM_REQUEST_OP_CCACHE_HARD_LIMIT = 18,
176 	ORANGEFS_PARAM_REQUEST_OP_CCACHE_SOFT_LIMIT = 19,
177 	ORANGEFS_PARAM_REQUEST_OP_CCACHE_RECLAIM_PERCENTAGE = 20,
178 	ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_TIMEOUT_SECS = 21,
179 	ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_HARD_LIMIT = 22,
180 	ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_SOFT_LIMIT = 23,
181 	ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_RECLAIM_PERCENTAGE = 24,
182 	ORANGEFS_PARAM_REQUEST_OP_TWO_MASK_VALUES = 25,
183 	ORANGEFS_PARAM_REQUEST_OP_READAHEAD_SIZE = 26,
184 	ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT = 27,
185 	ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE = 28,
186 	ORANGEFS_PARAM_REQUEST_OP_READAHEAD_READCNT = 29,
187 };
188 
189 struct orangefs_param_request_s {
190 	enum orangefs_param_request_type type;
191 	enum orangefs_param_request_op op;
192 	union {
193 		__s64 value64;
194 		__s32 value32[2];
195 	} u;
196 	char s_value[ORANGEFS_MAX_DEBUG_STRING_LEN];
197 };
198 
199 enum orangefs_perf_count_request_type {
200 	ORANGEFS_PERF_COUNT_REQUEST_ACACHE = 1,
201 	ORANGEFS_PERF_COUNT_REQUEST_NCACHE = 2,
202 	ORANGEFS_PERF_COUNT_REQUEST_CAPCACHE = 3,
203 };
204 
205 struct orangefs_perf_count_request_s {
206 	enum orangefs_perf_count_request_type type;
207 	__s32 __pad1;
208 };
209 
210 struct orangefs_fs_key_request_s {
211 	__s32 fsid;
212 	__s32 __pad1;
213 };
214 
215 /* 2.9.6 */
216 struct orangefs_features_request_s {
217 	__u64 features;
218 };
219 
220 struct orangefs_upcall_s {
221 	__s32 type;
222 	__u32 uid;
223 	__u32 gid;
224 	int pid;
225 	int tgid;
226 	/* Trailers unused but must be retained for protocol compatibility. */
227 	__s64 trailer_size;
228 	char *trailer_buf;
229 
230 	union {
231 		struct orangefs_io_request_s io;
232 		struct orangefs_lookup_request_s lookup;
233 		struct orangefs_create_request_s create;
234 		struct orangefs_symlink_request_s sym;
235 		struct orangefs_getattr_request_s getattr;
236 		struct orangefs_setattr_request_s setattr;
237 		struct orangefs_remove_request_s remove;
238 		struct orangefs_mkdir_request_s mkdir;
239 		struct orangefs_readdir_request_s readdir;
240 		struct orangefs_readdirplus_request_s readdirplus;
241 		struct orangefs_rename_request_s rename;
242 		struct orangefs_statfs_request_s statfs;
243 		struct orangefs_truncate_request_s truncate;
244 		struct orangefs_ra_cache_flush_request_s ra_cache_flush;
245 		struct orangefs_fs_mount_request_s fs_mount;
246 		struct orangefs_fs_umount_request_s fs_umount;
247 		struct orangefs_getxattr_request_s getxattr;
248 		struct orangefs_setxattr_request_s setxattr;
249 		struct orangefs_listxattr_request_s listxattr;
250 		struct orangefs_removexattr_request_s removexattr;
251 		struct orangefs_op_cancel_s cancel;
252 		struct orangefs_fsync_request_s fsync;
253 		struct orangefs_param_request_s param;
254 		struct orangefs_perf_count_request_s perf_count;
255 		struct orangefs_fs_key_request_s fs_key;
256 		struct orangefs_features_request_s features;
257 	} req;
258 };
259 
260 #endif /* __UPCALL_H */
261