^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * (C) 2001 Clemson University and The University of Chicago
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * See COPYING in top-level directory.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * Definitions of downcalls used in Linux kernel module.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #ifndef __DOWNCALL_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #define __DOWNCALL_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * Sanitized the device-client core interaction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * for clean 32-64 bit usage
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) struct orangefs_io_response {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) __s64 amt_complete;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) struct orangefs_lookup_response {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) struct orangefs_object_kref refn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) struct orangefs_create_response {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) struct orangefs_object_kref refn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) struct orangefs_symlink_response {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) struct orangefs_object_kref refn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) struct orangefs_getattr_response {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) struct ORANGEFS_sys_attr_s attributes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) char link_target[ORANGEFS_NAME_MAX];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) struct orangefs_mkdir_response {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) struct orangefs_object_kref refn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) struct orangefs_statfs_response {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) __s64 block_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) __s64 blocks_total;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) __s64 blocks_avail;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) __s64 files_total;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) __s64 files_avail;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) struct orangefs_fs_mount_response {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) __s32 fs_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) __s32 id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) struct orangefs_khandle root_khandle;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) /* the getxattr response is the attribute value */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) struct orangefs_getxattr_response {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) __s32 val_sz;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) __s32 __pad1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) char val[ORANGEFS_MAX_XATTR_VALUELEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) /* the listxattr response is an array of attribute names */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) struct orangefs_listxattr_response {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) __s32 returned_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) __s32 __pad1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) __u64 token;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) char key[ORANGEFS_MAX_XATTR_LISTLEN * ORANGEFS_MAX_XATTR_NAMELEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) __s32 keylen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) __s32 __pad2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) __s32 lengths[ORANGEFS_MAX_XATTR_LISTLEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) struct orangefs_param_response {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) __s64 value64;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) __s32 value32[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) } u;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) #define PERF_COUNT_BUF_SIZE 4096
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) struct orangefs_perf_count_response {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) char buffer[PERF_COUNT_BUF_SIZE];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) #define FS_KEY_BUF_SIZE 4096
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) struct orangefs_fs_key_response {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) __s32 fs_keylen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) __s32 __pad1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) char fs_key[FS_KEY_BUF_SIZE];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) /* 2.9.6 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) struct orangefs_features_response {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) __u64 features;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) struct orangefs_downcall_s {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) __s32 type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) __s32 status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) /* currently trailer is used only by readdir */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) __s64 trailer_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) char *trailer_buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) struct orangefs_io_response io;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) struct orangefs_lookup_response lookup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) struct orangefs_create_response create;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) struct orangefs_symlink_response sym;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) struct orangefs_getattr_response getattr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) struct orangefs_mkdir_response mkdir;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) struct orangefs_statfs_response statfs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) struct orangefs_fs_mount_response fs_mount;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) struct orangefs_getxattr_response getxattr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) struct orangefs_listxattr_response listxattr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) struct orangefs_param_response param;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) struct orangefs_perf_count_response perf_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) struct orangefs_fs_key_response fs_key;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) struct orangefs_features_response features;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) } resp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) * The readdir response comes in the trailer. It is followed by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) * directory entries as described in dir.c.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) struct orangefs_readdir_response_s {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) __u64 token;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) __u64 directory_version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) __u32 __pad2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) __u32 orangefs_dirent_outcount;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) #endif /* __DOWNCALL_H */