blob: 163001c9550184feff1255364a3b59a61de1ecf9 [file] [log] [blame]
Mike Marshallf7ab0932015-07-17 10:38:11 -04001/*
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 Liu8bb8aef2015-11-24 15:12:14 -050018struct orangefs_io_response {
Mike Marshallf7ab0932015-07-17 10:38:11 -040019 __s64 amt_complete;
20};
21
Yi Liu8bb8aef2015-11-24 15:12:14 -050022struct orangefs_lookup_response {
23 struct orangefs_object_kref refn;
Mike Marshallf7ab0932015-07-17 10:38:11 -040024};
25
Yi Liu8bb8aef2015-11-24 15:12:14 -050026struct orangefs_create_response {
27 struct orangefs_object_kref refn;
Mike Marshallf7ab0932015-07-17 10:38:11 -040028};
29
Yi Liu8bb8aef2015-11-24 15:12:14 -050030struct orangefs_symlink_response {
31 struct orangefs_object_kref refn;
Mike Marshallf7ab0932015-07-17 10:38:11 -040032};
33
Yi Liu8bb8aef2015-11-24 15:12:14 -050034struct orangefs_getattr_response {
35 struct ORANGEFS_sys_attr_s attributes;
Martin Brandenburg47b49482016-02-20 14:22:40 -050036 char link_target[ORANGEFS_NAME_MAX];
Mike Marshallf7ab0932015-07-17 10:38:11 -040037};
38
Yi Liu8bb8aef2015-11-24 15:12:14 -050039struct orangefs_mkdir_response {
40 struct orangefs_object_kref refn;
Mike Marshallf7ab0932015-07-17 10:38:11 -040041};
42
Yi Liu8bb8aef2015-11-24 15:12:14 -050043struct orangefs_statfs_response {
Mike Marshallf7ab0932015-07-17 10:38:11 -040044 __s64 block_size;
45 __s64 blocks_total;
46 __s64 blocks_avail;
47 __s64 files_total;
48 __s64 files_avail;
49};
50
Yi Liu8bb8aef2015-11-24 15:12:14 -050051struct orangefs_fs_mount_response {
Mike Marshallf7ab0932015-07-17 10:38:11 -040052 __s32 fs_id;
53 __s32 id;
Yi Liu8bb8aef2015-11-24 15:12:14 -050054 struct orangefs_khandle root_khandle;
Mike Marshallf7ab0932015-07-17 10:38:11 -040055};
56
57/* the getxattr response is the attribute value */
Yi Liu8bb8aef2015-11-24 15:12:14 -050058struct orangefs_getxattr_response {
Mike Marshallf7ab0932015-07-17 10:38:11 -040059 __s32 val_sz;
60 __s32 __pad1;
Yi Liu8bb8aef2015-11-24 15:12:14 -050061 char val[ORANGEFS_MAX_XATTR_VALUELEN];
Mike Marshallf7ab0932015-07-17 10:38:11 -040062};
63
64/* the listxattr response is an array of attribute names */
Yi Liu8bb8aef2015-11-24 15:12:14 -050065struct orangefs_listxattr_response {
Mike Marshallf7ab0932015-07-17 10:38:11 -040066 __s32 returned_count;
67 __s32 __pad1;
68 __u64 token;
Yi Liu8bb8aef2015-11-24 15:12:14 -050069 char key[ORANGEFS_MAX_XATTR_LISTLEN * ORANGEFS_MAX_XATTR_NAMELEN];
Mike Marshallf7ab0932015-07-17 10:38:11 -040070 __s32 keylen;
71 __s32 __pad2;
Yi Liu8bb8aef2015-11-24 15:12:14 -050072 __s32 lengths[ORANGEFS_MAX_XATTR_LISTLEN];
Mike Marshallf7ab0932015-07-17 10:38:11 -040073};
74
Yi Liu8bb8aef2015-11-24 15:12:14 -050075struct orangefs_param_response {
Martin Brandenburg680908e2016-08-02 16:33:34 -040076 union {
77 __s64 value64;
78 __s32 value32[2];
79 } u;
Mike Marshallf7ab0932015-07-17 10:38:11 -040080};
81
82#define PERF_COUNT_BUF_SIZE 4096
Yi Liu8bb8aef2015-11-24 15:12:14 -050083struct orangefs_perf_count_response {
Mike Marshallf7ab0932015-07-17 10:38:11 -040084 char buffer[PERF_COUNT_BUF_SIZE];
85};
86
87#define FS_KEY_BUF_SIZE 4096
Yi Liu8bb8aef2015-11-24 15:12:14 -050088struct orangefs_fs_key_response {
Mike Marshallf7ab0932015-07-17 10:38:11 -040089 __s32 fs_keylen;
90 __s32 __pad1;
91 char fs_key[FS_KEY_BUF_SIZE];
92};
93
Martin Brandenburg482664d2016-08-12 12:02:31 -040094/* 2.9.6 */
95struct orangefs_features_response {
96 __u64 features;
97};
98
Yi Liu8bb8aef2015-11-24 15:12:14 -050099struct orangefs_downcall_s {
Mike Marshallf7ab0932015-07-17 10:38:11 -0400100 __s32 type;
101 __s32 status;
102 /* currently trailer is used only by readdir */
103 __s64 trailer_size;
Mike Marshall54804942015-10-05 13:44:24 -0400104 char *trailer_buf;
Mike Marshallf7ab0932015-07-17 10:38:11 -0400105
106 union {
Yi Liu8bb8aef2015-11-24 15:12:14 -0500107 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;
Martin Brandenburg482664d2016-08-12 12:02:31 -0400120 struct orangefs_features_response features;
Mike Marshallf7ab0932015-07-17 10:38:11 -0400121 } resp;
122};
123
Martin Brandenburg382f4582017-04-25 15:37:59 -0400124/*
125 * The readdir response comes in the trailer. It is followed by the
126 * directory entries as described in dir.c.
127 */
128
Yi Liu8bb8aef2015-11-24 15:12:14 -0500129struct orangefs_readdir_response_s {
Mike Marshallf7ab0932015-07-17 10:38:11 -0400130 __u64 token;
131 __u64 directory_version;
132 __u32 __pad2;
Yi Liu8bb8aef2015-11-24 15:12:14 -0500133 __u32 orangefs_dirent_outcount;
Mike Marshallf7ab0932015-07-17 10:38:11 -0400134};
135
136#endif /* __DOWNCALL_H */