blob: 16118452aa123d0952da4e41f1bfc267458072a7 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Mike Marshallf7ab0932015-07-17 10:38:11 -04002/*
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 */
Yi Liu8bb8aef2015-11-24 15:12:14 -050016struct orangefs_io_request_s {
Martin Brandenburg9c2bcf22016-02-20 14:26:01 -050017 __s32 __pad1;
Mike Marshallf7ab0932015-07-17 10:38:11 -040018 __s32 buf_index;
19 __s32 count;
Martin Brandenburg9c2bcf22016-02-20 14:26:01 -050020 __s32 __pad2;
Mike Marshallf7ab0932015-07-17 10:38:11 -040021 __s64 offset;
Yi Liu8bb8aef2015-11-24 15:12:14 -050022 struct orangefs_object_kref refn;
23 enum ORANGEFS_io_type io_type;
Mike Marshallf7ab0932015-07-17 10:38:11 -040024 __s32 readahead_size;
25};
26
Yi Liu8bb8aef2015-11-24 15:12:14 -050027struct orangefs_lookup_request_s {
Mike Marshallf7ab0932015-07-17 10:38:11 -040028 __s32 sym_follow;
29 __s32 __pad1;
Yi Liu8bb8aef2015-11-24 15:12:14 -050030 struct orangefs_object_kref parent_refn;
Martin Brandenburg47b49482016-02-20 14:22:40 -050031 char d_name[ORANGEFS_NAME_MAX];
Mike Marshallf7ab0932015-07-17 10:38:11 -040032};
33
Yi Liu8bb8aef2015-11-24 15:12:14 -050034struct orangefs_create_request_s {
35 struct orangefs_object_kref parent_refn;
36 struct ORANGEFS_sys_attr_s attributes;
Martin Brandenburg47b49482016-02-20 14:22:40 -050037 char d_name[ORANGEFS_NAME_MAX];
Mike Marshallf7ab0932015-07-17 10:38:11 -040038};
39
Yi Liu8bb8aef2015-11-24 15:12:14 -050040struct orangefs_symlink_request_s {
41 struct orangefs_object_kref parent_refn;
42 struct ORANGEFS_sys_attr_s attributes;
Martin Brandenburg47b49482016-02-20 14:22:40 -050043 char entry_name[ORANGEFS_NAME_MAX];
44 char target[ORANGEFS_NAME_MAX];
Mike Marshallf7ab0932015-07-17 10:38:11 -040045};
46
Yi Liu8bb8aef2015-11-24 15:12:14 -050047struct orangefs_getattr_request_s {
48 struct orangefs_object_kref refn;
Mike Marshallf7ab0932015-07-17 10:38:11 -040049 __u32 mask;
50 __u32 __pad1;
51};
52
Yi Liu8bb8aef2015-11-24 15:12:14 -050053struct orangefs_setattr_request_s {
54 struct orangefs_object_kref refn;
55 struct ORANGEFS_sys_attr_s attributes;
Mike Marshallf7ab0932015-07-17 10:38:11 -040056};
57
Yi Liu8bb8aef2015-11-24 15:12:14 -050058struct orangefs_remove_request_s {
59 struct orangefs_object_kref parent_refn;
Martin Brandenburg47b49482016-02-20 14:22:40 -050060 char d_name[ORANGEFS_NAME_MAX];
Mike Marshallf7ab0932015-07-17 10:38:11 -040061};
62
Yi Liu8bb8aef2015-11-24 15:12:14 -050063struct orangefs_mkdir_request_s {
64 struct orangefs_object_kref parent_refn;
65 struct ORANGEFS_sys_attr_s attributes;
Martin Brandenburg47b49482016-02-20 14:22:40 -050066 char d_name[ORANGEFS_NAME_MAX];
Mike Marshallf7ab0932015-07-17 10:38:11 -040067};
68
Yi Liu8bb8aef2015-11-24 15:12:14 -050069struct orangefs_readdir_request_s {
70 struct orangefs_object_kref refn;
Mike Marshallf7ab0932015-07-17 10:38:11 -040071 __u64 token;
72 __s32 max_dirent_count;
73 __s32 buf_index;
74};
75
Yi Liu8bb8aef2015-11-24 15:12:14 -050076struct orangefs_readdirplus_request_s {
77 struct orangefs_object_kref refn;
Mike Marshallf7ab0932015-07-17 10:38:11 -040078 __u64 token;
79 __s32 max_dirent_count;
80 __u32 mask;
81 __s32 buf_index;
82 __s32 __pad1;
83};
84
Yi Liu8bb8aef2015-11-24 15:12:14 -050085struct orangefs_rename_request_s {
86 struct orangefs_object_kref old_parent_refn;
87 struct orangefs_object_kref new_parent_refn;
Martin Brandenburg47b49482016-02-20 14:22:40 -050088 char d_old_name[ORANGEFS_NAME_MAX];
89 char d_new_name[ORANGEFS_NAME_MAX];
Mike Marshallf7ab0932015-07-17 10:38:11 -040090};
91
Yi Liu8bb8aef2015-11-24 15:12:14 -050092struct orangefs_statfs_request_s {
Mike Marshallf7ab0932015-07-17 10:38:11 -040093 __s32 fs_id;
94 __s32 __pad1;
95};
96
Yi Liu8bb8aef2015-11-24 15:12:14 -050097struct orangefs_truncate_request_s {
98 struct orangefs_object_kref refn;
Mike Marshallf7ab0932015-07-17 10:38:11 -040099 __s64 size;
100};
101
Martin Brandenburg6eaff8c2016-08-02 14:31:05 -0400102struct orangefs_ra_cache_flush_request_s {
Yi Liu8bb8aef2015-11-24 15:12:14 -0500103 struct orangefs_object_kref refn;
Mike Marshallf7ab0932015-07-17 10:38:11 -0400104};
105
Yi Liu8bb8aef2015-11-24 15:12:14 -0500106struct orangefs_fs_mount_request_s {
107 char orangefs_config_server[ORANGEFS_MAX_SERVER_ADDR_LEN];
Mike Marshallf7ab0932015-07-17 10:38:11 -0400108};
109
Yi Liu8bb8aef2015-11-24 15:12:14 -0500110struct orangefs_fs_umount_request_s {
Mike Marshallf7ab0932015-07-17 10:38:11 -0400111 __s32 id;
112 __s32 fs_id;
Yi Liu8bb8aef2015-11-24 15:12:14 -0500113 char orangefs_config_server[ORANGEFS_MAX_SERVER_ADDR_LEN];
Mike Marshallf7ab0932015-07-17 10:38:11 -0400114};
115
Yi Liu8bb8aef2015-11-24 15:12:14 -0500116struct orangefs_getxattr_request_s {
117 struct orangefs_object_kref refn;
Mike Marshallf7ab0932015-07-17 10:38:11 -0400118 __s32 key_sz;
119 __s32 __pad1;
Yi Liu8bb8aef2015-11-24 15:12:14 -0500120 char key[ORANGEFS_MAX_XATTR_NAMELEN];
Mike Marshallf7ab0932015-07-17 10:38:11 -0400121};
122
Yi Liu8bb8aef2015-11-24 15:12:14 -0500123struct orangefs_setxattr_request_s {
124 struct orangefs_object_kref refn;
125 struct ORANGEFS_keyval_pair keyval;
Mike Marshallf7ab0932015-07-17 10:38:11 -0400126 __s32 flags;
127 __s32 __pad1;
128};
129
Yi Liu8bb8aef2015-11-24 15:12:14 -0500130struct orangefs_listxattr_request_s {
131 struct orangefs_object_kref refn;
Mike Marshallf7ab0932015-07-17 10:38:11 -0400132 __s32 requested_count;
133 __s32 __pad1;
134 __u64 token;
135};
136
Yi Liu8bb8aef2015-11-24 15:12:14 -0500137struct orangefs_removexattr_request_s {
138 struct orangefs_object_kref refn;
Mike Marshallf7ab0932015-07-17 10:38:11 -0400139 __s32 key_sz;
140 __s32 __pad1;
Yi Liu8bb8aef2015-11-24 15:12:14 -0500141 char key[ORANGEFS_MAX_XATTR_NAMELEN];
Mike Marshallf7ab0932015-07-17 10:38:11 -0400142};
143
Yi Liu8bb8aef2015-11-24 15:12:14 -0500144struct orangefs_op_cancel_s {
Mike Marshallf7ab0932015-07-17 10:38:11 -0400145 __u64 op_tag;
146};
147
Yi Liu8bb8aef2015-11-24 15:12:14 -0500148struct orangefs_fsync_request_s {
149 struct orangefs_object_kref refn;
Mike Marshallf7ab0932015-07-17 10:38:11 -0400150};
151
Yi Liu8bb8aef2015-11-24 15:12:14 -0500152enum orangefs_param_request_type {
153 ORANGEFS_PARAM_REQUEST_SET = 1,
154 ORANGEFS_PARAM_REQUEST_GET = 2
Mike Marshallf7ab0932015-07-17 10:38:11 -0400155};
156
Yi Liu8bb8aef2015-11-24 15:12:14 -0500157enum 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,
Martin Brandenburga6dff802016-08-02 16:33:00 -0400183 ORANGEFS_PARAM_REQUEST_OP_READAHEAD_SIZE = 26,
184 ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT = 27,
185 ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE = 28,
Martin Brandenburg31c829f2017-01-26 10:25:30 -0500186 ORANGEFS_PARAM_REQUEST_OP_READAHEAD_READCNT = 29,
Mike Marshallf7ab0932015-07-17 10:38:11 -0400187};
188
Yi Liu8bb8aef2015-11-24 15:12:14 -0500189struct orangefs_param_request_s {
190 enum orangefs_param_request_type type;
191 enum orangefs_param_request_op op;
Martin Brandenburg680908e2016-08-02 16:33:34 -0400192 union {
193 __s64 value64;
194 __s32 value32[2];
195 } u;
Yi Liu8bb8aef2015-11-24 15:12:14 -0500196 char s_value[ORANGEFS_MAX_DEBUG_STRING_LEN];
Mike Marshallf7ab0932015-07-17 10:38:11 -0400197};
198
Yi Liu8bb8aef2015-11-24 15:12:14 -0500199enum 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,
Mike Marshallf7ab0932015-07-17 10:38:11 -0400203};
204
Yi Liu8bb8aef2015-11-24 15:12:14 -0500205struct orangefs_perf_count_request_s {
206 enum orangefs_perf_count_request_type type;
Mike Marshallf7ab0932015-07-17 10:38:11 -0400207 __s32 __pad1;
208};
209
Yi Liu8bb8aef2015-11-24 15:12:14 -0500210struct orangefs_fs_key_request_s {
Mike Marshallf7ab0932015-07-17 10:38:11 -0400211 __s32 fsid;
212 __s32 __pad1;
213};
214
Martin Brandenburg482664d2016-08-12 12:02:31 -0400215/* 2.9.6 */
216struct orangefs_features_request_s {
217 __u64 features;
218};
219
Yi Liu8bb8aef2015-11-24 15:12:14 -0500220struct orangefs_upcall_s {
Mike Marshallf7ab0932015-07-17 10:38:11 -0400221 __s32 type;
222 __u32 uid;
223 __u32 gid;
224 int pid;
225 int tgid;
Martin Brandenburgf0ed4412015-11-13 14:26:09 -0500226 /* Trailers unused but must be retained for protocol compatibility. */
Mike Marshallf7ab0932015-07-17 10:38:11 -0400227 __s64 trailer_size;
228 char *trailer_buf;
229
230 union {
Yi Liu8bb8aef2015-11-24 15:12:14 -0500231 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;
Martin Brandenburg6eaff8c2016-08-02 14:31:05 -0400244 struct orangefs_ra_cache_flush_request_s ra_cache_flush;
Yi Liu8bb8aef2015-11-24 15:12:14 -0500245 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;
Martin Brandenburg482664d2016-08-12 12:02:31 -0400256 struct orangefs_features_request_s features;
Mike Marshallf7ab0932015-07-17 10:38:11 -0400257 } req;
258};
259
260#endif /* __UPCALL_H */