xref: /linux/fs/orangefs/upcall.h (revision 9c2bcf288ed7f600bc3f8e7541ea0522a8912bae)
1f7ab093fSMike Marshall /*
2f7ab093fSMike Marshall  * (C) 2001 Clemson University and The University of Chicago
3f7ab093fSMike Marshall  *
4f7ab093fSMike Marshall  * See COPYING in top-level directory.
5f7ab093fSMike Marshall  */
6f7ab093fSMike Marshall 
7f7ab093fSMike Marshall #ifndef __UPCALL_H
8f7ab093fSMike Marshall #define __UPCALL_H
9f7ab093fSMike Marshall 
10f7ab093fSMike Marshall /*
11f7ab093fSMike Marshall  * Sanitized this header file to fix
12f7ab093fSMike Marshall  * 32-64 bit interaction issues between
13f7ab093fSMike Marshall  * client-core and device
14f7ab093fSMike Marshall  */
158bb8aefdSYi Liu struct orangefs_io_request_s {
16*9c2bcf28SMartin Brandenburg 	__s32 __pad1;
17f7ab093fSMike Marshall 	__s32 buf_index;
18f7ab093fSMike Marshall 	__s32 count;
19*9c2bcf28SMartin Brandenburg 	__s32 __pad2;
20f7ab093fSMike Marshall 	__s64 offset;
218bb8aefdSYi Liu 	struct orangefs_object_kref refn;
228bb8aefdSYi Liu 	enum ORANGEFS_io_type io_type;
23f7ab093fSMike Marshall 	__s32 readahead_size;
24f7ab093fSMike Marshall };
25f7ab093fSMike Marshall 
268bb8aefdSYi Liu struct orangefs_lookup_request_s {
27f7ab093fSMike Marshall 	__s32 sym_follow;
28f7ab093fSMike Marshall 	__s32 __pad1;
298bb8aefdSYi Liu 	struct orangefs_object_kref parent_refn;
3047b4948fSMartin Brandenburg 	char d_name[ORANGEFS_NAME_MAX];
31f7ab093fSMike Marshall };
32f7ab093fSMike Marshall 
338bb8aefdSYi Liu struct orangefs_create_request_s {
348bb8aefdSYi Liu 	struct orangefs_object_kref parent_refn;
358bb8aefdSYi Liu 	struct ORANGEFS_sys_attr_s attributes;
3647b4948fSMartin Brandenburg 	char d_name[ORANGEFS_NAME_MAX];
37f7ab093fSMike Marshall };
38f7ab093fSMike Marshall 
398bb8aefdSYi Liu struct orangefs_symlink_request_s {
408bb8aefdSYi Liu 	struct orangefs_object_kref parent_refn;
418bb8aefdSYi Liu 	struct ORANGEFS_sys_attr_s attributes;
4247b4948fSMartin Brandenburg 	char entry_name[ORANGEFS_NAME_MAX];
4347b4948fSMartin Brandenburg 	char target[ORANGEFS_NAME_MAX];
44f7ab093fSMike Marshall };
45f7ab093fSMike Marshall 
468bb8aefdSYi Liu struct orangefs_getattr_request_s {
478bb8aefdSYi Liu 	struct orangefs_object_kref refn;
48f7ab093fSMike Marshall 	__u32 mask;
49f7ab093fSMike Marshall 	__u32 __pad1;
50f7ab093fSMike Marshall };
51f7ab093fSMike Marshall 
528bb8aefdSYi Liu struct orangefs_setattr_request_s {
538bb8aefdSYi Liu 	struct orangefs_object_kref refn;
548bb8aefdSYi Liu 	struct ORANGEFS_sys_attr_s attributes;
55f7ab093fSMike Marshall };
56f7ab093fSMike Marshall 
578bb8aefdSYi Liu struct orangefs_remove_request_s {
588bb8aefdSYi Liu 	struct orangefs_object_kref parent_refn;
5947b4948fSMartin Brandenburg 	char d_name[ORANGEFS_NAME_MAX];
60f7ab093fSMike Marshall };
61f7ab093fSMike Marshall 
628bb8aefdSYi Liu struct orangefs_mkdir_request_s {
638bb8aefdSYi Liu 	struct orangefs_object_kref parent_refn;
648bb8aefdSYi Liu 	struct ORANGEFS_sys_attr_s attributes;
6547b4948fSMartin Brandenburg 	char d_name[ORANGEFS_NAME_MAX];
66f7ab093fSMike Marshall };
67f7ab093fSMike Marshall 
688bb8aefdSYi Liu struct orangefs_readdir_request_s {
698bb8aefdSYi Liu 	struct orangefs_object_kref refn;
70f7ab093fSMike Marshall 	__u64 token;
71f7ab093fSMike Marshall 	__s32 max_dirent_count;
72f7ab093fSMike Marshall 	__s32 buf_index;
73f7ab093fSMike Marshall };
74f7ab093fSMike Marshall 
758bb8aefdSYi Liu struct orangefs_readdirplus_request_s {
768bb8aefdSYi Liu 	struct orangefs_object_kref refn;
77f7ab093fSMike Marshall 	__u64 token;
78f7ab093fSMike Marshall 	__s32 max_dirent_count;
79f7ab093fSMike Marshall 	__u32 mask;
80f7ab093fSMike Marshall 	__s32 buf_index;
81f7ab093fSMike Marshall 	__s32 __pad1;
82f7ab093fSMike Marshall };
83f7ab093fSMike Marshall 
848bb8aefdSYi Liu struct orangefs_rename_request_s {
858bb8aefdSYi Liu 	struct orangefs_object_kref old_parent_refn;
868bb8aefdSYi Liu 	struct orangefs_object_kref new_parent_refn;
8747b4948fSMartin Brandenburg 	char d_old_name[ORANGEFS_NAME_MAX];
8847b4948fSMartin Brandenburg 	char d_new_name[ORANGEFS_NAME_MAX];
89f7ab093fSMike Marshall };
90f7ab093fSMike Marshall 
918bb8aefdSYi Liu struct orangefs_statfs_request_s {
92f7ab093fSMike Marshall 	__s32 fs_id;
93f7ab093fSMike Marshall 	__s32 __pad1;
94f7ab093fSMike Marshall };
95f7ab093fSMike Marshall 
968bb8aefdSYi Liu struct orangefs_truncate_request_s {
978bb8aefdSYi Liu 	struct orangefs_object_kref refn;
98f7ab093fSMike Marshall 	__s64 size;
99f7ab093fSMike Marshall };
100f7ab093fSMike Marshall 
1018bb8aefdSYi Liu struct orangefs_mmap_ra_cache_flush_request_s {
1028bb8aefdSYi Liu 	struct orangefs_object_kref refn;
103f7ab093fSMike Marshall };
104f7ab093fSMike Marshall 
1058bb8aefdSYi Liu struct orangefs_fs_mount_request_s {
1068bb8aefdSYi Liu 	char orangefs_config_server[ORANGEFS_MAX_SERVER_ADDR_LEN];
107f7ab093fSMike Marshall };
108f7ab093fSMike Marshall 
1098bb8aefdSYi Liu struct orangefs_fs_umount_request_s {
110f7ab093fSMike Marshall 	__s32 id;
111f7ab093fSMike Marshall 	__s32 fs_id;
1128bb8aefdSYi Liu 	char orangefs_config_server[ORANGEFS_MAX_SERVER_ADDR_LEN];
113f7ab093fSMike Marshall };
114f7ab093fSMike Marshall 
1158bb8aefdSYi Liu struct orangefs_getxattr_request_s {
1168bb8aefdSYi Liu 	struct orangefs_object_kref refn;
117f7ab093fSMike Marshall 	__s32 key_sz;
118f7ab093fSMike Marshall 	__s32 __pad1;
1198bb8aefdSYi Liu 	char key[ORANGEFS_MAX_XATTR_NAMELEN];
120f7ab093fSMike Marshall };
121f7ab093fSMike Marshall 
1228bb8aefdSYi Liu struct orangefs_setxattr_request_s {
1238bb8aefdSYi Liu 	struct orangefs_object_kref refn;
1248bb8aefdSYi Liu 	struct ORANGEFS_keyval_pair keyval;
125f7ab093fSMike Marshall 	__s32 flags;
126f7ab093fSMike Marshall 	__s32 __pad1;
127f7ab093fSMike Marshall };
128f7ab093fSMike Marshall 
1298bb8aefdSYi Liu struct orangefs_listxattr_request_s {
1308bb8aefdSYi Liu 	struct orangefs_object_kref refn;
131f7ab093fSMike Marshall 	__s32 requested_count;
132f7ab093fSMike Marshall 	__s32 __pad1;
133f7ab093fSMike Marshall 	__u64 token;
134f7ab093fSMike Marshall };
135f7ab093fSMike Marshall 
1368bb8aefdSYi Liu struct orangefs_removexattr_request_s {
1378bb8aefdSYi Liu 	struct orangefs_object_kref refn;
138f7ab093fSMike Marshall 	__s32 key_sz;
139f7ab093fSMike Marshall 	__s32 __pad1;
1408bb8aefdSYi Liu 	char key[ORANGEFS_MAX_XATTR_NAMELEN];
141f7ab093fSMike Marshall };
142f7ab093fSMike Marshall 
1438bb8aefdSYi Liu struct orangefs_op_cancel_s {
144f7ab093fSMike Marshall 	__u64 op_tag;
145f7ab093fSMike Marshall };
146f7ab093fSMike Marshall 
1478bb8aefdSYi Liu struct orangefs_fsync_request_s {
1488bb8aefdSYi Liu 	struct orangefs_object_kref refn;
149f7ab093fSMike Marshall };
150f7ab093fSMike Marshall 
1518bb8aefdSYi Liu enum orangefs_param_request_type {
1528bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_SET = 1,
1538bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_GET = 2
154f7ab093fSMike Marshall };
155f7ab093fSMike Marshall 
1568bb8aefdSYi Liu enum orangefs_param_request_op {
1578bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_ACACHE_TIMEOUT_MSECS = 1,
1588bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_ACACHE_HARD_LIMIT = 2,
1598bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_ACACHE_SOFT_LIMIT = 3,
1608bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_ACACHE_RECLAIM_PERCENTAGE = 4,
1618bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_PERF_TIME_INTERVAL_SECS = 5,
1628bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_PERF_HISTORY_SIZE = 6,
1638bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_PERF_RESET = 7,
1648bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_NCACHE_TIMEOUT_MSECS = 8,
1658bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_NCACHE_HARD_LIMIT = 9,
1668bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_NCACHE_SOFT_LIMIT = 10,
1678bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_NCACHE_RECLAIM_PERCENTAGE = 11,
1688bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_STATIC_ACACHE_TIMEOUT_MSECS = 12,
1698bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_STATIC_ACACHE_HARD_LIMIT = 13,
1708bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_STATIC_ACACHE_SOFT_LIMIT = 14,
1718bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_STATIC_ACACHE_RECLAIM_PERCENTAGE = 15,
1728bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_CLIENT_DEBUG = 16,
1738bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_CCACHE_TIMEOUT_SECS = 17,
1748bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_CCACHE_HARD_LIMIT = 18,
1758bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_CCACHE_SOFT_LIMIT = 19,
1768bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_CCACHE_RECLAIM_PERCENTAGE = 20,
1778bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_TIMEOUT_SECS = 21,
1788bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_HARD_LIMIT = 22,
1798bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_SOFT_LIMIT = 23,
1808bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_RECLAIM_PERCENTAGE = 24,
1818bb8aefdSYi Liu 	ORANGEFS_PARAM_REQUEST_OP_TWO_MASK_VALUES = 25,
182f7ab093fSMike Marshall };
183f7ab093fSMike Marshall 
1848bb8aefdSYi Liu struct orangefs_param_request_s {
1858bb8aefdSYi Liu 	enum orangefs_param_request_type type;
1868bb8aefdSYi Liu 	enum orangefs_param_request_op op;
187f7ab093fSMike Marshall 	__s64 value;
1888bb8aefdSYi Liu 	char s_value[ORANGEFS_MAX_DEBUG_STRING_LEN];
189f7ab093fSMike Marshall };
190f7ab093fSMike Marshall 
1918bb8aefdSYi Liu enum orangefs_perf_count_request_type {
1928bb8aefdSYi Liu 	ORANGEFS_PERF_COUNT_REQUEST_ACACHE = 1,
1938bb8aefdSYi Liu 	ORANGEFS_PERF_COUNT_REQUEST_NCACHE = 2,
1948bb8aefdSYi Liu 	ORANGEFS_PERF_COUNT_REQUEST_CAPCACHE = 3,
195f7ab093fSMike Marshall };
196f7ab093fSMike Marshall 
1978bb8aefdSYi Liu struct orangefs_perf_count_request_s {
1988bb8aefdSYi Liu 	enum orangefs_perf_count_request_type type;
199f7ab093fSMike Marshall 	__s32 __pad1;
200f7ab093fSMike Marshall };
201f7ab093fSMike Marshall 
2028bb8aefdSYi Liu struct orangefs_fs_key_request_s {
203f7ab093fSMike Marshall 	__s32 fsid;
204f7ab093fSMike Marshall 	__s32 __pad1;
205f7ab093fSMike Marshall };
206f7ab093fSMike Marshall 
2078bb8aefdSYi Liu struct orangefs_upcall_s {
208f7ab093fSMike Marshall 	__s32 type;
209f7ab093fSMike Marshall 	__u32 uid;
210f7ab093fSMike Marshall 	__u32 gid;
211f7ab093fSMike Marshall 	int pid;
212f7ab093fSMike Marshall 	int tgid;
213f0ed4418SMartin Brandenburg 	/* Trailers unused but must be retained for protocol compatibility. */
214f7ab093fSMike Marshall 	__s64 trailer_size;
215f7ab093fSMike Marshall 	char *trailer_buf;
216f7ab093fSMike Marshall 
217f7ab093fSMike Marshall 	union {
2188bb8aefdSYi Liu 		struct orangefs_io_request_s io;
2198bb8aefdSYi Liu 		struct orangefs_lookup_request_s lookup;
2208bb8aefdSYi Liu 		struct orangefs_create_request_s create;
2218bb8aefdSYi Liu 		struct orangefs_symlink_request_s sym;
2228bb8aefdSYi Liu 		struct orangefs_getattr_request_s getattr;
2238bb8aefdSYi Liu 		struct orangefs_setattr_request_s setattr;
2248bb8aefdSYi Liu 		struct orangefs_remove_request_s remove;
2258bb8aefdSYi Liu 		struct orangefs_mkdir_request_s mkdir;
2268bb8aefdSYi Liu 		struct orangefs_readdir_request_s readdir;
2278bb8aefdSYi Liu 		struct orangefs_readdirplus_request_s readdirplus;
2288bb8aefdSYi Liu 		struct orangefs_rename_request_s rename;
2298bb8aefdSYi Liu 		struct orangefs_statfs_request_s statfs;
2308bb8aefdSYi Liu 		struct orangefs_truncate_request_s truncate;
2318bb8aefdSYi Liu 		struct orangefs_mmap_ra_cache_flush_request_s ra_cache_flush;
2328bb8aefdSYi Liu 		struct orangefs_fs_mount_request_s fs_mount;
2338bb8aefdSYi Liu 		struct orangefs_fs_umount_request_s fs_umount;
2348bb8aefdSYi Liu 		struct orangefs_getxattr_request_s getxattr;
2358bb8aefdSYi Liu 		struct orangefs_setxattr_request_s setxattr;
2368bb8aefdSYi Liu 		struct orangefs_listxattr_request_s listxattr;
2378bb8aefdSYi Liu 		struct orangefs_removexattr_request_s removexattr;
2388bb8aefdSYi Liu 		struct orangefs_op_cancel_s cancel;
2398bb8aefdSYi Liu 		struct orangefs_fsync_request_s fsync;
2408bb8aefdSYi Liu 		struct orangefs_param_request_s param;
2418bb8aefdSYi Liu 		struct orangefs_perf_count_request_s perf_count;
2428bb8aefdSYi Liu 		struct orangefs_fs_key_request_s fs_key;
243f7ab093fSMike Marshall 	} req;
244f7ab093fSMike Marshall };
245f7ab093fSMike Marshall 
246f7ab093fSMike Marshall #endif /* __UPCALL_H */
247