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