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