Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 1 | /* |
| 2 | * (C) 2001 Clemson University and The University of Chicago |
| 3 | * |
| 4 | * See COPYING in top-level directory. |
| 5 | */ |
| 6 | |
| 7 | /* |
| 8 | * Definitions of downcalls used in Linux kernel module. |
| 9 | */ |
| 10 | |
| 11 | #ifndef __DOWNCALL_H |
| 12 | #define __DOWNCALL_H |
| 13 | |
| 14 | /* |
| 15 | * Sanitized the device-client core interaction |
| 16 | * for clean 32-64 bit usage |
| 17 | */ |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 18 | struct orangefs_io_response { |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 19 | __s64 amt_complete; |
| 20 | }; |
| 21 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 22 | struct orangefs_lookup_response { |
| 23 | struct orangefs_object_kref refn; |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 24 | }; |
| 25 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 26 | struct orangefs_create_response { |
| 27 | struct orangefs_object_kref refn; |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 28 | }; |
| 29 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 30 | struct orangefs_symlink_response { |
| 31 | struct orangefs_object_kref refn; |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 32 | }; |
| 33 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 34 | struct orangefs_getattr_response { |
| 35 | struct ORANGEFS_sys_attr_s attributes; |
Martin Brandenburg | 47b4948 | 2016-02-20 14:22:40 -0500 | [diff] [blame] | 36 | char link_target[ORANGEFS_NAME_MAX]; |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 37 | }; |
| 38 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 39 | struct orangefs_mkdir_response { |
| 40 | struct orangefs_object_kref refn; |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | /* |
| 44 | * duplication of some system interface structures so that I don't have |
| 45 | * to allocate extra memory |
| 46 | */ |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 47 | struct orangefs_dirent { |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 48 | char *d_name; |
| 49 | int d_length; |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 50 | struct orangefs_khandle khandle; |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 51 | }; |
| 52 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 53 | struct orangefs_statfs_response { |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 54 | __s64 block_size; |
| 55 | __s64 blocks_total; |
| 56 | __s64 blocks_avail; |
| 57 | __s64 files_total; |
| 58 | __s64 files_avail; |
| 59 | }; |
| 60 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 61 | struct orangefs_fs_mount_response { |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 62 | __s32 fs_id; |
| 63 | __s32 id; |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 64 | struct orangefs_khandle root_khandle; |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 65 | }; |
| 66 | |
| 67 | /* the getxattr response is the attribute value */ |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 68 | struct orangefs_getxattr_response { |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 69 | __s32 val_sz; |
| 70 | __s32 __pad1; |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 71 | char val[ORANGEFS_MAX_XATTR_VALUELEN]; |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 72 | }; |
| 73 | |
| 74 | /* the listxattr response is an array of attribute names */ |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 75 | struct orangefs_listxattr_response { |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 76 | __s32 returned_count; |
| 77 | __s32 __pad1; |
| 78 | __u64 token; |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 79 | char key[ORANGEFS_MAX_XATTR_LISTLEN * ORANGEFS_MAX_XATTR_NAMELEN]; |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 80 | __s32 keylen; |
| 81 | __s32 __pad2; |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 82 | __s32 lengths[ORANGEFS_MAX_XATTR_LISTLEN]; |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 83 | }; |
| 84 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 85 | struct orangefs_param_response { |
Martin Brandenburg | 680908e | 2016-08-02 16:33:34 -0400 | [diff] [blame] | 86 | union { |
| 87 | __s64 value64; |
| 88 | __s32 value32[2]; |
| 89 | } u; |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 90 | }; |
| 91 | |
| 92 | #define PERF_COUNT_BUF_SIZE 4096 |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 93 | struct orangefs_perf_count_response { |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 94 | char buffer[PERF_COUNT_BUF_SIZE]; |
| 95 | }; |
| 96 | |
| 97 | #define FS_KEY_BUF_SIZE 4096 |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 98 | struct orangefs_fs_key_response { |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 99 | __s32 fs_keylen; |
| 100 | __s32 __pad1; |
| 101 | char fs_key[FS_KEY_BUF_SIZE]; |
| 102 | }; |
| 103 | |
Martin Brandenburg | 482664d | 2016-08-12 12:02:31 -0400 | [diff] [blame] | 104 | /* 2.9.6 */ |
| 105 | struct orangefs_features_response { |
| 106 | __u64 features; |
| 107 | }; |
| 108 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 109 | struct orangefs_downcall_s { |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 110 | __s32 type; |
| 111 | __s32 status; |
| 112 | /* currently trailer is used only by readdir */ |
| 113 | __s64 trailer_size; |
Mike Marshall | 5480494 | 2015-10-05 13:44:24 -0400 | [diff] [blame] | 114 | char *trailer_buf; |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 115 | |
| 116 | union { |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 117 | struct orangefs_io_response io; |
| 118 | struct orangefs_lookup_response lookup; |
| 119 | struct orangefs_create_response create; |
| 120 | struct orangefs_symlink_response sym; |
| 121 | struct orangefs_getattr_response getattr; |
| 122 | struct orangefs_mkdir_response mkdir; |
| 123 | struct orangefs_statfs_response statfs; |
| 124 | struct orangefs_fs_mount_response fs_mount; |
| 125 | struct orangefs_getxattr_response getxattr; |
| 126 | struct orangefs_listxattr_response listxattr; |
| 127 | struct orangefs_param_response param; |
| 128 | struct orangefs_perf_count_response perf_count; |
| 129 | struct orangefs_fs_key_response fs_key; |
Martin Brandenburg | 482664d | 2016-08-12 12:02:31 -0400 | [diff] [blame] | 130 | struct orangefs_features_response features; |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 131 | } resp; |
| 132 | }; |
| 133 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 134 | struct orangefs_readdir_response_s { |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 135 | __u64 token; |
| 136 | __u64 directory_version; |
| 137 | __u32 __pad2; |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 138 | __u32 orangefs_dirent_outcount; |
| 139 | struct orangefs_dirent *dirent_array; |
Mike Marshall | f7ab093 | 2015-07-17 10:38:11 -0400 | [diff] [blame] | 140 | }; |
| 141 | |
| 142 | #endif /* __DOWNCALL_H */ |