Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * (C) 2001 Clemson University and The University of Chicago
0004  *
0005  * See COPYING in top-level directory.
0006  */
0007 
0008 /*
0009  *  Definitions of downcalls used in Linux kernel module.
0010  */
0011 
0012 #ifndef __DOWNCALL_H
0013 #define __DOWNCALL_H
0014 
0015 /*
0016  * Sanitized the device-client core interaction
0017  * for clean 32-64 bit usage
0018  */
0019 struct orangefs_io_response {
0020     __s64 amt_complete;
0021 };
0022 
0023 struct orangefs_lookup_response {
0024     struct orangefs_object_kref refn;
0025 };
0026 
0027 struct orangefs_create_response {
0028     struct orangefs_object_kref refn;
0029 };
0030 
0031 struct orangefs_symlink_response {
0032     struct orangefs_object_kref refn;
0033 };
0034 
0035 struct orangefs_getattr_response {
0036     struct ORANGEFS_sys_attr_s attributes;
0037     char link_target[ORANGEFS_NAME_MAX];
0038 };
0039 
0040 struct orangefs_mkdir_response {
0041     struct orangefs_object_kref refn;
0042 };
0043 
0044 struct orangefs_statfs_response {
0045     __s64 block_size;
0046     __s64 blocks_total;
0047     __s64 blocks_avail;
0048     __s64 files_total;
0049     __s64 files_avail;
0050 };
0051 
0052 struct orangefs_fs_mount_response {
0053     __s32 fs_id;
0054     __s32 id;
0055     struct orangefs_khandle root_khandle;
0056 };
0057 
0058 /* the getxattr response is the attribute value */
0059 struct orangefs_getxattr_response {
0060     __s32 val_sz;
0061     __s32 __pad1;
0062     char val[ORANGEFS_MAX_XATTR_VALUELEN];
0063 };
0064 
0065 /* the listxattr response is an array of attribute names */
0066 struct orangefs_listxattr_response {
0067     __s32 returned_count;
0068     __s32 __pad1;
0069     __u64 token;
0070     char key[ORANGEFS_MAX_XATTR_LISTLEN * ORANGEFS_MAX_XATTR_NAMELEN];
0071     __s32 keylen;
0072     __s32 __pad2;
0073     __s32 lengths[ORANGEFS_MAX_XATTR_LISTLEN];
0074 };
0075 
0076 struct orangefs_param_response {
0077     union {
0078         __s64 value64;
0079         __s32 value32[2];
0080     } u;
0081 };
0082 
0083 #define PERF_COUNT_BUF_SIZE 4096
0084 struct orangefs_perf_count_response {
0085     char buffer[PERF_COUNT_BUF_SIZE];
0086 };
0087 
0088 #define FS_KEY_BUF_SIZE 4096
0089 struct orangefs_fs_key_response {
0090     __s32 fs_keylen;
0091     __s32 __pad1;
0092     char fs_key[FS_KEY_BUF_SIZE];
0093 };
0094 
0095 /* 2.9.6 */
0096 struct orangefs_features_response {
0097     __u64 features;
0098 };
0099 
0100 struct orangefs_downcall_s {
0101     __s32 type;
0102     __s32 status;
0103     /* currently trailer is used only by readdir */
0104     __s64 trailer_size;
0105     char *trailer_buf;
0106 
0107     union {
0108         struct orangefs_io_response io;
0109         struct orangefs_lookup_response lookup;
0110         struct orangefs_create_response create;
0111         struct orangefs_symlink_response sym;
0112         struct orangefs_getattr_response getattr;
0113         struct orangefs_mkdir_response mkdir;
0114         struct orangefs_statfs_response statfs;
0115         struct orangefs_fs_mount_response fs_mount;
0116         struct orangefs_getxattr_response getxattr;
0117         struct orangefs_listxattr_response listxattr;
0118         struct orangefs_param_response param;
0119         struct orangefs_perf_count_response perf_count;
0120         struct orangefs_fs_key_response fs_key;
0121         struct orangefs_features_response features;
0122     } resp;
0123 };
0124 
0125 /*
0126  * The readdir response comes in the trailer.  It is followed by the
0127  * directory entries as described in dir.c.
0128  */
0129 
0130 struct orangefs_readdir_response_s {
0131     __u64 token;
0132     __u64 directory_version;
0133     __u32 __pad2;
0134     __u32 orangefs_dirent_outcount;
0135 };
0136 
0137 #endif /* __DOWNCALL_H */