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 | */ |
| 18 | struct pvfs2_io_response { |
| 19 | __s64 amt_complete; |
| 20 | }; |
| 21 | |
| 22 | struct pvfs2_iox_response { |
| 23 | __s64 amt_complete; |
| 24 | }; |
| 25 | |
| 26 | struct pvfs2_lookup_response { |
| 27 | struct pvfs2_object_kref refn; |
| 28 | }; |
| 29 | |
| 30 | struct pvfs2_create_response { |
| 31 | struct pvfs2_object_kref refn; |
| 32 | }; |
| 33 | |
| 34 | struct pvfs2_symlink_response { |
| 35 | struct pvfs2_object_kref refn; |
| 36 | }; |
| 37 | |
| 38 | struct pvfs2_getattr_response { |
| 39 | struct PVFS_sys_attr_s attributes; |
| 40 | char link_target[PVFS2_NAME_LEN]; |
| 41 | }; |
| 42 | |
| 43 | struct pvfs2_mkdir_response { |
| 44 | struct pvfs2_object_kref refn; |
| 45 | }; |
| 46 | |
| 47 | /* |
| 48 | * duplication of some system interface structures so that I don't have |
| 49 | * to allocate extra memory |
| 50 | */ |
| 51 | struct pvfs2_dirent { |
| 52 | char *d_name; |
| 53 | int d_length; |
| 54 | struct pvfs2_khandle khandle; |
| 55 | }; |
| 56 | |
| 57 | struct pvfs2_statfs_response { |
| 58 | __s64 block_size; |
| 59 | __s64 blocks_total; |
| 60 | __s64 blocks_avail; |
| 61 | __s64 files_total; |
| 62 | __s64 files_avail; |
| 63 | }; |
| 64 | |
| 65 | struct pvfs2_fs_mount_response { |
| 66 | __s32 fs_id; |
| 67 | __s32 id; |
| 68 | struct pvfs2_khandle root_khandle; |
| 69 | }; |
| 70 | |
| 71 | /* the getxattr response is the attribute value */ |
| 72 | struct pvfs2_getxattr_response { |
| 73 | __s32 val_sz; |
| 74 | __s32 __pad1; |
| 75 | char val[PVFS_MAX_XATTR_VALUELEN]; |
| 76 | }; |
| 77 | |
| 78 | /* the listxattr response is an array of attribute names */ |
| 79 | struct pvfs2_listxattr_response { |
| 80 | __s32 returned_count; |
| 81 | __s32 __pad1; |
| 82 | __u64 token; |
| 83 | char key[PVFS_MAX_XATTR_LISTLEN * PVFS_MAX_XATTR_NAMELEN]; |
| 84 | __s32 keylen; |
| 85 | __s32 __pad2; |
| 86 | __s32 lengths[PVFS_MAX_XATTR_LISTLEN]; |
| 87 | }; |
| 88 | |
| 89 | struct pvfs2_param_response { |
| 90 | __s64 value; |
| 91 | }; |
| 92 | |
| 93 | #define PERF_COUNT_BUF_SIZE 4096 |
| 94 | struct pvfs2_perf_count_response { |
| 95 | char buffer[PERF_COUNT_BUF_SIZE]; |
| 96 | }; |
| 97 | |
| 98 | #define FS_KEY_BUF_SIZE 4096 |
| 99 | struct pvfs2_fs_key_response { |
| 100 | __s32 fs_keylen; |
| 101 | __s32 __pad1; |
| 102 | char fs_key[FS_KEY_BUF_SIZE]; |
| 103 | }; |
| 104 | |
| 105 | struct pvfs2_downcall_s { |
| 106 | __s32 type; |
| 107 | __s32 status; |
| 108 | /* currently trailer is used only by readdir */ |
| 109 | __s64 trailer_size; |
| 110 | char * trailer_buf; |
| 111 | |
| 112 | union { |
| 113 | struct pvfs2_io_response io; |
| 114 | struct pvfs2_iox_response iox; |
| 115 | struct pvfs2_lookup_response lookup; |
| 116 | struct pvfs2_create_response create; |
| 117 | struct pvfs2_symlink_response sym; |
| 118 | struct pvfs2_getattr_response getattr; |
| 119 | struct pvfs2_mkdir_response mkdir; |
| 120 | struct pvfs2_statfs_response statfs; |
| 121 | struct pvfs2_fs_mount_response fs_mount; |
| 122 | struct pvfs2_getxattr_response getxattr; |
| 123 | struct pvfs2_listxattr_response listxattr; |
| 124 | struct pvfs2_param_response param; |
| 125 | struct pvfs2_perf_count_response perf_count; |
| 126 | struct pvfs2_fs_key_response fs_key; |
| 127 | } resp; |
| 128 | }; |
| 129 | |
| 130 | struct pvfs2_readdir_response_s { |
| 131 | __u64 token; |
| 132 | __u64 directory_version; |
| 133 | __u32 __pad2; |
| 134 | __u32 pvfs_dirent_outcount; |
| 135 | struct pvfs2_dirent *dirent_array; |
| 136 | }; |
| 137 | |
| 138 | #endif /* __DOWNCALL_H */ |