Quick Search:

View

Revision:
Expand:  

Diff

Diff from 1.159.8.8.2.3 to:

Annotations

Annotate by Age | Author | None
/fisheye/browse/PVFS/src/proto/pvfs2-req-proto.h

Annotated File View

pcarns
1.2
1 /*
2  * (C) 2001 Clemson University and The University of Chicago
3  *
4  * See COPYING in top-level directory.
5  */
robl
1.129
6 /* NOTE: if you make any changes to the code contained in this file, please
7  * update the PVFS2_PROTO_VERSION accordingly
8  */
pcarns
1.2
9
pcarns
1.26
10 #ifndef __PVFS2_REQ_PROTO_H
11 #define __PVFS2_REQ_PROTO_H
pcarns
1.2
12
pcarns
1.69
13 #include "pvfs2-config.h"
pcarns
1.16
14 #include "pvfs2-types.h"
15 #include "pvfs2-attr.h"
bradles
1.110
16 #include "pint-distribution.h"
pcarns
1.58
17 #include "pvfs2-request.h"
slang
1.132
18 #include "pint-request.h"
pcarns
1.76
19 #include "pvfs2-mgmt.h"
slang
1.157
20 #include "pint-hint.h"
pcarns
1.16
21
robl
1.129
22 /* update PVFS2_PROTO_MAJOR on wire protocol changes that break backwards
23  * compatibility (such as changing the semantics or protocol fields for an
24  * existing request type)
25  */
pcarns
1.155
26 #define PVFS2_PROTO_MAJOR 6
robl
1.129
27 /* update PVFS2_PROTO_MINOR on wire protocol changes that preserve backwards
28  * compatibility (such as adding a new request type)
pcarns
1.48
29  */
slang
1.148
30 #define PVFS2_PROTO_MINOR 0
robl
1.129
31 #define PVFS2_PROTO_VERSION ((PVFS2_PROTO_MAJOR*1000)+(PVFS2_PROTO_MINOR))
pcarns
1.48
32
slang
1.132
33 /* we set the maximum possible size of a small I/O packed message as 64K.  This
34  * is an upper limit that is used to allocate the request and response encoded
35  * buffers, and is independent of the max unexpected message size of the specific
36  * BMI module.  All max unexpected message sizes for BMI modules have to be less
37  * than this value
38  */
39 #define PINT_SMALL_IO_MAXSIZE (16*1024)
40
pcarns
1.29
41 enum PVFS_server_op
pcarns
1.16
42 {
43     PVFS_SERV_INVALID = 0,
pcarns
1.28
44     PVFS_SERV_CREATE = 1,
45     PVFS_SERV_REMOVE = 2,
46     PVFS_SERV_IO = 3,
47     PVFS_SERV_GETATTR = 4,
48     PVFS_SERV_SETATTR = 5,
49     PVFS_SERV_LOOKUP_PATH = 6,
pw
1.87
50     PVFS_SERV_CRDIRENT = 7,
pcarns
1.28
51     PVFS_SERV_RMDIRENT = 8,
neill
1.108
52     PVFS_SERV_CHDIRENT = 9,
53     PVFS_SERV_TRUNCATE = 10,
54     PVFS_SERV_MKDIR = 11,
55     PVFS_SERV_READDIR = 12,
56     PVFS_SERV_GETCONFIG = 13,
57     PVFS_SERV_WRITE_COMPLETION = 14,
58     PVFS_SERV_FLUSH = 15,
59     PVFS_SERV_MGMT_SETPARAM = 16,
60     PVFS_SERV_MGMT_NOOP = 17,
61     PVFS_SERV_STATFS = 18,
62     PVFS_SERV_PERF_UPDATE = 19,  /* not a real protocol request */
63     PVFS_SERV_MGMT_PERF_MON = 20,
64     PVFS_SERV_MGMT_ITERATE_HANDLES = 21,
65     PVFS_SERV_MGMT_DSPACE_INFO_LIST = 22,
66     PVFS_SERV_MGMT_EVENT_MON = 23,
neill
1.114
67     PVFS_SERV_MGMT_REMOVE_OBJECT = 24,
neill
1.115
68     PVFS_SERV_MGMT_REMOVE_DIRENT = 25,
neill
1.116
69     PVFS_SERV_MGMT_GET_DIRDATA_HANDLE = 26,
70     PVFS_SERV_JOB_TIMER = 27,    /* not a real protocol request */
walt
1.127
71     PVFS_SERV_PROTO_ERROR = 28,
72     PVFS_SERV_GETEATTR = 29,
73     PVFS_SERV_SETEATTR = 30,
vilayann
1.130
74     PVFS_SERV_DELEATTR = 31,
75     PVFS_SERV_LISTEATTR = 32,
pw
1.144
76     PVFS_SERV_SMALL_IO = 33,
vilayann
1.145
77     PVFS_SERV_LISTATTR = 34,
pcarns
1.155
78     PVFS_SERV_BATCH_CREATE = 35,
79     PVFS_SERV_BATCH_REMOVE = 36,
80     PVFS_SERV_PRECREATE_POOL_REFILLER = 37/* not a real protocol request */
81     PVFS_SERV_UNSTUFF = 38,
bligon
1.159.8.1
82     PVFS_SERV_MIRROR = 39,
83     PVFS_SERV_IMM_COPIES = 40,
elaine
1.159.8.3
84     PVFS_SERV_TREE_REMOVE = 41,
85     PVFS_SERV_TREE_GET_FILE_SIZE = 42,
wligon
1.159.8.8.2.1
86     PVFS_SERV_MGMT_MIGRATE = 43,
wligon
1.159.8.8.2.3
87     PVFS_SERV_MIGRATE_CREATE = 44,
pw
1.144
88     /* leave this entry last */
89     PVFS_SERV_NUM_OPS
pcarns
1.29
90 };
pcarns
1.44
91
pw
1.119
92 /*
pw
1.120
93  * These ops must always work, even if the server is in admin mode.
pw
1.119
94  */
95 #define PVFS_SERV_IS_MGMT_OP(x) \
pcarns
1.154
96     ((x) == PVFS_SERV_MGMT_SETPARAM \
97   || (x) == PVFS_SERV_MGMT_REMOVE_OBJECT \
pw
1.119
98   || (x) == PVFS_SERV_MGMT_REMOVE_DIRENT)
99
pcarns
1.44
100 /******************************************************************/
101 /* these values define limits on the maximum size of variable length
102  * parameters used within the request protocol
103  */
104
pcarns
1.155
105 /* max size of layout information (may include explicit server list */
106 #define PVFS_REQ_LIMIT_LAYOUT             4096
pcarns
1.44
107 /* max size of opaque distribution parameters */
108 #define PVFS_REQ_LIMIT_DIST_BYTES         1024
slang
1.153
109 /* max size of each configuration file transmitted to clients.
110  * Note: If you change this value, you should change the $req_limit
111  * in pvfs2-genconfig as well. */
112 #define PVFS_REQ_LIMIT_CONFIG_FILE_BYTES  65536
pcarns
1.44
113 /* max size of all path strings */
114 #define PVFS_REQ_LIMIT_PATH_NAME_BYTES    PVFS_NAME_MAX
pcarns
1.45
115 /* max size of strings representing a single path element */
116 #define PVFS_REQ_LIMIT_SEGMENT_BYTES      PVFS_SEGMENT_MAX
pcarns
1.44
117 /* max total size of I/O request descriptions */
118 #define PVFS_REQ_LIMIT_IOREQ_BYTES        8192
vilayann
1.140
119 /* maximum size of distribution name used for the hints */
120 #define PVFS_REQ_LIMIT_DIST_NAME          128
pcarns
1.44
121 /* max count of segments allowed per path lookup (note that this governs 
122  * the number of handles and attributes returned in lookup_path responses)
123  */
neill
1.100
124 #define PVFS_REQ_LIMIT_PATH_SEGMENT_COUNT   40
pcarns
1.44
125 /* max count of datafiles associated with a logical file */
126 #define PVFS_REQ_LIMIT_DFILE_COUNT        1024
neill
1.98
127 #define PVFS_REQ_LIMIT_DFILE_COUNT_IS_VALID(dfile_count) \
128 ((dfile_count > 0) && (dfile_count < PVFS_REQ_LIMIT_DFILE_COUNT))
bligon
1.159.8.2
129 #define PVFS_REQ_LIMIT_MIRROR_DFILE_COUNT 1024
pcarns
1.44
130 /* max count of directory entries per readdir request */
neill
1.101
131 #define PVFS_REQ_LIMIT_DIRENT_COUNT        512
pcarns
1.79
132 /* max number of perf metrics returned by mgmt perf mon op */
133 #define PVFS_REQ_LIMIT_MGMT_PERF_MON_COUNT 16
pcarns
1.88
134 /* max number of events returned by mgmt event mon op */
135 #define PVFS_REQ_LIMIT_MGMT_EVENT_MON_COUNT 2048
pw
1.90
136 /* max number of handles returned by any operation using an array of handles */
137 #define PVFS_REQ_LIMIT_HANDLES_COUNT 1024
pcarns
1.155
138 /* max number of handles that can be created at once using batch create */
139 #define PVFS_REQ_LIMIT_BATCH_CREATE 8192
pcarns
1.81
140 /* max number of handles returned by mgmt iterate handles op */
neill
1.108
141 #define PVFS_REQ_LIMIT_MGMT_ITERATE_HANDLES_COUNT \
142   PVFS_REQ_LIMIT_HANDLES_COUNT
pw
1.90
143 /* max number of info list items returned by mgmt dspace info list op */
pcarns
1.88
144 /* max number of dspace info structs returned by mgmt dpsace info op */
pcarns
1.86
145 #define PVFS_REQ_LIMIT_MGMT_DSPACE_INFO_LIST_COUNT 1024
pw
1.90
146 /* max number of path elements in a lookup_attr response */
147 #define PVFS_REQ_LIMIT_MAX_PATH_ELEMENTS  40
neill
1.95
148 /* max number of symlinks to resolve before erroring out */
149 #define PVFS_REQ_LIMIT_MAX_SYMLINK_RESOLUTION_COUNT 8
walt
1.127
150 /* max number of bytes in the key of a key/value pair including null term */
151 #define PVFS_REQ_LIMIT_KEY_LEN 128
152 /* max number of bytes in a value of a key/value/pair */
153 #define PVFS_REQ_LIMIT_VAL_LEN 4096
vilayann
1.130
154 /* max number of key/value pairs to set or get in a list operation */
walt
1.127
155 #define PVFS_REQ_LIMIT_KEYVAL_LIST 32
vilayann
1.145
156 /* max number of handles for which we return attributes */
bligon
1.159.8.2
157 #define PVFS_REQ_LIMIT_LISTATTR 60
pcarns
1.2
158
pcarns
1.32
159 /* create *********************************************************/
pcarns
1.155
160 /* - used to create an object.  This creates a metadata handle,
161  * a datafile handle, and links the datafile handle to the metadata handle.
162  * It also sets the attributes on the metadata. */
pcarns
1.32
163
pcarns
1.31
164 struct PVFS_servreq_create
pcarns
1.16
165 {
neill
1.50
166     PVFS_fs_id fs_id;
pcarns
1.155
167     PVFS_object_attr attr;
168
169     int32_t num_dfiles_req;
170     /* NOTE: leave layout as final field so that we can deal with encoding
171      * errors */
172     PVFS_sys_layout layout;
173 };
174 endecode_fields_5_struct(
175     PVFS_servreq_create,
176     PVFS_fs_idfs_id,
177     skip4,,
178     PVFS_object_attrattr,
179     int32_tnum_dfiles_req,
bligon
1.159.8.8
180     PVFS_sys_layoutlayout);
pcarns
1.155
181
182 #define extra_size_PVFS_servreq_create \
183     (extra_size_PVFS_object_attr + extra_size_PVFS_sys_layout)
184
185 #define PINT_SERVREQ_CREATE_FILL(__req,                                    \
186                                  __creds,                                  \
187                                  __fsid,                                   \
188                                  __attr,                                   \
189                                  __num_dfiles_req,                         \
slang
1.157
190                                  __layout,                                 \
191                                  __hints)                                  \
pcarns
1.155
192 do {                                                                       \
193     int mask;                                                              \
194     memset(&(__req), 0sizeof(__req));                                    \
195     (__req).op = PVFS_SERV_CREATE;                                         \
196     (__req).credentials = (__creds);                                       \
slang
1.157
197     (__req).hints = (__hints);                                             \
pcarns
1.155
198     (__req).u.create.fs_id = (__fsid);                                     \
199     (__req).u.create.num_dfiles_req = (__num_dfiles_req);                  \
200     (__attr).objtype = PVFS_TYPE_METAFILE;                                 \
201     mask = (__attr).mask;                                                  \
202     (__attr).mask = PVFS_ATTR_COMMON_ALL;                                  \
203     (__attr).mask |= PVFS_ATTR_SYS_TYPE;                                   \
204     PINT_copy_object_attr(&(__req).u.create.attr, &(__attr));              \
205     (__req).u.create.attr.mask |= mask;                                    \
206     (__req).u.create.layout = __layout;                                    \
207 while (0)
208
209 struct PVFS_servresp_create
210 {
211     PVFS_handle metafile_handle;
212     int32_t stuffed;
213     int32_t datafile_count;
214     PVFS_handle *datafile_handles;
215 };
216 endecode_fields_2a_struct(
217     PVFS_servresp_create,
218     PVFS_handlemetafile_handle,
219     int32_tstuffed,
220     int32_tdatafile_count,
bligon
1.159.8.8
221     PVFS_handledatafile_handles);
pcarns
1.155
222 #define extra_size_PVFS_servresp_create \
223     (PVFS_REQ_LIMIT_HANDLES_COUNT * sizeof(PVFS_handle))
224
225 /* batch_create *********************************************************/
226 /* - used to create new multiple metafile and datafile objects */
227
228 struct PVFS_servreq_batch_create
229 {
230     PVFS_fs_id fs_id;
neill
1.108
231     PVFS_ds_type object_type;
pcarns
1.155
232     uint32_t object_count;
neill
1.50
233
234     /*
235       an array of handle extents that we use to suggest to
236       the server from which handle range to allocate for the
237       newly created handle(s).  To request a single handle,
238       a single extent with first = last should be used.
239     */
240     PVFS_handle_extent_array handle_extent_array;
pcarns
1.2
241 };
pcarns
1.155
242 endecode_fields_5_struct(
243     PVFS_servreq_batch_create,
pw
1.90
244     PVFS_fs_idfs_id,
245     PVFS_ds_typeobject_type,
pcarns
1.155
246     uint32_tobject_count,
247     skip4,,
bligon
1.159.8.8
248     PVFS_handle_extent_arrayhandle_extent_array);
249
pcarns
1.155
250 #define extra_size_PVFS_servreq_batch_create \
pw
1.90
251     (PVFS_REQ_LIMIT_HANDLES_COUNT * sizeof(PVFS_handle_extent))
pcarns
1.2
252
pcarns
1.155
253 #define PINT_SERVREQ_BATCH_CREATE_FILL(__req,          \
neill
1.67
254                                  __creds,              \
255                                  __fsid,               \
256                                  __objtype,            \
pcarns
1.155
257                                  __objcount,           \
slang
1.157
258                                  __ext_array,          \
259                                  __hints)              \
neill
1.67
260 do {                                                   \
261     memset(&(__req), 0sizeof(__req));                \
pcarns
1.155
262     (__req).op = PVFS_SERV_BATCH_CREATE;               \
neill
1.67
263     (__req).credentials = (__creds);                   \
slang
1.157
264     (__req).hints = (__hints);                         \
pcarns
1.155
265     (__req).u.batch_create.fs_id = (__fsid);           \
266     (__req).u.batch_create.object_type = (__objtype);        \
267     (__req).u.batch_create.object_count = (__objcount);      \
268     (__req).u.batch_create.handle_extent_array.extent_count =\
walt
1.127
269         (__ext_array).extent_count;                    \
pcarns
1.155
270     (__req).u.batch_create.handle_extent_array.extent_array =\
walt
1.127
271         (__ext_array).extent_array;                    \
neill
1.67
272 while (0)
273
pcarns
1.155
274 struct PVFS_servresp_batch_create
pcarns
1.16
275 {
pcarns
1.155
276     PVFS_handle *handle_array;
277     uint32_t handle_count
pcarns
1.2
278 };
pcarns
1.155
279 endecode_fields_1a_struct(
280     PVFS_servresp_batch_create,
281     skip4,,
282     uint32_thandle_count,
bligon
1.159.8.8
283     PVFS_handlehandle_array);
pcarns
1.155
284 #define extra_size_PVFS_servresp_batch_create \
285   (PVFS_REQ_LIMIT_BATCH_CREATE * sizeof(PVFS_handle))
pcarns
1.2
286
pcarns
1.33
287 /* remove *****************************************************/
288 /* - used to remove an existing metafile or datafile object */
289
pcarns
1.31
290 struct PVFS_servreq_remove
pcarns
1.16
291 {
neill
1.108
292     PVFS_handle handle;
vilayann
1.142
293     PVFS_fs_id  fs_id;
pcarns
1.2
294 };
neill
1.108
295 endecode_fields_2_struct(
296     PVFS_servreq_remove,
297     PVFS_handlehandle,
bligon
1.159.8.8
298     PVFS_fs_idfs_id);
neill
1.108
299
300 #define PINT_SERVREQ_REMOVE_FILL(__req,   \
301                                  __creds, \
302                                  __fsid,  \
slang
1.157
303                                  __handle,\
304                                  __hints) \
neill
1.108
305 do {                                      \
306     memset(&(__req), 0sizeof(__req));   \
307     (__req).op = PVFS_SERV_REMOVE;        \
slang
1.157
308     (__req).hints = (__hints);            \
neill
1.108
309     (__req).credentials = (__creds);      \
310     (__req).u.remove.fs_id = (__fsid);    \
311     (__req).u.remove.handle = (__handle); \
rbross
1.54
312 while (0)
313
pcarns
1.155
314 struct PVFS_servreq_batch_remove
315 {
316     PVFS_fs_id  fs_id;
317     int32_t handle_count;
318     PVFS_handle *handles;
319 };
320 endecode_fields_1a_struct(
321     PVFS_servreq_batch_remove,
322     PVFS_fs_idfs_id,
323     int32_thandle_count,
bligon
1.159.8.8
324     PVFS_handlehandles);
pcarns
1.155
325 #define extra_size_PVFS_servreq_batch_remove \
326   (PVFS_REQ_LIMIT_HANDLES_COUNT * sizeof(PVFS_handle))
327
328 #define PINT_SERVREQ_BATCH_REMOVE_FILL(__req,        \
329                                        __creds,      \
330                                        __fsid,       \
331                                        __count,      \
332                                        __handles)    \
333 do {                                                 \
334     memset(&(__req), 0sizeof(__req));              \
335     (__req).op = PVFS_SERV_BATCH_REMOVE;             \
336     (__req).credentials = (__creds);                 \
337     (__req).u.batch_remove.fs_id = (__fsid);         \
338     (__req).u.batch_remove.handle_count = (__count); \
339     (__req).u.batch_remove.handles = (__handles);    \
340 while (0)
341
neill
1.114
342 /* mgmt_remove_object */
343 /* - used to remove an existing object reference */
344
345 struct PVFS_servreq_mgmt_remove_object
346 {
347     PVFS_handle handle;
348     PVFS_fs_id fs_id;
349 };
350 endecode_fields_2_struct(
351     PVFS_servreq_mgmt_remove_object,
352     PVFS_handlehandle,
bligon
1.159.8.8
353     PVFS_fs_idfs_id);
neill
1.114
354
355 #define PINT_SERVREQ_MGMT_REMOVE_OBJECT_FILL(__req,   \
356                                              __creds, \
357                                              __fsid,  \
slang
1.157
358                                              __handle,\
359                                              __hints) \
neill
1.114
360 do {                                                  \
361     memset(&(__req), 0sizeof(__req));               \
362     (__req).op = PVFS_SERV_MGMT_REMOVE_OBJECT;        \
slang
1.157
363     (__req).hints = (__hints);                        \
neill
1.114
364     (__req).credentials = (__creds);                  \
neill
1.115
365     (__req).u.mgmt_remove_object.fs_id = (__fsid);    \
366     (__req).u.mgmt_remove_object.handle = (__handle); \
367 while (0)
368
369 /* mgmt_remove_dirent */
370 /* - used to remove an existing dirent under the specified parent ref */
371
372 struct PVFS_servreq_mgmt_remove_dirent
373 {
374     PVFS_handle handle;
375     PVFS_fs_id fs_id;
376     char *entry;
377 };
pw
1.125
378 endecode_fields_4_struct(
neill
1.115
379     PVFS_servreq_mgmt_remove_dirent,
380     PVFS_handlehandle,
381     PVFS_fs_idfs_id,
pw
1.125
382     skip4,,
bligon
1.159.8.8
383     stringentry);
neill
1.115
384 #define extra_size_PVFS_servreq_mgmt_remove_dirent \
385   roundup8(PVFS_REQ_LIMIT_SEGMENT_BYTES+1)
386
387 #define PINT_SERVREQ_MGMT_REMOVE_DIRENT_FILL(__req,   \
388                                              __creds, \
389                                              __fsid,  \
390                                              __handle,\
slang
1.157
391                                              __entry, \
392                                              __hints) \
neill
1.115
393 do {                                                  \
394     memset(&(__req), 0sizeof(__req));               \
395     (__req).op = PVFS_SERV_MGMT_REMOVE_DIRENT;        \
slang
1.157
396     (__req).hints = (__hints);                        \
neill
1.115
397     (__req).credentials = (__creds);                  \
398     (__req).u.mgmt_remove_dirent.fs_id = (__fsid);    \
399     (__req).u.mgmt_remove_dirent.handle = (__handle); \
400     (__req).u.mgmt_remove_dirent.entry = (__entry);   \
neill
1.114
401 while (0)
402
elaine
1.159.8.3
403 struct PVFS_servreq_tree_remove
404 {
405     PVFS_fs_id  fs_id;
406     uint32_t num_data_files;
407     PVFS_handle *handle_array;
408 };
409 endecode_fields_1a_struct(
410     PVFS_servreq_tree_remove,
411     PVFS_fs_idfs_id,
412     uint32_tnum_data_files,
bligon
1.159.8.8
413     PVFS_handlehandle_array);
elaine
1.159.8.3
414 #define extra_size_PVFS_servreq_tree_remove \
415   (PVFS_REQ_LIMIT_HANDLES_COUNT * sizeof(PVFS_handle))
416
417 #define PINT_SERVREQ_TREE_REMOVE_FILL(__req,                                  \
418                                  __creds,                                \
419                                  __fsid,                                 \
420                                  __num_data_files,                       \
421                                  __handle_array,                         \
422                                  __hints)                                \
423 do {                                                                     \
424     memset(&(__req), 0sizeof(__req));                                  \
425     (__req).op = PVFS_SERV_TREE_REMOVE;                                  \
426     (__req).hints = (__hints);                                           \
427     (__req).credentials = (__creds);                                     \
428     (__req).u.tree_remove.fs_id = (__fsid);                              \
429     (__req).u.tree_remove.num_data_files = (__num_data_files);           \
430     (__req).u.tree_remove.handle_array = (__handle_array);               \
431 while (0)
432
433 struct PVFS_servreq_tree_get_file_size
434 {
435     PVFS_fs_id  fs_id;
elaine
1.159.8.4
436     uint32_t caller_handle_index;
bligon
1.159.8.7
437     uint32_t retry_msgpair_at_leaf;
elaine
1.159.8.3
438     uint32_t num_data_files;
439     PVFS_handle *handle_array;
440 };
elaine
1.159.8.5
441 endecode_fields_3a_struct(
elaine
1.159.8.3
442     PVFS_servreq_tree_get_file_size,
443     PVFS_fs_idfs_id,
elaine
1.159.8.4
444     uint32_tcaller_handle_index,
bligon
1.159.8.7
445     uint32_tretry_msgpair_at_leaf,
elaine
1.159.8.3
446     uint32_tnum_data_files,
bligon
1.159.8.8
447     PVFS_handlehandle_array);
elaine
1.159.8.3
448 #define extra_size_PVFS_servreq_tree_get_file_size \
449   (PVFS_REQ_LIMIT_HANDLES_COUNT * sizeof(PVFS_handle))
450
bligon
1.159.8.7
451 #define PINT_SERVREQ_TREE_GET_FILE_SIZE_FILL(__req,                                \
452                                  __creds,                                          \
453                                  __fsid,                                           \
454                                  __caller_handle_index,                            \
455                                  __num_data_files,                                 \
456                                  __handle_array,                                   \
457                                  __retry_msgpair_at_leaf,                          \
458                                  __hints)                                          \
459 do {                                                                               \
460     memset(&(__req), 0sizeof(__req));                                            \
461     (__req).op = PVFS_SERV_TREE_GET_FILE_SIZE;                                     \
462     (__req).hints = (__hints);                                                     \
463     (__req).credentials = (__creds);                                               \
464     (__req).u.tree_get_file_size.fs_id = (__fsid);                                 \
465     (__req).u.tree_get_file_size.caller_handle_index = (__caller_handle_index);    \
466     (__req).u.tree_get_file_size.num_data_files = (__num_data_files);              \
467     (__req).u.tree_get_file_size.handle_array = (__handle_array);                  \
468     (__req).u.tree_get_file_size.retry_msgpair_at_leaf = (__retry_msgpair_at_leaf);\
elaine
1.159.8.3
469 while (0)
470
471 struct PVFS_servresp_tree_get_file_size
472 {
elaine
1.159.8.4
473     uint32_t caller_handle_index;
474     uint32_t handle_count;
bligon
1.159.8.7
475     PVFS_size  *size;
elaine
1.159.8.4
476     PVFS_error *error;
elaine
1.159.8.3
477 };
elaine
1.159.8.4
478 endecode_fields_1aa_struct(
elaine
1.159.8.3
479     PVFS_servresp_tree_get_file_size,
elaine
1.159.8.4
480     uint32_tcaller_handle_index,
481     uint32_thandle_count,
bligon
1.159.8.7
482     PVFS_sizesize,
bligon
1.159.8.8
483     PVFS_errorerror);
elaine
1.159.8.4
484 #define extra_size_PVFS_servresp_tree_get_file_size \
elaine
1.159.8.6
485   ( (PVFS_REQ_LIMIT_HANDLES_COUNT * sizeof(PVFS_error)) + \
bligon
1.159.8.7
486     (PVFS_REQ_LIMIT_HANDLES_COUNT * sizeof(PVFS_size)) )
elaine
1.159.8.3
487
neill
1.116
488 /* mgmt_get_dirdata_handle */
489 /* - used to retrieve the dirdata handle of the specified parent ref */
490 struct PVFS_servreq_mgmt_get_dirdata_handle
491 {
492     PVFS_handle handle;
493     PVFS_fs_id fs_id;
494 };
495 endecode_fields_2_struct(
496     PVFS_servreq_mgmt_get_dirdata_handle,
497     PVFS_handlehandle,
bligon
1.159.8.8
498     PVFS_fs_idfs_id);
neill
1.116
499
500 #define PINT_SERVREQ_MGMT_GET_DIRDATA_HANDLE_FILL(__req,   \
501                                                   __creds, \
502                                                   __fsid,  \
slang
1.157
503                                                   __handle,\
504                                                   __hints) \
neill
1.116
505 do {                                                       \
506     memset(&(__req), 0sizeof(__req));                    \
507     (__req).op = PVFS_SERV_MGMT_GET_DIRDATA_HANDLE;        \
508     (__req).credentials = (__creds);                       \
slang
1.157
509     (__req).hints = (__hints);                             \
neill
1.116
510     (__req).u.mgmt_get_dirdata_handle.fs_id = (__fsid);    \
511     (__req).u.mgmt_get_dirdata_handle.handle = (__handle); \
512 while (0)
513
514 struct PVFS_servresp_mgmt_get_dirdata_handle
515 {
516     PVFS_handle handle;
517 };
518 endecode_fields_1_struct(
519     PVFS_servresp_mgmt_get_dirdata_handle,
bligon
1.159.8.8
520     PVFS_handlehandle);
neill
1.116
521
robl
1.59
522 /* flush
523  * - used to flush an object to disk */
524 struct PVFS_servreq_flush
525 {
neill
1.108
526     PVFS_handle handle;
527     PVFS_fs_id fs_id;
528     int32_t flags;
529 };
530 endecode_fields_3_struct(
531     PVFS_servreq_flush,
532     PVFS_handlehandle,
533     PVFS_fs_idfs_id,
bligon
1.159.8.8
534     int32_tflags);
neill
1.108
535
536 #define PINT_SERVREQ_FLUSH_FILL(__req,   \
537                                 __creds, \
538                                 __fsid,  \
slang
1.157
539                                 __handle,\
540                                 __hints )\
neill
1.108
541 do {                                     \
542     memset(&(__req), 0sizeof(__req));  \
543     (__req).op = PVFS_SERV_FLUSH;        \
544     (__req).credentials = (__creds);     \
slang
1.157
545     (__req).hints = (__hints);           \
neill
1.108
546     (__req).u.flush.fs_id = (__fsid);    \
547     (__req).u.flush.handle = (__handle); \
robl
1.59
548 while (0)
549
pcarns
1.34
550 /* getattr ****************************************************/
551 /* - retreives attributes based on mask of PVFS_ATTR_XXX values */
552
pcarns
1.31
553 struct PVFS_servreq_getattr
pcarns
1.16
554 {
neill
1.108
555     PVFS_handle handle/* handle of target object */
556     PVFS_fs_id fs_id;   /* file system */
557     uint32_t attrmask;  /* mask of desired attributes */
558 };
559 endecode_fields_3_struct(
560     PVFS_servreq_getattr,
561     PVFS_handlehandle,
562     PVFS_fs_idfs_id,
bligon
1.159.8.8
563     uint32_tattrmask);
neill
1.108
564
565 #define PINT_SERVREQ_GETATTR_FILL(__req,   \
566                                   __creds, \
567                                   __fsid,  \
568                                   __handle,\
slang
1.157
569                                   __amask, \
570                                   __hints) \
neill
1.108
571 do {                                       \
572     memset(&(__req), 0sizeof(__req));    \
573     (__req).op = PVFS_SERV_GETATTR;        \
574     (__req).credentials = (__creds);       \
slang
1.157
575     (__req).hints = (__hints);             \
neill
1.108
576     (__req).u.getattr.fs_id = (__fsid);    \
577     (__req).u.getattr.handle = (__handle); \
578     (__req).u.getattr.attrmask = (__amask);\
rbross
1.53
579 while (0)
580
pcarns
1.31
581 struct PVFS_servresp_getattr
pcarns
1.16
582 {
neill
1.108
583     PVFS_object_attr attr;
pcarns
1.2
584 };
neill
1.108
585 endecode_fields_1_struct(
586     PVFS_servresp_getattr,
bligon
1.159.8.8
587     PVFS_object_attrattr);
neill
1.108
588 #define extra_size_PVFS_servresp_getattr \
589     extra_size_PVFS_object_attr
pcarns
1.2
590
pcarns
1.155
591 /* unstuff ****************************************************/
592 /* - creates the datafile handles for the file.  This allows a stuffed
593  * file to migrate to a large one. */
594
595 struct PVFS_servreq_unstuff
596 {
597     PVFS_handle handle/* handle of target object */
598     PVFS_fs_id fs_id;   /* file system */
599     uint32_t attrmask;  /* mask of desired attributes */
600 };
601 endecode_fields_3_struct(
602     PVFS_servreq_unstuff,
603     PVFS_handlehandle,
604     PVFS_fs_idfs_id,
bligon
1.159.8.8
605     uint32_tattrmask);
pcarns
1.155
606
607 #define PINT_SERVREQ_UNSTUFF_FILL(__req,           \
608                                   __creds,         \
609                                   __fsid,          \
610                                   __handle,        \
611                                   __amask)         \
612 do {                                               \
613     memset(&(__req), 0sizeof(__req));            \
614     (__req).op = PVFS_SERV_UNSTUFF;                \
615     (__req).credentials = (__creds);               \
616     (__req).u.unstuff.fs_id = (__fsid);            \
617     (__req).u.unstuff.handle = (__handle);         \
618     (__req).u.unstuff.attrmask = (__amask);        \
619 while (0)
620
621 struct PVFS_servresp_unstuff
622 {
623     /* return the entire object's attributes, which includes the
624      * new datafile handles for the migrated file.
625      */
626     PVFS_object_attr attr;
627 };
628 endecode_fields_1_struct(
629     PVFS_servresp_unstuff,
bligon
1.159.8.8
630     PVFS_object_attrattr);
pcarns
1.155
631 #define extra_size_PVFS_servresp_unstuff \
632     extra_size_PVFS_object_attr
633
pcarns
1.35
634 /* setattr ****************************************************/
635 /* - sets attributes specified by mask of PVFS_ATTR_XXX values */
636
pcarns
1.31
637 struct PVFS_servreq_setattr
pcarns
1.16
638 {
neill
1.108
639     PVFS_handle handle;    /* handle of target object */
640     PVFS_fs_id fs_id;      /* file system */
641     PVFS_object_attr attr/* new attributes */
642 };
pw
1.124
643 endecode_fields_4_struct(
neill
1.108
644     PVFS_servreq_setattr,
645     PVFS_handlehandle,
646     PVFS_fs_idfs_id,
pw
1.124
647     skip4,,
bligon
1.159.8.8
648     PVFS_object_attrattr);
neill
1.108
649 #define extra_size_PVFS_servreq_setattr \
650     extra_size_PVFS_object_attr
651
652 #define PINT_SERVREQ_SETATTR_FILL(__req,         \
653                                   __creds,       \
654                                   __fsid,        \
655                                   __handle,      \
656                                   __objtype,     \
657                                   __attr,        \
slang
1.157
658                                   __extra_amask, \
659                                   __hints)       \
neill
1.108
660 do {                                             \
661     memset(&(__req), 0sizeof(__req));          \
662     (__req).op = PVFS_SERV_SETATTR;              \
663     (__req).credentials = (__creds);             \
slang
1.157
664     (__req).hints = (__hints);                   \
neill
1.108
665     (__req).u.setattr.fs_id = (__fsid);          \
666     (__req).u.setattr.handle = (__handle);       \
vilayann
1.141
667     (__attr).objtype = (__objtype);              \
668     (__attr).mask |= PVFS_ATTR_SYS_TYPE;         \
669     PINT_CONVERT_ATTR(&(__req).u.setattr.attr, &(__attr), __extra_amask);\
neill
1.67
670 while (0)
671
pcarns
1.36
672 /* lookup path ************************************************/
673 /* - looks up as many elements of the specified path as possible */
674
pcarns
1.31
675 struct PVFS_servreq_lookup_path
pcarns
1.16
676 {
neill
1.108
677     char *path;                  /* path name */
678     PVFS_fs_id fs_id;            /* file system */
slang
1.152
679     PVFS_handle handle/* handle of path parent */
pcarns
1.36
680     /* mask of attribs to return with lookup results */
681     uint32_t attrmask;
pcarns
1.2
682 };
pw
1.125
683 endecode_fields_5_struct(
neill
1.108
684     PVFS_servreq_lookup_path,
685     stringpath,
686     PVFS_fs_idfs_id,
pw
1.125
687     skip4,,
slang
1.152
688     PVFS_handlehandle,
bligon
1.159.8.8
689     uint32_tattrmask);
pw
1.90
690 #define extra_size_PVFS_servreq_lookup_path \
691   roundup8(PVFS_REQ_LIMIT_PATH_NAME_BYTES + 1)
pcarns
1.2
692
neill
1.108
693 #define PINT_SERVREQ_LOOKUP_PATH_FILL(__req,           \
694                                       __creds,         \
695                                       __path,          \
696                                       __fsid,          \
697                                       __handle,        \
slang
1.157
698                                       __amask,         \
699                                       __hints)         \
neill
1.108
700 do {                                                   \
701     memset(&(__req), 0sizeof(__req));                \
702     (__req).op = PVFS_SERV_LOOKUP_PATH;                \
703     (__req).credentials = (__creds);                   \
slang
1.157
704     (__req).hints = (__hints);                         \
neill
1.108
705     (__req).u.lookup_path.path = (__path);             \
706     (__req).u.lookup_path.fs_id = (__fsid);            \
slang
1.152
707     (__req).u.lookup_path.handle = (__handle);\
neill
1.108
708     (__req).u.lookup_path.attrmask = (__amask);        \
rbross
1.52
709 while (0)
710
pcarns
1.31
711 struct PVFS_servresp_lookup_path
pcarns
1.16
712 {
pcarns
1.36
713     /* array of handles for each successfully resolved path segment */
neill
1.108
714     PVFS_handle *handle_array;            
pcarns
1.36
715     /* array of attributes for each path segment (when available) */
716     PVFS_object_attr *attr_array;
neill
1.108
717     uint32_t handle_count/* # of handles returned */
718     uint32_t attr_count;   /* # of attributes returned */
pcarns
1.2
719 };
pw
1.125
720 endecode_fields_1a_1a_struct(
neill
1.108
721     PVFS_servresp_lookup_path,
pw
1.125
722     skip4,,
neill
1.108
723     uint32_thandle_count,
724     PVFS_handlehandle_array,
pw
1.125
725     skip4,,
neill
1.108
726     uint32_tattr_count,
bligon
1.159.8.8
727     PVFS_object_attrattr_array);
pw
1.90
728 /* this is a big thing that could be either a full path,
729 * or lots of handles, just use the max io req limit */
neill
1.108
730 #define extra_size_PVFS_servresp_lookup_path \
731   (PVFS_REQ_LIMIT_IOREQ_BYTES)
pcarns
1.2
732
pcarns
1.37
733 /* mkdir *******************************************************/
734 /* - makes a new directory object */
735
pcarns
1.31
736 struct PVFS_servreq_mkdir
pcarns
1.16
737 {
neill
1.108
738     PVFS_fs_id fs_id;      /* file system */
739     PVFS_object_attr attr/* initial attributes */
neill
1.51
740
741     /*
742       an array of handle extents that we use to suggest to
743       the server from which handle range to allocate for the
744       newly created handle(s).  To request a single handle,
745       a single extent with first = last should be used.
746     */
747     PVFS_handle_extent_array handle_extent_array;
pcarns
1.2
748 };
pw
1.125
749 endecode_fields_4_struct(
neill
1.108
750     PVFS_servreq_mkdir,
751     PVFS_fs_idfs_id,
pw
1.125
752     skip4,,
neill
1.108
753     PVFS_object_attrattr,
bligon
1.159.8.8
754     PVFS_handle_extent_arrayhandle_extent_array);
pw
1.90
755 #define extra_size_PVFS_servreq_mkdir \
756     (PVFS_REQ_LIMIT_HANDLES_COUNT * sizeof(PVFS_handle_extent))
pcarns
1.2
757
neill
1.108
758 #define PINT_SERVREQ_MKDIR_FILL(__req,                 \
759                                 __creds,               \
760                                 __fs_id,               \
761                                 __ext_array,           \
slang
1.157
762                                 __attr,                \
763                                 __hints)               \
neill
1.108
764 do {                                                   \
765     memset(&(__req), 0sizeof(__req));                \
766     (__req).op = PVFS_SERV_MKDIR;                      \
767     (__req).credentials = (__creds);                   \
slang
1.157
768     (__req).hints = (__hints);                         \
neill
1.108
769     (__req).u.mkdir.fs_id = __fs_id;                   \
770     (__req).u.mkdir.handle_extent_array.extent_count = \
walt
1.127
771         (__ext_array).extent_count;                    \
neill
1.108
772     (__req).u.mkdir.handle_extent_array.extent_array = \
walt
1.127
773         (__ext_array).extent_array;                    \
vilayann
1.141
774     (__attr).objtype = PVFS_TYPE_DIRECTORY;            \
775     (__attr).mask   |= PVFS_ATTR_SYS_TYPE;             \
776     PINT_CONVERT_ATTR(&(__req).u.mkdir.attr, &(__attr), 0);\
neill
1.92
777 while (0)
778
pcarns
1.31
779 struct PVFS_servresp_mkdir
pcarns
1.16
780 {
neill
1.108
781     PVFS_handle handle/* handle of new directory */
pcarns
1.2
782 };
neill
1.108
783 endecode_fields_1_struct(
784     PVFS_servresp_mkdir,
bligon
1.159.8.8
785     PVFS_handlehandle);
pcarns
1.37
786
787 /* create dirent ***********************************************/
788 /* - creates a new entry within an existing directory */
789
pw
1.87
790 struct PVFS_servreq_crdirent
pcarns
1.16
791 {
neill
1.108
792     char *name;                /* name of new entry */
793     PVFS_handle new_handle;    /* handle of new entry */
slang
1.152
794     PVFS_handle handle/* handle of directory */
neill
1.108
795     PVFS_fs_id fs_id;          /* file system */
796 };
vilayann
1.142
797 endecode_fields_4_struct(
neill
1.108
798     PVFS_servreq_crdirent,
799     stringname,
800     PVFS_handlenew_handle,
slang
1.152
801     PVFS_handlehandle,
bligon
1.159.8.8
802     PVFS_fs_idfs_id);
pw
1.90
803 #define extra_size_PVFS_servreq_crdirent \
804   roundup8(PVFS_REQ_LIMIT_SEGMENT_BYTES+1)
neill
1.67
805
pw
1.87
806 #define PINT_SERVREQ_CRDIRENT_FILL(__req,           \
807                                    __creds,         \
808                                    __name,          \
809                                    __new_handle,    \
slang
1.152
810                                    __handle,        \
slang
1.157
811                                    __fs_id,         \
812                                    __hints)         \
pw
1.87
813 do {                                                \
814     memset(&(__req), 0sizeof(__req));             \
815     (__req).op = PVFS_SERV_CRDIRENT;                \
816     (__req).credentials = (__creds);                \
slang
1.157
817     (__req).hints = (__hints);                      \
pw
1.87
818     (__req).u.crdirent.name = (__name);             \
819     (__req).u.crdirent.new_handle = (__new_handle); \
slang
1.152
820     (__req).u.crdirent.handle =                     \
slang
1.157
821        (__handle);                                  \
pw
1.87
822     (__req).u.crdirent.fs_id = (__fs_id);           \
neill
1.67
823 while (0)
pcarns
1.2
824
pcarns
1.37
825 /* rmdirent ****************************************************/
826 /* - removes an existing directory entry */
pcarns
1.2
827
pcarns
1.31
828 struct PVFS_servreq_rmdirent
pcarns
1.16
829 {
neill
1.108
830     char *entry;               /* name of entry to remove */
slang
1.152
831     PVFS_handle handle/* handle of directory */
neill
1.108
832     PVFS_fs_id fs_id;          /* file system */
833 };
vilayann
1.142
834 endecode_fields_3_struct(
neill
1.108
835     PVFS_servreq_rmdirent,
836     stringentry,
slang
1.152
837     PVFS_handlehandle,
bligon
1.159.8.8
838     PVFS_fs_idfs_id);
pw
1.90
839 #define extra_size_PVFS_servreq_rmdirent \
840   roundup8(PVFS_REQ_LIMIT_SEGMENT_BYTES+1)
pcarns
1.2
841
neill
1.108
842 #define PINT_SERVREQ_RMDIRENT_FILL(__req,         \
843                                    __creds,       \
844                                    __fsid,        \
845                                    __handle,      \
slang
1.157
846                                    __entry,       \
847                                    __hints)       \
neill
1.108
848 do {                                              \
849     memset(&(__req), 0sizeof(__req));           \
850     (__req).op = PVFS_SERV_RMDIRENT;              \
851     (__req).credentials = (__creds);              \
slang
1.157
852     (__req).hints = (__hints);                    \
neill
1.108
853     (__req).u.rmdirent.fs_id = (__fsid);          \
slang
1.152
854     (__req).u.rmdirent.handle = (__handle);       \
neill
1.108
855     (__req).u.rmdirent.entry = (__entry);         \
rbross
1.55
856 while (0);
857
neill
1.108
858 struct PVFS_servresp_rmdirent
859 {
vilayann
1.142
860     PVFS_handle entry_handle;   /* handle of removed entry */
neill
1.108
861 };
862 endecode_fields_1_struct(
863     PVFS_servresp_rmdirent,
bligon
1.159.8.8
864     PVFS_handleentry_handle);
neill
1.108
865
866 /* chdirent ****************************************************/
867 /* - modifies an existing directory entry on a particular file system */
868
869 struct PVFS_servreq_chdirent
870 {
871     char *entry;                   /* name of entry to remove */
872     PVFS_handle new_dirent_handle/* handle of directory */
slang
1.152
873     PVFS_handle handle;     /* handle of directory */
neill
1.108
874     PVFS_fs_id fs_id;              /* file system */
875 };
vilayann
1.142
876 endecode_fields_4_struct(
neill
1.108
877     PVFS_servreq_chdirent,
878     stringentry,
879     PVFS_handlenew_dirent_handle,
slang
1.152
880     PVFS_handlehandle,
bligon
1.159.8.8
881     PVFS_fs_idfs_id);
neill
1.108
882 #define extra_size_PVFS_servreq_chdirent \
883   roundup8(PVFS_REQ_LIMIT_SEGMENT_BYTES+1)
884
885 #define PINT_SERVREQ_CHDIRENT_FILL(__req,          \
886                                    __creds,        \
887                                    __fsid,         \
slang
1.152
888                                    __handle,       \
neill
1.108
889                                    __new_dirent,   \
slang
1.157
890                                    __entry,        \
891                                    __hints)        \
neill
1.108
892 do {                                               \
893     memset(&(__req), 0sizeof(__req));            \
894     (__req).op = PVFS_SERV_CHDIRENT;               \
895     (__req).credentials = (__creds);               \
slang
1.157
896     (__req).hints = (__hints);                     \
neill
1.108
897     (__req).u.chdirent.fs_id = (__fsid);           \
slang
1.152
898     (__req).u.chdirent.handle =                    \
899         (__handle);                                \
neill
1.108
900     (__req).u.chdirent.new_dirent_handle =         \
901         (__new_dirent);                            \
902     (__req).u.chdirent.entry = (__entry);          \
903 while (0);
rbross
1.55
904
neill
1.108
905 struct PVFS_servresp_chdirent
pcarns
1.16
906 {
neill
1.108
907     PVFS_handle old_dirent_handle;
pcarns
1.2
908 };
neill
1.108
909 endecode_fields_1_struct(
910     PVFS_servresp_chdirent,
bligon
1.159.8.8
911     PVFS_handleold_dirent_handle);
pcarns
1.2
912
pcarns
1.38
913 /* readdir *****************************************************/
914 /* - reads entries from a directory */
pcarns
1.2
915
pcarns
1.31
916 struct PVFS_servreq_readdir
pcarns
1.16
917 {
neill
1.108
918     PVFS_handle handle;     /* handle of dir object */
919     PVFS_fs_id fs_id;       /* file system */
920     PVFS_ds_position token/* dir offset */
921     uint32_t dirent_count;  /* desired # of entries */
922 };
923 endecode_fields_4_struct(
924     PVFS_servreq_readdir,
925     PVFS_handlehandle,
926     PVFS_fs_idfs_id,
slang
1.148
927     uint32_tdirent_count,
bligon
1.159.8.8
928     PVFS_ds_positiontoken);
neill
1.108
929
930 #define PINT_SERVREQ_READDIR_FILL(__req,              \
931                                   __creds,            \
932                                   __fsid,             \
933                                   __handle,           \
934                                   __token,            \
slang
1.157
935                                   __dirent_count,     \
936                                   __hints)            \
neill
1.108
937 do {                                                  \
938     memset(&(__req), 0sizeof(__req));               \
939     (__req).op = PVFS_SERV_READDIR;                   \
940     (__req).credentials = (__creds);                  \
slang
1.157
941     (__req).hints = (__hints);                        \
neill
1.108
942     (__req).u.readdir.fs_id = (__fsid);               \
943     (__req).u.readdir.handle = (__handle);            \
944     (__req).u.readdir.token = (__token);              \
945     (__req).u.readdir.dirent_count = (__dirent_count);\
neill
1.91
946 while (0);
947
pcarns
1.31
948 struct PVFS_servresp_readdir
pcarns
1.16
949 {
neill
1.108
950     PVFS_ds_position token;  /* new dir offset */
pcarns
1.38
951     /* array of directory entries */
952     PVFS_dirent *dirent_array;
neill
1.108
953     uint32_t dirent_count;   /* # of entries retrieved */
neill
1.122
954     uint64_t directory_version;
pcarns
1.2
955 };
slang
1.148
956 endecode_fields_3a_struct(
neill
1.108
957     PVFS_servresp_readdir,
958     PVFS_ds_positiontoken,
pw
1.125
959     uint64_tdirectory_version,
960     skip4,,
neill
1.108
961     uint32_tdirent_count,
bligon
1.159.8.8
962     PVFS_direntdirent_array);
pw
1.90
963 #define extra_size_PVFS_servresp_readdir \
964   roundup8(PVFS_REQ_LIMIT_DIRENT_COUNT * (PVFS_NAME_MAX + 1 + 8))
965
pcarns
1.39
966 /* getconfig ***************************************************/
967 /* - retrieves initial configuration information from server */
pcarns
1.2
968
slang
1.157
969 #define PINT_SERVREQ_GETCONFIG_FILL(__req, __creds, __hints)\
neill
1.108
970 do {                                               \
971     memset(&(__req), 0sizeof(__req));            \
972     (__req).op = PVFS_SERV_GETCONFIG;              \
slang
1.157
973     (__req).hints = (__hints);                     \
neill
1.108
974     (__req).credentials = (__creds);               \
robl
1.106
975 while (0);
976
pcarns
1.31
977 struct PVFS_servresp_getconfig
pcarns
1.16
978 {
pcarns
1.39
979     char *fs_config_buf;
980     uint32_t fs_config_buf_size;
pcarns
1.2
981 };
slang
1.151
982 endecode_fields_3_struct(
neill
1.108
983     PVFS_servresp_getconfig,
pw
1.125
984     uint32_tfs_config_buf_size,
slang
1.151
985     skip4,,
bligon
1.159.8.8
986     stringfs_config_buf);
neill
1.108
987 #define extra_size_PVFS_servresp_getconfig \
slang
1.151
988     (PVFS_REQ_LIMIT_CONFIG_FILE_BYTES)
pcarns
1.2
989
bligon
1.159.8.1
990 /* mirror ******************************************************/
991 /* - copies a datahandle owned by the local server to a data-  */
992 /*   handle on a remote server. There could be multiple desti- */
993 /*   nation data handles. dst_count tells us how many there    */
994 /*   are.                                                      */
995 struct PVFS_servreq_mirror
996 {
997     PVFS_handle src_handle;
998     PVFS_handle *dst_handle;
999     PVFS_fs_id  fs_id;
1000     PINT_dist   *dist;
1001     uint32_t    bsize;
1002     uint32_t    src_server_nr;
1003     uint32_t    *wcIndex;
1004     uint32_t     dst_count;
1005     enum PVFS_flowproto_type flow_type;
1006     enum PVFS_encoding_type encoding;
1007 };
1008
1009 #ifdef __PINT_REQPROTO_ENCODE_FUNCS_C
1010 #define encode_PVFS_servreq_mirror(pptr,x) do {      \
1011    encode_PVFS_handle(pptr,&(x)->src_handle);        \
1012    encode_PVFS_fs_id(pptr,&(x)->fs_id);              \
1013    encode_PINT_dist(pptr,&(x)->dist);                \
1014    encode_uint32_t(pptr,&(x)->bsize);                \
1015    encode_uint32_t(pptr,&(x)->src_server_nr);        \
1016    encode_uint32_t(pptr,&(x)->dst_count);            \
1017    encode_enum(pptr,&(x)->flow_type);                \
1018    encode_enum(pptr,&(x)->encoding);                 \
1019    int i;                                            \
1020    for (i=0i<(x)->dst_counti++)                  \
1021    {                                                 \
1022        encode_PVFS_handle(pptr,&(x)->dst_handle[i]); \
1023        encode_uint32_t(pptr,&(x)->wcIndex[i]);       \
1024    }                                                 \
1025 while (0)
1026
1027 #define decode_PVFS_servreq_mirror(pptr,x) do {          \
1028    decode_PVFS_handle(pptr,&(x)->src_handle);            \
1029    decode_PVFS_fs_id(pptr,&(x)->fs_id);                  \
1030    decode_PINT_dist(pptr,&(x)->dist);                    \
1031    decode_uint32_t(pptr,&(x)->bsize);                    \
1032    decode_uint32_t(pptr,&(x)->src_server_nr);            \
1033    decode_uint32_t(pptr,&(x)->dst_count);                \
1034    decode_enum(pptr,&(x)->flow_type);                    \
1035    decode_enum(pptr,&(x)->encoding);                     \
1036    (x)->dst_handle = decode_malloc((x)->dst_count *      \
1037                                    sizeof(PVFS_handle)); \
1038    (x)->wcIndex = decode_malloc((x)->dst_count *         \
1039                                sizeof(uint32_t));        \
1040    int i;                                                \
1041    for (i=0i<(x)->dst_counti++)                      \
1042    {                                                     \
1043        decode_PVFS_handle(pptr,&(x)->dst_handle[i]);     \
1044        decode_uint32_t(pptr,&(x)->wcIndex[i]);           \
1045    }                                                     \
1046 while (0)
1047 #endif
1048
1049 #define extra_size_PVFS_servreq_mirror \
1050    ( (sizeof(PVFS_handle) * PVFS_REQ_LIMIT_HANDLES_COUNT) + \
1051      (sizeof(uint32_t) * PVFS_REQ_LIMIT_HANDLES_COUNT) )
1052
1053 /*Response to mirror request.  Identifies the number of bytes written and the */
1054 /*status of that write for each source-destination handle pair. (Source is    */
1055 /*always the same for each pair.)                                             */
1056 struct PVFS_servresp_mirror
1057 {
1058     PVFS_handle src_handle;
1059     uint32_t src_server_nr;
1060     uint32_t *bytes_written;
1061     uint32_t *write_status_code;
1062     uint32_t dst_count;
1063 };
1064
1065 #ifdef __PINT_REQPROTO_ENCODE_FUNCS_C
1066 #define encode_PVFS_servresp_mirror(pptr,x) do {         \
1067    encode_PVFS_handle(pptr,&(x)->src_handle);            \
1068    encode_uint32_t(pptr,&(x)->src_server_nr);            \
1069    encode_uint32_t(pptr,&(x)->dst_count);                \
1070    int i;                                                \
1071    for (i=0i<(x)->dst_counti++)                      \
1072    {                                                     \
1073        encode_uint32_t(pptr,&(x)->bytes_written[i]);     \
1074        encode_uint32_t(pptr,&(x)->write_status_code[i]); \
1075    }                                                     \
1076 while (0)
1077
1078 #define decode_PVFS_servresp_mirror(pptr,x) do {            \
1079   decode_PVFS_handle(pptr,&(x)->src_handle);                \
1080   decode_uint32_t(pptr,&(x)->src_server_nr);                \
1081   decode_uint32_t(pptr,&(x)->dst_count);                    \
1082   (x)->bytes_written     = decode_malloc((x)->dst_count *   \
1083                                          sizeof(uint32_t)); \
1084   (x)->write_status_code = decode_malloc((x)->dst_count *   \
1085                                          sizeof(uint32_t)); \
1086   int i;                                                    \
1087   for (i=0i<(x)->dst_counti++ )                         \
1088   {                                                         \
1089       decode_uint32_t(pptr,&(x)->bytes_written[i]);         \
1090       decode_uint32_t(pptr,&(x)->write_status_code[i]);     \
1091   }                                                         \
1092 while (0)
1093 #endif
1094
1095 #define extra_size_PVFS_servresp_mirror \
1096   ( (sizeof(uint32_t) * PVFS_REQ_LIMIT_HANDLES_COUNT) + \
1097     (sizeof(uint32_t) * PVFS_REQ_LIMIT_HANDLES_COUNT) )
1098
1099
pcarns
1.40
1100 /* truncate ****************************************************/
1101 /* - resizes an existing datafile */
pcarns
1.2
1102
pcarns
1.31
1103 struct PVFS_servreq_truncate
pcarns
1.16
1104 {
neill
1.108
1105     PVFS_handle handle/* handle of obj to resize */
1106     PVFS_fs_id fs_id;   /* file system */
1107     PVFS_size size;     /* new size */
1108     int32_t flags;      /* future use */
1109
1110 };
pw
1.125
1111 endecode_fields_5_struct(
neill
1.108
1112     PVFS_servreq_truncate,
1113     PVFS_handlehandle,
1114     PVFS_fs_idfs_id,
pw
1.125
1115     skip4,,
neill
1.108
1116     PVFS_sizesize,
bligon
1.159.8.8
1117     int32_tflags);
neill
1.108
1118 #define PINT_SERVREQ_TRUNCATE_FILL(__req,  \
1119                                 __creds,   \
1120                                 __fsid,    \
1121                                 __size,    \
slang
1.157
1122                                 __handle,  \
1123                                 __hints)   \
neill
1.108
1124 do {                                       \
1125     memset(&(__req), 0sizeof(__req));    \
1126     (__req).op = PVFS_SERV_TRUNCATE;       \
1127     (__req).credentials = (__creds);       \
slang
1.157
1128     (__req).hints = (__hints);             \
neill
1.108
1129     (__req).u.truncate.fs_id = (__fsid);   \
1130     (__req).u.truncate.size = (__size);    \
1131     (__req).u.truncate.handle = (__handle);\
robl
1.71
1132 while (0)
1133
pcarns
1.70
1134 /* statfs ****************************************************/
1135 /* - retrieves statistics for a particular file system */
1136
1137 struct PVFS_servreq_statfs
1138 {
neill
1.108
1139     PVFS_fs_id fs_id;  /* file system */
pcarns
1.70
1140 };
neill
1.108
1141 endecode_fields_1_struct(
1142     PVFS_servreq_statfs,
bligon
1.159.8.8
1143     PVFS_fs_idfs_id);
neill
1.108
1144
slang
1.157
1145 #define PINT_SERVREQ_STATFS_FILL(__req, __creds, __fsid,__hints)\
neill
1.108
1146 do {                                                    \
1147     memset(&(__req), 0sizeof(__req));                 \
1148     (__req).op = PVFS_SERV_STATFS;                      \
1149     (__req).credentials = (__creds);                    \
slang
1.157
1150     (__req).hints = (__hints);                          \
neill
1.108
1151     (__req).u.statfs.fs_id = (__fsid);                  \
pcarns
1.73
1152 while (0)
1153
pcarns
1.70
1154 struct PVFS_servresp_statfs
1155 {
pcarns
1.72
1156     PVFS_statfs stat;
pcarns
1.70
1157 };
neill
1.108
1158 endecode_fields_1_struct(
1159     PVFS_servresp_statfs,
bligon
1.159.8.8
1160     PVFS_statfsstat);
robl
1.56
1161
pcarns
1.41
1162 /* io **********************************************************/
1163 /* - performs a read or write operation */
pcarns
1.2
1164
pcarns
1.31
1165 struct PVFS_servreq_io
pcarns
1.6
1166 {
neill
1.108
1167     PVFS_handle handle;        /* target datafile */
1168     PVFS_fs_id fs_id;          /* file system */
pcarns
1.41
1169     /* type of I/O operation to perform */
pcarns
1.65
1170     enum PVFS_io_type io_type/* enum defined in pvfs2-types.h */
rbross
1.61
1171
pcarns
1.41
1172     /* type of flow protocol to use for I/O transfer */
1173     enum PVFS_flowproto_type flow_type;
rbross
1.61
1174
pcarns
1.16
1175     /* relative number of this I/O server in distribution */
rbross
1.97
1176     uint32_t server_nr;
pcarns
1.16
1177     /* total number of I/O servers involved in distribution */
rbross
1.97
1178     uint32_t server_ct;
pcarns
1.65
1179
pcarns
1.41
1180     /* distribution */
bradles
1.109
1181     PINT_dist *io_dist;
pcarns
1.65
1182     /* file datatype */
slang
1.132
1183     struct PINT_Request * file_req;
pcarns
1.65
1184     /* offset into file datatype */
pcarns
1.64
1185     PVFS_offset file_req_offset;
pcarns
1.65
1186     /* aggregate size of data to transfer */
1187     PVFS_size aggregate_size;
pcarns
1.2
1188 };
pw
1.90
1189 #ifdef __PINT_REQPROTO_ENCODE_FUNCS_C
1190 #define encode_PVFS_servreq_io(pptr,x) do { \
1191     encode_PVFS_handle(pptr, &(x)->handle); \
1192     encode_PVFS_fs_id(pptr, &(x)->fs_id); \
pw
1.125
1193     encode_skip4(pptr,); \
pw
1.90
1194     encode_enum(pptr, &(x)->io_type); \
1195     encode_enum(pptr, &(x)->flow_type); \
rbross
1.97
1196     encode_uint32_t(pptr, &(x)->server_nr); \
1197     encode_uint32_t(pptr, &(x)->server_ct); \
bradles
1.110
1198     encode_PINT_dist(pptr, &(x)->io_dist); \
slang
1.132
1199     encode_PINT_Request(pptr, &(x)->file_req); \
pw
1.90
1200     encode_PVFS_offset(pptr, &(x)->file_req_offset); \
1201     encode_PVFS_size(pptr, &(x)->aggregate_size); \
1202 while (0)
slang
1.132
1203 #define decode_PVFS_servreq_io(pptr,x) do { \
pw
1.90
1204     decode_PVFS_handle(pptr, &(x)->handle); \
1205     decode_PVFS_fs_id(pptr, &(x)->fs_id); \
pw
1.125
1206     decode_skip4(pptr,); \
pw
1.90
1207     decode_enum(pptr, &(x)->io_type); \
1208     decode_enum(pptr, &(x)->flow_type); \
rbross
1.97
1209     decode_uint32_t(pptr, &(x)->server_nr); \
1210     decode_uint32_t(pptr, &(x)->server_ct); \
bradles
1.110
1211     decode_PINT_dist(pptr, &(x)->io_dist); \
slang
1.132
1212     decode_PINT_Request(pptr, &(x)->file_req); \
bradles
1.126
1213     PINT_request_decode((x)->file_req); /* unpacks the pointers */ \
pw
1.90
1214     decode_PVFS_offset(pptr, &(x)->file_req_offset); \
1215     decode_PVFS_size(pptr, &(x)->aggregate_size); \
1216 while (0)
1217 /* could be huge, limit to max ioreq size beyond struct itself */
pw
1.103
1218 #define extra_size_PVFS_servreq_io roundup8(PVFS_REQ_LIMIT_PATH_NAME_BYTES) \
1219   + roundup8(PVFS_REQ_LIMIT_PINT_REQUEST_NUM * sizeof(PINT_Request))
pw
1.90
1220 #endif
pcarns
1.2
1221
neill
1.108
1222 #define PINT_SERVREQ_IO_FILL(__req,                   \
1223                              __creds,                 \
1224                              __fsid,                  \
1225                              __handle,                \
1226                              __io_type,               \
1227                              __flow_type,             \
1228                              __datafile_nr,           \
1229                              __datafile_ct,           \
1230                              __io_dist,               \
1231                              __file_req,              \
1232                              __file_req_off,          \
slang
1.157
1233                              __aggregate_size,        \
1234                              __hints)                 \
neill
1.108
1235 do {                                                  \
1236     memset(&(__req), 0sizeof(__req));               \
1237     (__req).op                 = PVFS_SERV_IO;        \
1238     (__req).credentials        = (__creds);           \
slang
1.157
1239     (__req).hints              = (__hints);           \
neill
1.108
1240     (__req).u.io.fs_id         = (__fsid);            \
1241     (__req).u.io.handle        = (__handle);          \
1242     (__req).u.io.io_type       = (__io_type);         \
1243     (__req).u.io.flow_type     = (__flow_type);       \
1244     (__req).u.io.server_nr       = (__datafile_nr);   \
1245     (__req).u.io.server_ct     = (__datafile_ct);     \
1246     (__req).u.io.io_dist       = (__io_dist);         \
1247     (__req).u.io.file_req        = (__file_req);      \
1248     (__req).u.io.file_req_offset = (__file_req_off);  \
1249     (__req).u.io.aggregate_size  = (__aggregate_size);\
slang
1.157
1250 while (0)
rbross
1.57
1251
pcarns
1.31
1252 struct PVFS_servresp_io
pcarns
1.6
1253 {
neill
1.108
1254     PVFS_size bstream_size;  /* size of datafile */
pcarns
1.2
1255 };
neill
1.108
1256 endecode_fields_1_struct(
1257     PVFS_servresp_io,
bligon
1.159.8.8
1258     PVFS_sizebstream_size);
pcarns
1.2
1259
pcarns
1.41
1260 /* write operations require a second response to announce completion */
pcarns
1.31
1261 struct PVFS_servresp_write_completion
pcarns
1.9
1262 {
slang
1.132
1263     PVFS_size total_completed/* amount of data transferred */
pcarns
1.9
1264 };
neill
1.108
1265 endecode_fields_1_struct(
1266     PVFS_servresp_write_completion,
bligon
1.159.8.8
1267     PVFS_sizetotal_completed);
pcarns
1.9
1268
slang
1.132
1269 #define SMALL_IO_MAX_SEGMENTS 64
1270
1271 struct PVFS_servreq_small_io
1272 {
1273     PVFS_handle handle;
1274     PVFS_fs_id fs_id;
1275     enum PVFS_io_type io_type;
1276
1277     uint32_t server_nr;
1278     uint32_t server_ct;
1279
1280     PINT_dist * dist;
1281     struct PINT_Request * file_req;
1282     PVFS_offset file_req_offset;
slang
1.137
1283     PVFS_size aggregate_size;
slang
1.132
1284
1285     /* these are used for writes to map the regions of the memory buffer
1286      * to the contiguous encoded message.  They don't get encoded.
1287      */
slang
1.137
1288     int segments;
slang
1.132
1289     PVFS_offset offsets[SMALL_IO_MAX_SEGMENTS];
1290     PVFS_size sizes[SMALL_IO_MAX_SEGMENTS];
1291
robl
1.139
1292     PVFS_size total_bytes/* changed from int32_t */
vilayann
1.143
1293     char * buffer;
slang
1.132
1294 };
1295
1296 #ifdef __PINT_REQPROTO_ENCODE_FUNCS_C
1297 #define encode_PVFS_servreq_small_io(pptr,x) do { \
1298     encode_PVFS_handle(pptr, &(x)->handle); \
1299     encode_PVFS_fs_id(pptr, &(x)->fs_id); \
1300     encode_enum(pptr, &(x)->io_type); \
1301     encode_uint32_t(pptr, &(x)->server_nr); \
1302     encode_uint32_t(pptr, &(x)->server_ct); \
1303     encode_PINT_dist(pptr, &(x)->dist); \
1304     encode_PINT_Request(pptr, &(x)->file_req); \
1305     encode_PVFS_offset(pptr, &(x)->file_req_offset); \
slang
1.137
1306     encode_PVFS_size(pptr, &(x)->aggregate_size); \
robl
1.139
1307     encode_PVFS_size(pptr, &(x)->total_bytes); \
slang
1.134
1308     encode_skip4(pptr,); \
slang
1.132
1309     if ((x)->io_type == PVFS_IO_WRITE) \
1310     { \
1311         int i = 0; \
1312         for(; i < (x)->segments; ++i) \
1313         { \
1314             memcpy((*pptr), \
1315                    (char *)(x)->buffer + ((x)->offsets[i]), \
1316                    (x)->sizes[i]); \
1317             (*pptr) += (x)->sizes[i]; \
1318         } \
1319     } \
1320 while (0)
1321
1322 #define decode_PVFS_servreq_small_io(pptr,x) do { \
1323     decode_PVFS_handle(pptr, &(x)->handle); \
1324     decode_PVFS_fs_id(pptr, &(x)->fs_id); \
1325     decode_enum(pptr, &(x)->io_type); \
1326     decode_uint32_t(pptr, &(x)->server_nr); \
1327     decode_uint32_t(pptr, &(x)->server_ct); \
1328     decode_PINT_dist(pptr, &(x)->dist); \
1329     decode_PINT_Request(pptr, &(x)->file_req); \
1330     PINT_request_decode((x)->file_req); /* unpacks the pointers */ \
1331     decode_PVFS_offset(pptr, &(x)->file_req_offset); \
slang
1.137
1332     decode_PVFS_size(pptr, &(x)->aggregate_size); \
robl
1.139
1333     decode_PVFS_size(pptr, &(x)->total_bytes); \
slang
1.134
1334     decode_skip4(pptr,); \
pw
1.135
1335     if ((x)->io_type == PVFS_IO_WRITE) \
slang
1.132
1336     { \
1337         /* instead of copying the message we just set the pointer, since \
1338          * we know it will not be freed unil the small io state machine \
1339          * has completed. \
1340          */ \
1341         (x)->buffer = (*pptr); \
slang
1.134
1342         (*pptr) += (x)->total_bytes; \
slang
1.132
1343     } \
1344 while (0)
1345 #endif
1346
1347 #define extra_size_PVFS_servreq_small_io PINT_SMALL_IO_MAXSIZE
1348
1349 /* could be huge, limit to max ioreq size beyond struct itself */
slang
1.134
1350 #define PINT_SERVREQ_SMALL_IO_FILL(__req,                                \
1351                                    __creds,                              \
1352                                    __fsid,                               \
1353                                    __handle,                             \
1354                                    __io_type,                            \
1355                                    __dfile_nr,                           \
1356                                    __dfile_ct,                           \
1357                                    __dist,                               \
1358                                    __filereq,                            \
1359                                    __filereq_offset,                     \
slang
1.136
1360                                    __segments,                           \
slang
1.157
1361                                    __memreq_size,                        \
1362                                    __hints )                             \
slang
1.134
1363 do {                                                                     \
1364     int _sio_i;                                                          \
slang
1.132
1365     (__req).op                                = PVFS_SERV_SMALL_IO;      \
1366     (__req).credentials                       = (__creds);               \
slang
1.157
1367     (__req).hints                             = (__hints);               \
slang
1.132
1368     (__req).u.small_io.fs_id                  = (__fsid);                \
1369     (__req).u.small_io.handle                 = (__handle);              \
1370     (__req).u.small_io.io_type                = (__io_type);             \
1371     (__req).u.small_io.server_nr              = (__dfile_nr);            \
1372     (__req).u.small_io.server_ct              = (__dfile_ct);            \
1373     (__req).u.small_io.dist                   = (__dist);                \
1374     (__req).u.small_io.file_req               = (__filereq);             \
1375     (__req).u.small_io.file_req_offset        = (__filereq_offset);      \
slang
1.137
1376     (__req).u.small_io.aggregate_size         = (__memreq_size);         \
slang
1.132
1377     (__req).u.small_io.segments               = (__segments);            \
slang
1.137
1378     (__req).u.small_io.total_bytes            = 0;                       \
slang
1.134
1379     for(_sio_i = 0_sio_i < (__segments); ++_sio_i)                     \
1380     {                                                                    \
slang
1.136
1381         (__req).u.small_io.total_bytes +=                                \
1382             (__req).u.small_io.sizes[_sio_i];                            \
slang
1.134
1383     }                                                                    \
slang
1.132
1384 while(0)
1385
1386 struct PVFS_servresp_small_io
1387 {
1388     enum PVFS_io_type io_type;
1389
1390     /* the io state machine needs the total bstream size to calculate
1391      * the correct return size
1392      */
1393     PVFS_size bstream_size;
1394
1395     /* for writes, this is the amount written.  
1396      * for reads, this is the number of bytes read */
1397     PVFS_size result_size
vilayann
1.143
1398     char * buffer;
slang
1.132
1399 };
1400
1401 #ifdef __PINT_REQPROTO_ENCODE_FUNCS_C
1402 #define encode_PVFS_servresp_small_io(pptr,x) \
1403     do { \
1404         encode_enum(pptr, &(x)->io_type); \
pw
1.133
1405         encode_skip4(pptr,); \
slang
1.132
1406         encode_PVFS_size(pptr, &(x)->bstream_size); \
1407         encode_PVFS_size(pptr, &(x)->result_size); \
1408         if((x)->io_type == PVFS_IO_READ && (x)->buffer) \
1409         { \
1410             memcpy((*pptr), (x)->buffer, (x)->result_size); \
1411             (*pptr) += (x)->result_size; \
1412         } \
1413     } while(0)
1414
1415 #define decode_PVFS_servresp_small_io(pptr,x) \
1416     do { \
1417         decode_enum(pptr, &(x)->io_type); \
pw
1.133
1418         decode_skip4(pptr,); \
slang
1.132
1419         decode_PVFS_size(pptr, &(x)->bstream_size); \
1420         decode_PVFS_size(pptr, &(x)->result_size); \
1421         if((x)->io_type == PVFS_IO_READ) \
1422         { \
1423             (x)->buffer = (*pptr); \
1424             (*pptr) += (x)->result_size; \
1425         } \
1426     } while(0)
1427 #endif
1428
1429 #define extra_size_PVFS_servresp_small_io PINT_SMALL_IO_MAXSIZE
vilayann
1.145
1430
1431 /* listattr ****************************************************/
1432 /* - retrieves attributes for a list of handles based on mask of PVFS_ATTR_XXX values */
1433
1434 struct PVFS_servreq_listattr
1435 {
1436     PVFS_fs_id  fs_id;   /* file system */
1437     uint32_t    attrmask;  /* mask of desired attributes */
1438     uint32_t    nhandles/* number of handles */
1439     PVFS_handle *handles/* handle of target object */
1440 };
1441 endecode_fields_3a_struct(
1442     PVFS_servreq_listattr,
1443     PVFS_fs_idfs_id,
1444     uint32_tattrmask
1445     skip4,,
1446     uint32_tnhandles,
bligon
1.159.8.8
1447     PVFS_handlehandles);
vilayann
1.145
1448 #define extra_size_PVFS_servreq_listattr \
1449     (PVFS_REQ_LIMIT_LISTATTR * sizeof(PVFS_handle))
1450
1451 #define PINT_SERVREQ_LISTATTR_FILL(__req,   \
1452                                   __creds, \
1453                                   __fsid,  \
1454                                   __amask, \
1455                                   __nhandles, \
slang
1.157
1456                                   __handle_array, \
1457                                   __hints) \
vilayann
1.145
1458 do {                                       \
1459     memset(&(__req), 0sizeof(__req));    \
1460     (__req).op = PVFS_SERV_LISTATTR;        \
1461     (__req).credentials = (__creds);       \
slang
1.157
1462     (__req).hints = (__hints);             \
vilayann
1.145
1463     (__req).u.listattr.fs_id = (__fsid);    \
1464     (__req).u.listattr.attrmask = (__amask);\
1465     (__req).u.listattr.nhandles = (__nhandles);    \
1466     (__req).u.listattr.handles = (__handle_array); \
1467 while (0)
1468
1469 struct PVFS_servresp_listattr
1470 {
1471     uint32_t nhandles;
1472     PVFS_error       *error;
1473     PVFS_object_attr *attr;
1474 };
1475 endecode_fields_1aa_struct(
1476     PVFS_servresp_listattr,
1477     skip4,,
1478     uint32_tnhandles,
1479     PVFS_errorerror,
bligon
1.159.8.8
1480     PVFS_object_attrattr);
vilayann
1.145
1481 #define extra_size_PVFS_servresp_listattr \
1482     ((PVFS_REQ_LIMIT_LISTATTR * sizeof(PVFS_error)) + (PVFS_REQ_LIMIT_LISTATTR * extra_size_PVFS_object_attr))
1483
1484
pcarns
1.60
1485 /* mgmt_setparam ****************************************************/
1486 /* - management operation for setting runtime parameters */
1487
1488 struct PVFS_servreq_mgmt_setparam
1489 {
neill
1.108
1490     PVFS_fs_id fs_id;             /* file system */
neill
1.117
1491     enum PVFS_server_param param/* parameter to set */
slang
1.157
1492     struct PVFS_mgmt_setparam_value value;
neill
1.108
1493 };
1494 endecode_fields_3_struct(
1495     PVFS_servreq_mgmt_setparam,
1496     PVFS_fs_idfs_id,
1497     enumparam,
bligon
1.159.8.8
1498     PVFS_mgmt_setparam_valuevalue);
neill
1.108
1499
slang
1.157
1500 #define PINT_SERVREQ_MGMT_SETPARAM_FILL(__req,                   \
1501                                         __creds,                 \
1502                                         __fsid,                  \
1503                                         __param,                 \
1504                                         __value,                 \
1505                                         __hints)                 \
1506 do {                                                             \
1507     memset(&(__req), 0sizeof(__req));                          \
1508     (__req).op = PVFS_SERV_MGMT_SETPARAM;                        \
1509     (__req).credentials = (__creds);                             \
1510     (__req).hints = (__hints);                                   \
1511     (__req).u.mgmt_setparam.fs_id = (__fsid);                    \
1512     (__req).u.mgmt_setparam.param = (__param);                   \
pcarns
1.159
1513     if(__value){                                                 \
1514         (__req).u.mgmt_setparam.value.type = (__value)->type;    \
1515         (__req).u.mgmt_setparam.value.u.value = (__value)->u.value; \
1516     } \
pcarns
1.60
1517 while (0)
1518
pcarns
1.62
1519 /* mgmt_noop ********************************************************/
1520 /* - does nothing except contact a server to see if it is responding
1521  * to requests
1522  */
1523
slang
1.157
1524 #define PINT_SERVREQ_MGMT_NOOP_FILL(__req, __creds, __hints)\
neill
1.108
1525 do {                                               \
1526     memset(&(__req), 0sizeof(__req));            \
1527     (__req).op = PVFS_SERV_MGMT_NOOP;              \
1528     (__req).credentials = (__creds);               \
slang
1.157
1529     (__req).hints = (__hints);                     \
pcarns
1.63
1530 while (0)
1531
pcarns
1.76
1532
1533 /* mgmt_perf_mon ****************************************************/
1534 /* retrieves performance statistics from server */
1535
1536 struct PVFS_servreq_mgmt_perf_mon
1537 {
1538     uint32_t next_id;  /* next time stamp id we want to retrieve */
pcarns
1.77
1539     uint32_t count;    /* how many measurements we want */
pcarns
1.76
1540 };
neill
1.108
1541 endecode_fields_2_struct(
1542     PVFS_servreq_mgmt_perf_mon,
1543     uint32_tnext_id,
bligon
1.159.8.8
1544     uint32_tcount);
neill
1.108
1545
1546 #define PINT_SERVREQ_MGMT_PERF_MON_FILL(__req,    \
1547                                         __creds,  \
1548                                         __next_id,\
slang
1.157
1549                                         __count,  \
1550                                         __hints)  \
neill
1.108
1551 do {                                              \
1552     memset(&(__req), 0sizeof(__req));           \
1553     (__req).op = PVFS_SERV_MGMT_PERF_MON;         \
1554     (__req).credentials = (__creds);              \
slang
1.157
1555     (__req).hints = (__hints);                    \
neill
1.108
1556     (__req).u.mgmt_perf_mon.next_id = (__next_id);\
1557     (__req).u.mgmt_perf_mon.count = (__count);    \
pcarns
1.77
1558 while (0)
1559
pcarns
1.76
1560 struct PVFS_servresp_mgmt_perf_mon
1561 {
neill
1.108
1562     struct PVFS_mgmt_perf_statperf_array/* array of statistics */
1563     uint32_t perf_array_count;              /* size of above array */
1564     /* next id to pick up from this point */
1565     uint32_t suggested_next_id;
1566     uint64_t end_time_ms;  /* end time for final array entry */
1567     uint64_t cur_time_ms;  /* current time according to svr */
1568 };
pw
1.125
1569 endecode_fields_5a_struct(
neill
1.108
1570     PVFS_servresp_mgmt_perf_mon,
1571     uint32_tsuggested_next_id,
pw
1.125
1572     skip4,,
neill
1.108
1573     uint64_tend_time_ms,
1574     uint64_tcur_time_ms,
pw
1.125
1575     skip4,,
neill
1.108
1576     uint32_tperf_array_count,
bligon
1.159.8.8
1577     PVFS_mgmt_perf_statperf_array);
neill
1.108
1578 #define extra_size_PVFS_servresp_mgmt_perf_mon \
1579     (PVFS_REQ_LIMIT_IOREQ_BYTES)
pcarns
1.76
1580
pcarns
1.81
1581 /* mgmt_iterate_handles ***************************************/
1582 /* iterates through handles stored on server */
1583
1584 struct PVFS_servreq_mgmt_iterate_handles
1585 {
1586     PVFS_fs_id fs_id;
pcarns
1.86
1587     int32_t handle_count;
pcarns
1.155
1588     int32_t flags;
pcarns
1.81
1589     PVFS_ds_position position;
1590 };
pcarns
1.155
1591 endecode_fields_4_struct(
neill
1.108
1592     PVFS_servreq_mgmt_iterate_handles,
1593     PVFS_fs_idfs_id,
1594     int32_thandle_count,
pcarns
1.155
1595     int32_tflags,
bligon
1.159.8.8
1596     PVFS_ds_positionposition);
neill
1.108
1597
1598 #define PINT_SERVREQ_MGMT_ITERATE_HANDLES_FILL(__req,              \
1599                                         __creds,                   \
1600                                         __fs_id,                   \
1601                                         __handle_count,            \
pcarns
1.155
1602                                         __position,                \
slang
1.157
1603                                         __flags,                   \
1604                                         __hints)                   \
neill
1.108
1605 do {                                                               \
1606     memset(&(__req), 0sizeof(__req));                            \
1607     (__req).op = PVFS_SERV_MGMT_ITERATE_HANDLES;                   \
1608     (__req).credentials = (__creds);                               \
slang
1.157
1609     (__req).hints = (__hints);                                     \
neill
1.108
1610     (__req).u.mgmt_iterate_handles.fs_id = (__fs_id);              \
1611     (__req).u.mgmt_iterate_handles.handle_count = (__handle_count);\
pcarns
1.155
1612     (__req).u.mgmt_iterate_handles.position = (__position),        \
1613     (__req).u.mgmt_iterate_handles.flags = (__flags);              \
pcarns
1.82
1614 while (0)
1615
pcarns
1.81
1616 struct PVFS_servresp_mgmt_iterate_handles
1617 {
1618     PVFS_ds_position position;
neill
1.108
1619     PVFS_handle *handle_array;
pcarns
1.81
1620     int handle_count;
1621 };
slang
1.148
1622 endecode_fields_2a_struct(
neill
1.108
1623     PVFS_servresp_mgmt_iterate_handles,
1624     PVFS_ds_positionposition,
slang
1.148
1625     skip4,,
neill
1.108
1626     int32_thandle_count,
bligon
1.159.8.8
1627     PVFS_handlehandle_array);
pw
1.90
1628 #define extra_size_PVFS_servresp_mgmt_iterate_handles \
1629   (PVFS_REQ_LIMIT_HANDLES_COUNT * sizeof(PVFS_handle))
pcarns
1.81
1630
pcarns
1.86
1631 /* mgmt_dspace_info_list **************************************/
1632 /* - returns low level dspace information for a list of handles */
1633
1634 struct PVFS_servreq_mgmt_dspace_info_list
1635 {
1636     PVFS_fs_id fs_id;
1637     PVFS_handlehandle_array;
1638     int32_t handle_count;
1639 };
neill
1.108
1640 endecode_fields_1a_struct(
1641     PVFS_servreq_mgmt_dspace_info_list,
1642     PVFS_fs_idfs_id,
1643     int32_thandle_count,
bligon
1.159.8.8
1644     PVFS_handlehandle_array);
pw
1.90
1645 #define extra_size_PVFS_servreq_mgmt_dspace_info_list \
1646   (PVFS_REQ_LIMIT_HANDLES_COUNT * sizeof(PVFS_handle))
pcarns
1.86
1647
neill
1.108
1648 #define PINT_SERVREQ_MGMT_DSPACE_INFO_LIST(__req,                   \
1649                                         __creds,                    \
1650                                         __fs_id,                    \
1651                                         __handle_array,             \
slang
1.157
1652                                         __handle_count,             \
1653                                         __hints)                    \
neill
1.108
1654 do {                                                                \
1655     memset(&(__req), 0sizeof(__req));                             \
1656     (__req).op = PVFS_SERV_MGMT_DSPACE_INFO_LIST;                   \
1657     (__req).credentials = (__creds);                                \
slang
1.157
1658     (__req).hints = (__hints);                                      \
neill
1.108
1659     (__req).u.mgmt_dspace_info_list.fs_id = (__fs_id);              \
1660     (__req).u.mgmt_dspace_info_list.handle_array = (__handle_array);\
1661     (__req).u.mgmt_dspace_info_list.handle_count = (__handle_count);\
pcarns
1.86
1662 while (0)
1663
1664 struct PVFS_servresp_mgmt_dspace_info_list
1665 {
neill
1.108
1666     struct PVFS_mgmt_dspace_info *dspace_info_array;
pcarns
1.86
1667     int32_t dspace_info_count;
1668 };
pw
1.125
1669 endecode_fields_1a_struct(
neill
1.108
1670     PVFS_servresp_mgmt_dspace_info_list,
pw
1.125
1671     skip4,,
neill
1.108
1672     int32_tdspace_info_count,
bligon
1.159.8.8
1673     PVFS_mgmt_dspace_infodspace_info_array);
pw
1.90
1674 #define extra_size_PVFS_servresp_mgmt_dspace_info_list \
neill
1.108
1675    (PVFS_REQ_LIMIT_MGMT_DSPACE_INFO_LIST_COUNT * \
1676     sizeof(struct PVFS_mgmt_dspace_info))
pcarns
1.86
1677
pcarns
1.88
1678 /* mgmt_event_mon **************************************/
1679 /* - returns event logging data */
1680
1681 struct PVFS_servreq_mgmt_event_mon
1682 {
1683     uint32_t event_count;
1684 };
neill
1.108
1685 endecode_fields_1_struct(
1686     PVFS_servreq_mgmt_event_mon,
bligon
1.159.8.8
1687     uint32_tevent_count);
pcarns
1.88
1688
slang
1.157
1689 #define PINT_SERVREQ_MGMT_EVENT_MON_FILL(__req, __creds, __event_count, __hints)\
neill
1.108
1690 do {                                                                   \
1691     memset(&(__req), 0sizeof(__req));                                \
1692     (__req).op = PVFS_SERV_MGMT_EVENT_MON;                             \
1693     (__req).credentials = (__creds);                                   \
slang
1.157
1694     (__req).hints = (__hints);                                         \
neill
1.108
1695     (__req).u.mgmt_event_mon.event_count = (__event_count);            \
pcarns
1.88
1696 while (0)
1697
1698 struct PVFS_servresp_mgmt_event_mon
1699 {
1700     struct PVFS_mgmt_eventevent_array;
1701     uint32_t event_count;
1702 };
pw
1.125
1703 endecode_fields_1a_struct(
neill
1.108
1704     PVFS_servresp_mgmt_event_mon,
pw
1.125
1705     skip4,,
pw
1.90
1706     uint32_tevent_count,
bligon
1.159.8.8
1707     PVFS_mgmt_eventevent_array);
pw
1.94
1708 #define extra_size_PVFS_servresp_mgmt_event_mon \
1709   (PVFS_REQ_LIMIT_MGMT_EVENT_MON_COUNT * \
1710    roundup8(sizeof(struct PVFS_mgmt_event)))
pcarns
1.88
1711
walt
1.127
1712 /* geteattr ****************************************************/
pw
1.133
1713 /* - retrieves list of extended attributes */
walt
1.127
1714
1715 struct PVFS_servreq_geteattr
1716 {
1717     PVFS_handle handle;  /* handle of target object */
1718     PVFS_fs_id fs_id;    /* file system */
1719     int32_t nkey;        /* number of keys to read */
1720     PVFS_ds_keyval *key/* array of keys to read */
1721     PVFS_size *valsz;    /* array of value buffer sizes */
1722 };
pw
1.133
1723 endecode_fields_2aa_struct(
walt
1.127
1724     PVFS_servreq_geteattr,
1725     PVFS_handlehandle,
1726     PVFS_fs_idfs_id,
1727     int32_tnkey,
1728     PVFS_ds_keyvalkey,
1729     PVFS_sizevalsz);
1730 #define extra_size_PVFS_servreq_geteattr \
1731     (PVFS_REQ_LIMIT_KEY_LEN * PVFS_REQ_LIMIT_KEYVAL_LIST)
1732
1733 #define PINT_SERVREQ_GETEATTR_FILL(__req,   \
1734                                   __creds, \
1735                                   __fsid,  \
1736                                   __handle,\
1737                                   __nkey,\
1738                                   __key_array, \
slang
1.157
1739                                   __size_array,\
1740                                   __hints) \
walt
1.127
1741 do {                                       \
1742     memset(&(__req), 0sizeof(__req));    \
slang
1.157
1743     (__req).op = PVFS_SERV_GETEATTR;       \
walt
1.127
1744     (__req).credentials = (__creds);       \
slang
1.157
1745     (__req).hints = (__hints);             \
1746     (__req).u.geteattr.fs_id = (__fsid);   \
1747     (__req).u.geteattr.handle = (__handle);\
1748     (__req).u.geteattr.nkey = (__nkey);    \
walt
1.127
1749     (__req).u.geteattr.key = (__key_array);\
1750     (__req).u.geteattr.valsz = (__size_array);\
1751 while (0)
1752
1753 struct PVFS_servresp_geteattr
1754 {
1755     int32_t nkey;           /* number of values returned */
1756     PVFS_ds_keyval *val;    /* array of values returned */
vilayann
1.140
1757     PVFS_error *err;        /* array of error codes */
walt
1.127
1758 };
vilayann
1.140
1759 endecode_fields_1aa_struct(
walt
1.127
1760     PVFS_servresp_geteattr,
1761     skip4,,
1762     int32_tnkey,
vilayann
1.140
1763     PVFS_ds_keyvalval,
1764     PVFS_errorerr);
walt
1.127
1765 #define extra_size_PVFS_servresp_geteattr \
vilayann
1.140
1766     (PVFS_REQ_LIMIT_VAL_LEN * PVFS_REQ_LIMIT_KEYVAL_LIST + \
1767     PVFS_REQ_LIMIT_KEYVAL_LIST * sizeof(PVFS_error))
walt
1.127
1768
1769 /* seteattr ****************************************************/
1770 /* - sets list of extended attributes */
1771
1772 struct PVFS_servreq_seteattr
1773 {
1774     PVFS_handle handle;    /* handle of target object */
1775     PVFS_fs_id fs_id;      /* file system */
robl
1.128
1776     int32_t    flags;      /* flags */
1777     int32_t    nkey;       /* number of keys and vals */
walt
1.127
1778     PVFS_ds_keyval *key;    /* attribute key */
1779     PVFS_ds_keyval *val;    /* attribute value */
1780 };
robl
1.128
1781 endecode_fields_4aa_struct(
walt
1.127
1782     PVFS_servreq_seteattr,
1783     PVFS_handlehandle,
1784     PVFS_fs_idfs_id,
robl
1.128
1785     int32_tflags,
walt
1.127
1786     skip4,,
1787     int32_tnkey,
1788     PVFS_ds_keyvalkey,
robl
1.128
1789     PVFS_ds_keyvalval);
walt
1.127
1790 #define extra_size_PVFS_servreq_seteattr \
1791     ((PVFS_REQ_LIMIT_KEY_LEN + PVFS_REQ_LIMIT_VAL_LEN) \
1792         * PVFS_REQ_LIMIT_KEYVAL_LIST)
1793
1794 #define PINT_SERVREQ_SETEATTR_FILL(__req,   \
1795                                   __creds,       \
1796                                   __fsid,        \
1797                                   __handle,      \
robl
1.128
1798                                   __flags,       \
walt
1.127
1799                                   __nkey,        \
1800                                   __key_array,   \
slang
1.157
1801                                   __val_array,   \
1802                                   __hints)       \
walt
1.127
1803 do {                                             \
1804     memset(&(__req), 0sizeof(__req));          \
1805     (__req).op = PVFS_SERV_SETEATTR;        \
slang
1.157
1806     (__req).credentials = (__creds);        \
1807     (__req).hints = (__hints);              \
walt
1.127
1808     (__req).u.seteattr.fs_id = (__fsid);    \
1809     (__req).u.seteattr.handle = (__handle); \
robl
1.128
1810     (__req).u.seteattr.flags = (__flags);   \
walt
1.127
1811     (__req).u.seteattr.nkey = (__nkey);     \
1812     (__req).u.seteattr.key = (__key_array); \
1813     (__req).u.seteattr.val = (__val_array); \
1814 while (0)
1815
1816 /* deleattr ****************************************************/
1817 /* - deletes extended attributes */
1818
1819 struct PVFS_servreq_deleattr
1820 {
1821     PVFS_handle handle/* handle of target object */
1822     PVFS_fs_id fs_id;   /* file system */
1823     PVFS_ds_keyval key/* key to read */
1824 };
1825 endecode_fields_3_struct(
1826     PVFS_servreq_deleattr,
1827     PVFS_handlehandle,
1828     PVFS_fs_idfs_id,
1829     PVFS_ds_keyvalkey);
1830 #define extra_size_PVFS_servreq_deleattr \
1831     PVFS_REQ_LIMIT_KEY_LEN
1832
1833 #define PINT_SERVREQ_DELEATTR_FILL(__req,   \
1834                                   __creds, \
1835                                   __fsid,  \
1836                                   __handle,\
slang
1.157
1837                                   __key,   \
1838                                   __hints) \
walt
1.127
1839 do {                                       \
1840     memset(&(__req), 0sizeof(__req));    \
1841     (__req).op = PVFS_SERV_DELEATTR;        \
1842     (__req).credentials = (__creds);       \
slang
1.157
1843     (__req).hints = (__hints);             \
walt
1.127
1844     (__req).u.deleattr.fs_id = (__fsid);    \
1845     (__req).u.deleattr.handle = (__handle); \
1846     (__req).u.deleattr.key.buffer_sz = (__key).buffer_sz;\
1847     (__req).u.deleattr.key.buffer = (__key).buffer;\
1848 while (0)
1849
vilayann
1.130
1850 /* listeattr **************************************************/
1851 /* - list extended attributes */
1852
1853 struct PVFS_servreq_listeattr
1854 {
1855     PVFS_handle handle;     /* handle of dir object */
1856     PVFS_fs_id  fs_id;      /* file system */
1857     PVFS_ds_position token/* offset */
1858     uint32_t     nkey;      /* desired number of keys to read */
1859     PVFS_size   *keysz;     /* array of key buffer sizes */
1860 };
1861 endecode_fields_4a_struct(
1862     PVFS_servreq_listeattr,
1863     PVFS_handlehandle,
1864     PVFS_fs_idfs_id,
slang
1.148
1865     skip4,,
vilayann
1.130
1866     PVFS_ds_positiontoken,
1867     uint32_tnkey,
1868     PVFS_sizekeysz);
1869 #define extra_size_PVFS_servreq_listeattr \
vilayann
1.131
1870     (PVFS_REQ_LIMIT_KEYVAL_LIST * sizeof(PVFS_size))
vilayann
1.130
1871
1872 #define PINT_SERVREQ_LISTEATTR_FILL(__req,            \
1873                                   __creds,            \
1874                                   __fsid,             \
1875                                   __handle,           \
1876                                   __token,            \
1877                                   __nkey,             \
slang
1.157
1878                                   __size_array,       \
1879                                   __hints)            \
vilayann
1.130
1880 do {                                                  \
1881     memset(&(__req), 0sizeof(__req));               \
1882     (__req).op = PVFS_SERV_LISTEATTR;                 \
1883     (__req).credentials = (__creds);                  \
slang
1.157
1884     (__req).hints = (__hints);                        \
vilayann
1.130
1885     (__req).u.listeattr.fs_id = (__fsid);             \
1886     (__req).u.listeattr.handle = (__handle);          \
1887     (__req).u.listeattr.token = (__token);            \
1888     (__req).u.listeattr.nkey = (__nkey);              \
1889     (__req).u.listeattr.keysz = (__size_array);       \
1890 while (0);
1891
1892 struct PVFS_servresp_listeattr
1893 {
1894     PVFS_ds_position token;  /* new dir offset */
1895     uint32_t nkey;   /* # of keys retrieved */
1896     PVFS_ds_keyval *key/* array of keys returned */
1897 };
slang
1.148
1898 endecode_fields_2a_struct(
vilayann
1.130
1899     PVFS_servresp_listeattr,
1900     PVFS_ds_positiontoken,
slang
1.148
1901     skip4,,
vilayann
1.130
1902     uint32_tnkey,
bligon
1.159.8.8
1903     PVFS_ds_keyvalkey);
vilayann
1.130
1904 #define extra_size_PVFS_servresp_listeattr \
1905     (PVFS_REQ_LIMIT_KEY_LEN * PVFS_REQ_LIMIT_KEYVAL_LIST)
1906
wligon
1.159.8.8.2.1
1907 /* MGMT MIGRATE *****************************************//*COME HERE TO CHANGE STUFF!*/
1908 /* copy a single object and move to another server*/     
1909
1910 struct PVFS_servreq_mgmt_migrate{
wligon
1.159.8.8.2.3
1911     char *dest_server;
wligon
1.159.8.8.2.1
1912     PVFS_handle handle;
1913     PVFS_fs_id fs_id;
1914 };
1915
1916 endecode_fields_3_struct(
1917      PVFS_servreq_mgmt_migrate,
wligon
1.159.8.8.2.3
1918      stringdest_server,
wligon
1.159.8.8.2.1
1919      PVFS_handlehandle,
wligon
1.159.8.8.2.3
1920      PVFS_fs_idfs_id);
1921
1922 #define extra_size_PVFS_servreq_migrate \
1923     roundup8(PVFS_REQ_LIMIT_SEGMENT_BYTES+1)
wligon
1.159.8.8.2.1
1924
1925 #define PINT_SERVREQ_MGMT_MIGRATE_FILL(__req,        \
1926                                      __creds,        \
1927                                      __fsid,         \
1928                                      __handle,       \
wligon
1.159.8.8.2.3
1929                                      __dest_server,  \
wligon
1.159.8.8.2.1
1930                                      __hints)        \
1931 do{                                                  \
1932     memset(&(__req), 0sizeof(__req));              \
1933     (__req).op = PVFS_SERV_MGMT_MIGRATE;             \
1934     (__req).credentials = (__creds);                 \
1935     (__req).hints = (__hints);                       \
1936     (__req).u.mgmt_migrate.handle = (__handle);      \
1937     (__req).u.mgmt_migrate.fs_id = (__fsid);         \
wligon
1.159.8.8.2.3
1938     (__req).u.mgmt_migrate.dest_server = __dest_server; \
1939 while(0)
1940
1941 /**************************************************************************/
1942 /*migrate-create*/
1943
1944 struct PVFS_servreq_migrate_create
1945 {
1946     int32_t mask;
1947     PVFS_ds_keyval *val;
1948     PVFS_ds_keyval *key;
1949     int32_t nkey;
1950     PVFS_fs_id fs_id;
1951     PVFS_handle handle;
1952     PVFS_object_attr attr;
1953 };
1954
1955 endecode_fields_4aa_struct(
1956     PVFS_servreq_migrate_create,
1957     PVFS_handlehandle,
1958     PVFS_fs_idfs_id,
1959     int32_tmask,
1960     PVFS_object_attrattr,
1961     int32_tnkey,
1962     PVFS_ds_keyvalkey,
1963     PVFS_ds_keyvalval);
1964
1965 #define extra_size_PVFS_servreq_migrate_create \
1966         ((PVFS_REQ_LIMIT_KEY_LEN + PVFS_REQ_LIMIT_VAL_LEN) \
1967         * PVFS_REQ_LIMIT_KEYVAL_LIST)
1968
1969 #define PINT_SERVREQ_MIGRATE_CREATE_FILL(__req,     \
1970                                          __creds,   \
1971                                          __fs_id,   \
1972                                          __handle,  \
1973                                          __mask,    \
1974                                          __attr,    \
1975                                          __key,     \
1976                                          __val,     \
1977                                          __nkey,    \
1978                                          __hints)   \
1979 do{                                                 \
1980     memset(&(__req), 0sizeof(__req));             \
1981     (__req).op = PVFS_SERV_MIGRATE_CREATE;          \
1982     (__req).credentials = (__creds);                \
1983     (__req).hints = (__hints);                      \
1984     (__req).u.migrate_create.fs_id = (__fs_id);     \
1985     (__req).u.migrate_create.handle = (__handle);   \
1986     (__req).u.migrate_create.attr = (__attr);       \
1987     (__req).u.migrate_create.nkey = (__nkey);       \
1988     (__req).u.migrate_create.mask = (__mask);       \
1989     (__req).u.migrate_create.key = (__key);         \
1990     (__req).u.migrate_create.val = (__val);         \
1991 }while(0)
1992
1993
1994     
1995 /* Types for mask used for migrate_create.sm */   
1996 #define MIGRATE_CREATE (1 << 0)
1997 #define MIGRATE_STORE  (1 << 1)
1998
1999                                      
2000 struct PVFS_servresp_migrate_create
2001 {
2002     PVFS_handle new_handle;
2003 };
2004
2005 endecode_fields_1_struct(
2006     PVFS_servresp_migrate_create,
2007     PVFS_handlenew_handle);
2008
wligon
1.159.8.8.2.1
2009
wligon
1.159.8.8.2.3
2010 /****************************************************************/
wligon
1.159.8.8.2.1
2011
vilayann
1.130
2012
pcarns
1.41
2013 /* server request *********************************************/
2014 /* - generic request with union of all op specific structs */
2015
pcarns
1.31
2016 struct PVFS_server_req
pcarns
1.16
2017 {
pcarns
1.29
2018     enum PVFS_server_op op;
pcarns
1.16
2019     PVFS_credentials credentials;
slang
1.157
2020     PVFS_hint hints;
2021
pcarns
1.16
2022     union
2023     {
bligon
1.159.8.1
2024         struct PVFS_servreq_mirror mirror;
neill
1.108
2025         struct PVFS_servreq_create create;
pcarns
1.155
2026         struct PVFS_servreq_unstuff unstuff;
2027         struct PVFS_servreq_batch_create batch_create;
neill
1.108
2028         struct PVFS_servreq_remove remove;
pcarns
1.155
2029         struct PVFS_servreq_batch_remove batch_remove;
neill
1.108
2030         struct PVFS_servreq_io io;
2031         struct PVFS_servreq_getattr getattr;
2032         struct PVFS_servreq_setattr setattr;
2033         struct PVFS_servreq_mkdir mkdir;
2034         struct PVFS_servreq_readdir readdir;
2035         struct PVFS_servreq_lookup_path lookup_path;
2036         struct PVFS_servreq_crdirent crdirent;
2037         struct PVFS_servreq_rmdirent rmdirent;
2038         struct PVFS_servreq_chdirent chdirent;
2039         struct PVFS_servreq_truncate truncate;
2040         struct PVFS_servreq_flush flush;
2041         struct PVFS_servreq_mgmt_setparam mgmt_setparam;
2042         struct PVFS_servreq_statfs statfs;
2043         struct PVFS_servreq_mgmt_perf_mon mgmt_perf_mon;
2044         struct PVFS_servreq_mgmt_iterate_handles mgmt_iterate_handles;
2045         struct PVFS_servreq_mgmt_dspace_info_list mgmt_dspace_info_list;
2046         struct PVFS_servreq_mgmt_event_mon mgmt_event_mon;
neill
1.114
2047         struct PVFS_servreq_mgmt_remove_object mgmt_remove_object;
neill
1.115
2048         struct PVFS_servreq_mgmt_remove_dirent mgmt_remove_dirent;
neill
1.116
2049         struct PVFS_servreq_mgmt_get_dirdata_handle mgmt_get_dirdata_handle;
walt
1.127
2050         struct PVFS_servreq_geteattr geteattr;
2051         struct PVFS_servreq_seteattr seteattr;
2052         struct PVFS_servreq_deleattr deleattr;
vilayann
1.130
2053         struct PVFS_servreq_listeattr listeattr;
slang
1.132
2054         struct PVFS_servreq_small_io small_io;
vilayann
1.145
2055         struct PVFS_servreq_listattr listattr;
elaine
1.159.8.3
2056         struct PVFS_servreq_tree_remove tree_remove;
2057         struct PVFS_servreq_tree_get_file_size tree_get_file_size;
wligon
1.159.8.8.2.1
2058         struct PVFS_servreq_mgmt_migrate mgmt_migrate;
wligon
1.159.8.8.2.3
2059         struct PVFS_servreq_migrate_create migrate_create;
neill
1.116
2060     } u;
pcarns
1.16
2061 };
pw
1.119
2062 #ifdef __PINT_REQPROTO_ENCODE_FUNCS_C
2063 /* insert padding to ensure the union starts on an aligned boundary */
2064 static inline void
2065 encode_PVFS_server_req(char **pptrconst struct PVFS_server_req *x) {
2066     encode_enum(pptr, &x->op);
pw
1.149
2067 #ifdef HAVE_VALGRIND_H
2068     *(int32_t*) *pptr = 0;  /* else possible memcpy in BMI sees uninit */
2069 #endif
pw
1.119
2070     *pptr += 4;
2071     encode_PVFS_credentials(pptr, &x->credentials);
slang
1.157
2072     encode_PINT_hint(pptrx->hints);
pw
1.119
2073 }
2074 static inline void
2075 decode_PVFS_server_req(char **pptrstruct PVFS_server_req *x) {
2076     decode_enum(pptr, &x->op);
2077     *pptr += 4;
2078     decode_PVFS_credentials(pptr, &x->credentials);
slang
1.157
2079     decode_PINT_hint(pptr, &x->hints);
pw
1.119
2080 }
2081 #endif
pcarns
1.16
2082
pcarns
1.41
2083 /* server response *********************************************/
2084 /* - generic response with union of all op specific structs */
pcarns
1.31
2085 struct PVFS_server_resp
pcarns
1.16
2086 {
pcarns
1.29
2087     enum PVFS_server_op op;
pcarns
1.16
2088     PVFS_error status;
2089     union
2090     {
bligon
1.159.8.1
2091         struct PVFS_servresp_mirror mirror;
neill
1.108
2092         struct PVFS_servresp_create create;
pcarns
1.155
2093         struct PVFS_servresp_unstuff unstuff;
2094         struct PVFS_servresp_batch_create batch_create;
neill
1.108
2095         struct PVFS_servresp_getattr getattr;
2096         struct PVFS_servresp_mkdir mkdir;
2097         struct PVFS_servresp_readdir readdir;
2098         struct PVFS_servresp_lookup_path lookup_path;
2099         struct PVFS_servresp_rmdirent rmdirent;
2100         struct PVFS_servresp_chdirent chdirent;
2101         struct PVFS_servresp_getconfig getconfig;
2102         struct PVFS_servresp_io io;
2103         struct PVFS_servresp_write_completion write_completion;
2104         struct PVFS_servresp_statfs statfs;
2105         struct PVFS_servresp_mgmt_perf_mon mgmt_perf_mon;
2106         struct PVFS_servresp_mgmt_iterate_handles mgmt_iterate_handles;
2107         struct PVFS_servresp_mgmt_dspace_info_list mgmt_dspace_info_list;
2108         struct PVFS_servresp_mgmt_event_mon mgmt_event_mon;
neill
1.116
2109         struct PVFS_servresp_mgmt_get_dirdata_handle mgmt_get_dirdata_handle;
walt
1.127
2110         struct PVFS_servresp_geteattr geteattr;
vilayann
1.130
2111         struct PVFS_servresp_listeattr listeattr;
slang
1.132
2112         struct PVFS_servresp_small_io small_io;
vilayann
1.145
2113         struct PVFS_servresp_listattr listattr;
elaine
1.159.8.3
2114         struct PVFS_servresp_tree_get_file_size tree_get_file_size;
wligon
1.159.8.8.2.3
2115         struct PVFS_servresp_migrate_create migrate_create;
neill
1.116
2116     } u;
pcarns
1.2
2117 };
neill
1.108
2118 endecode_fields_2_struct(
2119     PVFS_server_resp,
2120     enumop,
bligon
1.159.8.8
2121     PVFS_errorstatus);
pcarns
1.2
2122
2123 #endif /* __PVFS2_REQ_PROTO_H */
2124
pcarns
1.16
2125 /*
2126  * Local variables:
2127  *  c-indent-level: 4
2128  *  c-basic-offset: 4
2129  * End:
2130  *
neill
1.112
2131  * vim: ts=8 sts=4 sw=4 expandtab
pcarns
1.16
2132  */