162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * (C) 2001 Clemson University and The University of Chicago
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * See COPYING in top-level directory.
662306a36Sopenharmony_ci */
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#ifndef __UPCALL_H
962306a36Sopenharmony_ci#define __UPCALL_H
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci/*
1262306a36Sopenharmony_ci * Sanitized this header file to fix
1362306a36Sopenharmony_ci * 32-64 bit interaction issues between
1462306a36Sopenharmony_ci * client-core and device
1562306a36Sopenharmony_ci */
1662306a36Sopenharmony_cistruct orangefs_io_request_s {
1762306a36Sopenharmony_ci	__s32 __pad1;
1862306a36Sopenharmony_ci	__s32 buf_index;
1962306a36Sopenharmony_ci	__s32 count;
2062306a36Sopenharmony_ci	__s32 __pad2;
2162306a36Sopenharmony_ci	__s64 offset;
2262306a36Sopenharmony_ci	struct orangefs_object_kref refn;
2362306a36Sopenharmony_ci	enum ORANGEFS_io_type io_type;
2462306a36Sopenharmony_ci	__s32 readahead_size;
2562306a36Sopenharmony_ci};
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_cistruct orangefs_lookup_request_s {
2862306a36Sopenharmony_ci	__s32 sym_follow;
2962306a36Sopenharmony_ci	__s32 __pad1;
3062306a36Sopenharmony_ci	struct orangefs_object_kref parent_refn;
3162306a36Sopenharmony_ci	char d_name[ORANGEFS_NAME_MAX];
3262306a36Sopenharmony_ci};
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_cistruct orangefs_create_request_s {
3562306a36Sopenharmony_ci	struct orangefs_object_kref parent_refn;
3662306a36Sopenharmony_ci	struct ORANGEFS_sys_attr_s attributes;
3762306a36Sopenharmony_ci	char d_name[ORANGEFS_NAME_MAX];
3862306a36Sopenharmony_ci};
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_cistruct orangefs_symlink_request_s {
4162306a36Sopenharmony_ci	struct orangefs_object_kref parent_refn;
4262306a36Sopenharmony_ci	struct ORANGEFS_sys_attr_s attributes;
4362306a36Sopenharmony_ci	char entry_name[ORANGEFS_NAME_MAX];
4462306a36Sopenharmony_ci	char target[ORANGEFS_NAME_MAX];
4562306a36Sopenharmony_ci};
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_cistruct orangefs_getattr_request_s {
4862306a36Sopenharmony_ci	struct orangefs_object_kref refn;
4962306a36Sopenharmony_ci	__u32 mask;
5062306a36Sopenharmony_ci	__u32 __pad1;
5162306a36Sopenharmony_ci};
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_cistruct orangefs_setattr_request_s {
5462306a36Sopenharmony_ci	struct orangefs_object_kref refn;
5562306a36Sopenharmony_ci	struct ORANGEFS_sys_attr_s attributes;
5662306a36Sopenharmony_ci};
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_cistruct orangefs_remove_request_s {
5962306a36Sopenharmony_ci	struct orangefs_object_kref parent_refn;
6062306a36Sopenharmony_ci	char d_name[ORANGEFS_NAME_MAX];
6162306a36Sopenharmony_ci};
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_cistruct orangefs_mkdir_request_s {
6462306a36Sopenharmony_ci	struct orangefs_object_kref parent_refn;
6562306a36Sopenharmony_ci	struct ORANGEFS_sys_attr_s attributes;
6662306a36Sopenharmony_ci	char d_name[ORANGEFS_NAME_MAX];
6762306a36Sopenharmony_ci};
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_cistruct orangefs_readdir_request_s {
7062306a36Sopenharmony_ci	struct orangefs_object_kref refn;
7162306a36Sopenharmony_ci	__u64 token;
7262306a36Sopenharmony_ci	__s32 max_dirent_count;
7362306a36Sopenharmony_ci	__s32 buf_index;
7462306a36Sopenharmony_ci};
7562306a36Sopenharmony_ci
7662306a36Sopenharmony_cistruct orangefs_readdirplus_request_s {
7762306a36Sopenharmony_ci	struct orangefs_object_kref refn;
7862306a36Sopenharmony_ci	__u64 token;
7962306a36Sopenharmony_ci	__s32 max_dirent_count;
8062306a36Sopenharmony_ci	__u32 mask;
8162306a36Sopenharmony_ci	__s32 buf_index;
8262306a36Sopenharmony_ci	__s32 __pad1;
8362306a36Sopenharmony_ci};
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_cistruct orangefs_rename_request_s {
8662306a36Sopenharmony_ci	struct orangefs_object_kref old_parent_refn;
8762306a36Sopenharmony_ci	struct orangefs_object_kref new_parent_refn;
8862306a36Sopenharmony_ci	char d_old_name[ORANGEFS_NAME_MAX];
8962306a36Sopenharmony_ci	char d_new_name[ORANGEFS_NAME_MAX];
9062306a36Sopenharmony_ci};
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_cistruct orangefs_statfs_request_s {
9362306a36Sopenharmony_ci	__s32 fs_id;
9462306a36Sopenharmony_ci	__s32 __pad1;
9562306a36Sopenharmony_ci};
9662306a36Sopenharmony_ci
9762306a36Sopenharmony_cistruct orangefs_truncate_request_s {
9862306a36Sopenharmony_ci	struct orangefs_object_kref refn;
9962306a36Sopenharmony_ci	__s64 size;
10062306a36Sopenharmony_ci};
10162306a36Sopenharmony_ci
10262306a36Sopenharmony_cistruct orangefs_ra_cache_flush_request_s {
10362306a36Sopenharmony_ci	struct orangefs_object_kref refn;
10462306a36Sopenharmony_ci};
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_cistruct orangefs_fs_mount_request_s {
10762306a36Sopenharmony_ci	char orangefs_config_server[ORANGEFS_MAX_SERVER_ADDR_LEN];
10862306a36Sopenharmony_ci};
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_cistruct orangefs_fs_umount_request_s {
11162306a36Sopenharmony_ci	__s32 id;
11262306a36Sopenharmony_ci	__s32 fs_id;
11362306a36Sopenharmony_ci	char orangefs_config_server[ORANGEFS_MAX_SERVER_ADDR_LEN];
11462306a36Sopenharmony_ci};
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_cistruct orangefs_getxattr_request_s {
11762306a36Sopenharmony_ci	struct orangefs_object_kref refn;
11862306a36Sopenharmony_ci	__s32 key_sz;
11962306a36Sopenharmony_ci	__s32 __pad1;
12062306a36Sopenharmony_ci	char key[ORANGEFS_MAX_XATTR_NAMELEN];
12162306a36Sopenharmony_ci};
12262306a36Sopenharmony_ci
12362306a36Sopenharmony_cistruct orangefs_setxattr_request_s {
12462306a36Sopenharmony_ci	struct orangefs_object_kref refn;
12562306a36Sopenharmony_ci	struct ORANGEFS_keyval_pair keyval;
12662306a36Sopenharmony_ci	__s32 flags;
12762306a36Sopenharmony_ci	__s32 __pad1;
12862306a36Sopenharmony_ci};
12962306a36Sopenharmony_ci
13062306a36Sopenharmony_cistruct orangefs_listxattr_request_s {
13162306a36Sopenharmony_ci	struct orangefs_object_kref refn;
13262306a36Sopenharmony_ci	__s32 requested_count;
13362306a36Sopenharmony_ci	__s32 __pad1;
13462306a36Sopenharmony_ci	__u64 token;
13562306a36Sopenharmony_ci};
13662306a36Sopenharmony_ci
13762306a36Sopenharmony_cistruct orangefs_removexattr_request_s {
13862306a36Sopenharmony_ci	struct orangefs_object_kref refn;
13962306a36Sopenharmony_ci	__s32 key_sz;
14062306a36Sopenharmony_ci	__s32 __pad1;
14162306a36Sopenharmony_ci	char key[ORANGEFS_MAX_XATTR_NAMELEN];
14262306a36Sopenharmony_ci};
14362306a36Sopenharmony_ci
14462306a36Sopenharmony_cistruct orangefs_op_cancel_s {
14562306a36Sopenharmony_ci	__u64 op_tag;
14662306a36Sopenharmony_ci};
14762306a36Sopenharmony_ci
14862306a36Sopenharmony_cistruct orangefs_fsync_request_s {
14962306a36Sopenharmony_ci	struct orangefs_object_kref refn;
15062306a36Sopenharmony_ci};
15162306a36Sopenharmony_ci
15262306a36Sopenharmony_cienum orangefs_param_request_type {
15362306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_SET = 1,
15462306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_GET = 2
15562306a36Sopenharmony_ci};
15662306a36Sopenharmony_ci
15762306a36Sopenharmony_cienum orangefs_param_request_op {
15862306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_ACACHE_TIMEOUT_MSECS = 1,
15962306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_ACACHE_HARD_LIMIT = 2,
16062306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_ACACHE_SOFT_LIMIT = 3,
16162306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_ACACHE_RECLAIM_PERCENTAGE = 4,
16262306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_PERF_TIME_INTERVAL_SECS = 5,
16362306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_PERF_HISTORY_SIZE = 6,
16462306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_PERF_RESET = 7,
16562306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_NCACHE_TIMEOUT_MSECS = 8,
16662306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_NCACHE_HARD_LIMIT = 9,
16762306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_NCACHE_SOFT_LIMIT = 10,
16862306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_NCACHE_RECLAIM_PERCENTAGE = 11,
16962306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_STATIC_ACACHE_TIMEOUT_MSECS = 12,
17062306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_STATIC_ACACHE_HARD_LIMIT = 13,
17162306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_STATIC_ACACHE_SOFT_LIMIT = 14,
17262306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_STATIC_ACACHE_RECLAIM_PERCENTAGE = 15,
17362306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_CLIENT_DEBUG = 16,
17462306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_CCACHE_TIMEOUT_SECS = 17,
17562306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_CCACHE_HARD_LIMIT = 18,
17662306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_CCACHE_SOFT_LIMIT = 19,
17762306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_CCACHE_RECLAIM_PERCENTAGE = 20,
17862306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_TIMEOUT_SECS = 21,
17962306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_HARD_LIMIT = 22,
18062306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_SOFT_LIMIT = 23,
18162306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_RECLAIM_PERCENTAGE = 24,
18262306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_TWO_MASK_VALUES = 25,
18362306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_READAHEAD_SIZE = 26,
18462306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT = 27,
18562306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE = 28,
18662306a36Sopenharmony_ci	ORANGEFS_PARAM_REQUEST_OP_READAHEAD_READCNT = 29,
18762306a36Sopenharmony_ci};
18862306a36Sopenharmony_ci
18962306a36Sopenharmony_cistruct orangefs_param_request_s {
19062306a36Sopenharmony_ci	enum orangefs_param_request_type type;
19162306a36Sopenharmony_ci	enum orangefs_param_request_op op;
19262306a36Sopenharmony_ci	union {
19362306a36Sopenharmony_ci		__s64 value64;
19462306a36Sopenharmony_ci		__s32 value32[2];
19562306a36Sopenharmony_ci	} u;
19662306a36Sopenharmony_ci	char s_value[ORANGEFS_MAX_DEBUG_STRING_LEN];
19762306a36Sopenharmony_ci};
19862306a36Sopenharmony_ci
19962306a36Sopenharmony_cienum orangefs_perf_count_request_type {
20062306a36Sopenharmony_ci	ORANGEFS_PERF_COUNT_REQUEST_ACACHE = 1,
20162306a36Sopenharmony_ci	ORANGEFS_PERF_COUNT_REQUEST_NCACHE = 2,
20262306a36Sopenharmony_ci	ORANGEFS_PERF_COUNT_REQUEST_CAPCACHE = 3,
20362306a36Sopenharmony_ci};
20462306a36Sopenharmony_ci
20562306a36Sopenharmony_cistruct orangefs_perf_count_request_s {
20662306a36Sopenharmony_ci	enum orangefs_perf_count_request_type type;
20762306a36Sopenharmony_ci	__s32 __pad1;
20862306a36Sopenharmony_ci};
20962306a36Sopenharmony_ci
21062306a36Sopenharmony_cistruct orangefs_fs_key_request_s {
21162306a36Sopenharmony_ci	__s32 fsid;
21262306a36Sopenharmony_ci	__s32 __pad1;
21362306a36Sopenharmony_ci};
21462306a36Sopenharmony_ci
21562306a36Sopenharmony_ci/* 2.9.6 */
21662306a36Sopenharmony_cistruct orangefs_features_request_s {
21762306a36Sopenharmony_ci	__u64 features;
21862306a36Sopenharmony_ci};
21962306a36Sopenharmony_ci
22062306a36Sopenharmony_cistruct orangefs_upcall_s {
22162306a36Sopenharmony_ci	__s32 type;
22262306a36Sopenharmony_ci	__u32 uid;
22362306a36Sopenharmony_ci	__u32 gid;
22462306a36Sopenharmony_ci	int pid;
22562306a36Sopenharmony_ci	int tgid;
22662306a36Sopenharmony_ci	/* Trailers unused but must be retained for protocol compatibility. */
22762306a36Sopenharmony_ci	__s64 trailer_size;
22862306a36Sopenharmony_ci	char *trailer_buf;
22962306a36Sopenharmony_ci
23062306a36Sopenharmony_ci	union {
23162306a36Sopenharmony_ci		struct orangefs_io_request_s io;
23262306a36Sopenharmony_ci		struct orangefs_lookup_request_s lookup;
23362306a36Sopenharmony_ci		struct orangefs_create_request_s create;
23462306a36Sopenharmony_ci		struct orangefs_symlink_request_s sym;
23562306a36Sopenharmony_ci		struct orangefs_getattr_request_s getattr;
23662306a36Sopenharmony_ci		struct orangefs_setattr_request_s setattr;
23762306a36Sopenharmony_ci		struct orangefs_remove_request_s remove;
23862306a36Sopenharmony_ci		struct orangefs_mkdir_request_s mkdir;
23962306a36Sopenharmony_ci		struct orangefs_readdir_request_s readdir;
24062306a36Sopenharmony_ci		struct orangefs_readdirplus_request_s readdirplus;
24162306a36Sopenharmony_ci		struct orangefs_rename_request_s rename;
24262306a36Sopenharmony_ci		struct orangefs_statfs_request_s statfs;
24362306a36Sopenharmony_ci		struct orangefs_truncate_request_s truncate;
24462306a36Sopenharmony_ci		struct orangefs_ra_cache_flush_request_s ra_cache_flush;
24562306a36Sopenharmony_ci		struct orangefs_fs_mount_request_s fs_mount;
24662306a36Sopenharmony_ci		struct orangefs_fs_umount_request_s fs_umount;
24762306a36Sopenharmony_ci		struct orangefs_getxattr_request_s getxattr;
24862306a36Sopenharmony_ci		struct orangefs_setxattr_request_s setxattr;
24962306a36Sopenharmony_ci		struct orangefs_listxattr_request_s listxattr;
25062306a36Sopenharmony_ci		struct orangefs_removexattr_request_s removexattr;
25162306a36Sopenharmony_ci		struct orangefs_op_cancel_s cancel;
25262306a36Sopenharmony_ci		struct orangefs_fsync_request_s fsync;
25362306a36Sopenharmony_ci		struct orangefs_param_request_s param;
25462306a36Sopenharmony_ci		struct orangefs_perf_count_request_s perf_count;
25562306a36Sopenharmony_ci		struct orangefs_fs_key_request_s fs_key;
25662306a36Sopenharmony_ci		struct orangefs_features_request_s features;
25762306a36Sopenharmony_ci	} req;
25862306a36Sopenharmony_ci};
25962306a36Sopenharmony_ci
26062306a36Sopenharmony_ci#endif /* __UPCALL_H */
261