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 orangefs_io_response { 19 __s64 amt_complete; 20 }; 21 22 struct orangefs_lookup_response { 23 struct orangefs_object_kref refn; 24 }; 25 26 struct orangefs_create_response { 27 struct orangefs_object_kref refn; 28 }; 29 30 struct orangefs_symlink_response { 31 struct orangefs_object_kref refn; 32 }; 33 34 struct orangefs_getattr_response { 35 struct ORANGEFS_sys_attr_s attributes; 36 char link_target[ORANGEFS_NAME_MAX]; 37 }; 38 39 struct orangefs_mkdir_response { 40 struct orangefs_object_kref refn; 41 }; 42 43 struct orangefs_statfs_response { 44 __s64 block_size; 45 __s64 blocks_total; 46 __s64 blocks_avail; 47 __s64 files_total; 48 __s64 files_avail; 49 }; 50 51 struct orangefs_fs_mount_response { 52 __s32 fs_id; 53 __s32 id; 54 struct orangefs_khandle root_khandle; 55 }; 56 57 /* the getxattr response is the attribute value */ 58 struct orangefs_getxattr_response { 59 __s32 val_sz; 60 __s32 __pad1; 61 char val[ORANGEFS_MAX_XATTR_VALUELEN]; 62 }; 63 64 /* the listxattr response is an array of attribute names */ 65 struct orangefs_listxattr_response { 66 __s32 returned_count; 67 __s32 __pad1; 68 __u64 token; 69 char key[ORANGEFS_MAX_XATTR_LISTLEN * ORANGEFS_MAX_XATTR_NAMELEN]; 70 __s32 keylen; 71 __s32 __pad2; 72 __s32 lengths[ORANGEFS_MAX_XATTR_LISTLEN]; 73 }; 74 75 struct orangefs_param_response { 76 union { 77 __s64 value64; 78 __s32 value32[2]; 79 } u; 80 }; 81 82 #define PERF_COUNT_BUF_SIZE 4096 83 struct orangefs_perf_count_response { 84 char buffer[PERF_COUNT_BUF_SIZE]; 85 }; 86 87 #define FS_KEY_BUF_SIZE 4096 88 struct orangefs_fs_key_response { 89 __s32 fs_keylen; 90 __s32 __pad1; 91 char fs_key[FS_KEY_BUF_SIZE]; 92 }; 93 94 /* 2.9.6 */ 95 struct orangefs_features_response { 96 __u64 features; 97 }; 98 99 struct orangefs_downcall_s { 100 __s32 type; 101 __s32 status; 102 /* currently trailer is used only by readdir */ 103 __s64 trailer_size; 104 char *trailer_buf; 105 106 union { 107 struct orangefs_io_response io; 108 struct orangefs_lookup_response lookup; 109 struct orangefs_create_response create; 110 struct orangefs_symlink_response sym; 111 struct orangefs_getattr_response getattr; 112 struct orangefs_mkdir_response mkdir; 113 struct orangefs_statfs_response statfs; 114 struct orangefs_fs_mount_response fs_mount; 115 struct orangefs_getxattr_response getxattr; 116 struct orangefs_listxattr_response listxattr; 117 struct orangefs_param_response param; 118 struct orangefs_perf_count_response perf_count; 119 struct orangefs_fs_key_response fs_key; 120 struct orangefs_features_response features; 121 } resp; 122 }; 123 124 /* 125 * The readdir response comes in the trailer. It is followed by the 126 * directory entries as described in dir.c. 127 */ 128 129 struct orangefs_readdir_response_s { 130 __u64 token; 131 __u64 directory_version; 132 __u32 __pad2; 133 __u32 orangefs_dirent_outcount; 134 }; 135 136 #endif /* __DOWNCALL_H */ 137