source: gpfs_3.1_ker2.6.20/lpp/mmfs/include/dmapi_types.h @ 16

Last change on this file since 16 was 16, checked in by rock, 16 years ago
File size: 24.1 KB
Line 
1/* IBM_PROLOG_BEGIN_TAG                                                   */
2/* This is an automatically generated prolog.                             */
3/*                                                                        */
4/*                                                                        */
5/*                                                                        */
6/* Licensed Materials - Property of IBM                                   */
7/*                                                                        */
8/* Restricted Materials of IBM                                            */
9/*                                                                        */
10/* (C) COPYRIGHT International Business Machines Corp. 1997,2006          */
11/* All Rights Reserved                                                    */
12/*                                                                        */
13/* US Government Users Restricted Rights - Use, duplication or            */
14/* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.      */
15/*                                                                        */
16/* IBM_PROLOG_END_TAG                                                     */
17/* @(#)06       1.27.1.4  src/avs/fs/mmfs/ts/dm/dmapi_types.h, mmfs, avs_rgpfs24, rgpfs24s008a 12/11/06 13:44:59 */
18
19/*
20 * $Id: dmapi_types.h,v 1.30.4.4 2006/12/11 19:43:56 mcnabb Exp $
21 *
22 * $Log: dmapi_types.h,v $
23 * Revision 1.30.4.4  2006/12/11 19:43:56  mcnabb
24 * Remove poolid in stat structure.
25 *
26 * Revision 1.30.4.3  2006/12/05 07:04:58  mcnabb
27 * For Defect 580710:
28 *
29 * Remove #ifdef POLICY_RESTORE and add 4 bytes padding to dm_stat structure.
30 *
31 * Revision 1.30.4.2  2006/06/22 15:21:21  mcnabb
32 * Added data poolId to dm_stat structure under POLICY_RESTORE ifdef
33 *
34 * Revision 1.30.4.1  2006/06/05 22:27:27  mcnabb
35 * Defect 542420: LNX86 GPFS 64bit EM64T: recall daemons cores in dmapi macro
36 * Make 32bit DMAPI library work on 64bit Linux.
37 *
38 * Revision 1.30  2006/03/10 06:30:08  schmuck
39 * Prune check-in history.  No code change.
40 *
41 * Revision 1.29  2006/02/24 20:38:21  wyllie
42 * Run cindent; no functional changes
43 *
44 * [ 9 log messages deleted ]
45 *
46 * Revision 1.19  1999/12/21  11:09:04  mcnabb
47 * Complete standard header material
48 *
49 */
50
51#ifndef _DMAPI_TYPES_H
52#define _DMAPI_TYPES_H
53
54#include <sys/types.h>
55
56/*
57 * Type definitions for GPFS DMAPI external interfaces
58 */
59
60/* Basic scalar types */
61
62typedef int                     dm_signed32;
63typedef unsigned int            dm_unsigned32;
64typedef long long               dm_signed64;
65typedef unsigned long long      dm_unsigned64;
66
67struct  dm32_scalar128
68{
69  dm_unsigned32  high1;
70  dm_unsigned32  high2;
71  dm_unsigned32  low1;
72  dm_unsigned32  low2;
73};
74
75typedef struct dm32_scalar128 dm32_scalar128;
76
77struct dm_scalar128
78{
79  dm_unsigned64  high;
80  dm_unsigned64  low;
81#ifdef __cplusplus
82  int operator == (const dm_scalar128& rhs) const
83    { return high == rhs.high && low == rhs.low; };
84  int operator != (const dm_scalar128& rhs) const
85    { return high != rhs.high || low != rhs.low; };
86  int operator < (const dm_scalar128& rhs) const
87    { return high < rhs.high || (high == rhs.high && low < rhs.low); };
88  int operator > (const dm_scalar128& rhs) const
89    { return high > rhs.high || (high == rhs.high && low > rhs.low); };
90  int operator <= (const dm_scalar128& rhs) const
91    { return high < rhs.high || (high == rhs.high && low <= rhs.low); };
92  int operator >= (const dm_scalar128& rhs) const
93    { return high > rhs.high || (high == rhs.high && low >= rhs.low); };
94#endif  /* __cplusplus */
95};
96typedef struct dm_scalar128 dm_scalar128;
97
98#define DM_SCALAR128_EQ(x, y) (((x).high==(y).high) && ((x).low==(y).low))
99#define DM_SCALAR128_NE(x, y) (((x).high!=(y).high) || ((x).low!=(y).low))
100#define DM_SCALAR128_LT(x, y) (((x).high<(y).high) || (((x).high==(y).high) && ((x).low<(y).low)))
101#define DM_SCALAR128_GT(x, y) (((x).high>(y).high) || (((x).high==(y).high) && ((x).low>(y).low)))
102#define DM_SCALAR128_LE(x, y) (((x).high<(y).high) || (((x).high==(y).high) && ((x).low<=(y).low)))
103#define DM_SCALAR128_GE(x, y) (((x).high>(y).high) || (((x).high==(y).high) && ((x).low>=(y).low)))
104
105typedef dm_signed64     dm_off_t;
106typedef dm_unsigned64   dm_size_t;
107typedef dm_signed64     dm_ssize_t;
108
109#ifndef GPFS_LINUX
110typedef ino_t dm_ino_t;
111#else
112typedef dm_unsigned64 dm_ino_t; 
113#endif
114
115typedef enum
116{
117  DM_FALSE = 0,
118  DM_TRUE = 1
119} dm_boolean_t;
120
121/* Iterator for a filesystem scan */
122typedef dm_signed64  dm_attrloc_t;
123
124/* Variable-length data */
125struct dm_vardata
126{
127  int              vd_offset;
128  unsigned int     vd_length;
129};
130typedef struct dm_vardata dm_vardata_t;
131
132/* Interpreters for variable length data */
133
134#define DM_GET_LEN(basePtr, vardataFieldName)                   \
135         (((basePtr)->vardataFieldName.vd_offset == 0) ?        \
136          (size_t)DM_INVALID_HLEN :                             \
137          (((basePtr)->vardataFieldName.vd_offset == 1) ?       \
138           (size_t)DM_GLOBAL_HLEN :                             \
139           ((basePtr)->vardataFieldName.vd_length)              \
140        ))
141
142/* The prtType parameter in the DM_GET_VALUE() macro is pointer type
143   (for example "int *"). The value of the macro is a pointer of the give type,
144   or NULL if the data length (as given by the DM_GET_LEN() macro) is zero. */
145#define DM_GET_VALUE(basePtr, vardataFieldName, ptrType)        \
146         (((basePtr)->vardataFieldName.vd_offset == 0) ?        \
147          (ptrType)DM_INVALID_HANP :                            \
148          (((basePtr)->vardataFieldName.vd_offset == 1) ?       \
149           (ptrType)DM_GLOBAL_HANP :                            \
150            (((basePtr)->vardataFieldName.vd_length == 0) ?     \
151             NULL :                                             \
152             (ptrType)((char *)(basePtr)+(basePtr)->vardataFieldName.vd_offset)\
153        )))
154
155/* Iterator for lists of variable length structures */
156
157/* The ptrType parameter in the DM_STEP_TO_NEXT() macro is a pointer type
158   (for example "dm_attrlist_t *"). The value of the macro is a pointer
159   of the given type, or NULL if the current element is the last in the list.*/
160#define DM_STEP_TO_NEXT(basePtr, ptrType)            \
161             (((basePtr)->_link == 0) ? NULL :       \
162              (ptrType)((char *)(basePtr) + (basePtr)->_link))
163
164#define DM_ATTR_NAME_SIZE       8
165
166/* Name of an extended attribute */
167struct dm_attrname
168{
169  u_char              an_chars[DM_ATTR_NAME_SIZE];
170};
171typedef struct dm_attrname dm_attrname_t;
172
173/* Session identifier */
174typedef dm_unsigned64  dm_sessid_t;
175
176/* Node identifier */
177typedef dm_unsigned32  dm_nodeid_t;  /* GPFS Specific - not in XDSM standard */
178
179/* List of extended attributes */
180struct dm_attrlist
181{
182  dm_ssize_t          _link;
183  dm_attrname_t       al_name;
184  dm_vardata_t        al_data;
185};
186typedef struct dm_attrlist      dm_attrlist_t;
187
188/* Attributes of the GPFS DMAPI implementation */
189typedef enum
190{
191  DM_CONFIG_INVALID,                /* Lower than any attribute */
192  DM_CONFIG_BULKALL,
193  DM_CONFIG_CREATE_BY_HANDLE,
194  DM_CONFIG_DTIME_OVERLOAD,
195  DM_CONFIG_LEGACY,
196  DM_CONFIG_LOCK_UPGRADE,
197  DM_CONFIG_MAX_ATTR_ON_DESTROY,
198  DM_CONFIG_MAX_ATTRIBUTE_SIZE,
199  DM_CONFIG_MAX_HANDLE_SIZE,
200  DM_CONFIG_MAX_MANAGED_REGIONS,
201  DM_CONFIG_MAX_MESSAGE_DATA,
202  DM_CONFIG_OBJ_REF,
203  DM_CONFIG_PENDING,
204  DM_CONFIG_PERS_ATTRIBUTES,
205  DM_CONFIG_PERS_EVENTS,
206  DM_CONFIG_PERS_INHERIT_ATTRIBS,
207  DM_CONFIG_PERS_MANAGED_REGIONS,
208  DM_CONFIG_PUNCH_HOLE,
209  DM_CONFIG_TOTAL_ATTRIBUTE_SPACE,
210  DM_CONFIG_WILL_RETRY,
211  DM_CONFIG_MAX                   /* GPFS specific - higher than any attribute */
212} dm_config_t;
213
214#define DM_CONFIG_LOWEST  (DM_CONFIG_INVALID + 1)  /* GPFS specific - lowest attribute  */
215#define DM_CONFIG_HIGHEST (DM_CONFIG_MAX -1)       /* GPFS specific - highest attribute */
216
217/* Names of events */
218typedef enum
219{
220  DM_EVENT_INVALID,           /* Lower than any event */
221  DM_EVENT_CLOSE,
222  DM_EVENT_MOUNT,
223  DM_EVENT_PREUNMOUNT,        DM_EVENT_UNMOUNT,
224  DM_EVENT_NOSPACE,
225  DM_EVENT_DEBUT,
226  DM_EVENT_CREATE,            DM_EVENT_POSTCREATE,
227  DM_EVENT_REMOVE,            DM_EVENT_POSTREMOVE,
228  DM_EVENT_RENAME,            DM_EVENT_POSTRENAME,
229  DM_EVENT_SYMLINK,           DM_EVENT_POSTSYMLINK,
230  DM_EVENT_LINK,              DM_EVENT_POSTLINK,
231  DM_EVENT_READ,
232  DM_EVENT_WRITE,
233  DM_EVENT_TRUNCATE,
234  DM_EVENT_ATTRIBUTE,
235  DM_EVENT_CANCEL,
236  DM_EVENT_DESTROY,
237  DM_EVENT_USER,
238  DM_EVENT_MAX               /* Higher than any event */
239} dm_eventtype_t;
240
241/* Set of events */
242typedef dm_unsigned32   dm_eventset_t;
243
244#define DM_EVENT_LOWEST  (DM_EVENT_INVALID + 1) /* GPFS specific - lowest event */
245#define DM_EVENT_HIGHEST (DM_EVENT_MAX - 1)     /* GPFS specific - highest event */
246
247/* Operations on sets of events */
248
249#define DMEV_SET(ev, eset)     (((((int) (ev)) >= DM_EVENT_LOWEST)                      \
250                                    && (((int) (ev)) <= DM_EVENT_HIGHEST))               \
251                                 ? (eset) |= (((dm_eventset_t) 1) << (((int) (ev)) - 1))  \
252                                 : (eset))
253
254#define DMEV_CLR(ev, eset)     (((((int) (ev)) >= DM_EVENT_LOWEST)                      \
255                                    && (((int) (ev)) <= DM_EVENT_HIGHEST))               \
256                                 ? (eset) &= ~(((dm_eventset_t) 1) << (((int) (ev)) - 1)) \
257                                 : (eset))
258
259#define DMEV_ZERO(eset)        ((eset) = (dm_eventset_t) DM_EVENT_INVALID)
260
261
262#define DMEV_ISSET(ev, eset)   ((((int) (ev)) >= DM_EVENT_LOWEST)                        \
263                                && (((int) (ev)) <= DM_EVENT_HIGHEST)                    \
264                                && (((dm_eventset_t) (eset)) & (((dm_eventset_t) 1) << (((int) (ev)) - 1))))
265
266/* GPFS Specific event set operations -  not in XDSM standard */
267
268/* Add all events to eset */
269#define DMEV_ALL(eset)         ((eset) = ~((~((dm_eventset_t) DM_EVENT_INVALID)) << DM_EVENT_HIGHEST))
270
271/* check if eset is empty (contains no events) */
272#define DMEV_ISZERO(eset) ((((dm_eventset_t) (eset)) & (~((~((dm_eventset_t) DM_EVENT_INVALID)) << DM_EVENT_HIGHEST))) == (dm_eventset_t) DM_EVENT_INVALID)
273
274/* check if eset contains all events */
275#define DMEV_ISALL(eset) ((((dm_eventset_t) (eset)) & (~((~((dm_eventset_t) DM_EVENT_INVALID)) << DM_EVENT_HIGHEST))) == ~((~((dm_eventset_t) DM_EVENT_INVALID)) << DM_EVENT_HIGHEST))
276
277/* Add to eset2 all events of eset1 */
278#define DMEV_ADD(eset1, eset2) ((eset2) = ((((dm_eventset_t) (eset1)) | ((dm_eventset_t) (eset2))) & (~((~((dm_eventset_t) DM_EVENT_INVALID)) << DM_EVENT_HIGHEST))))
279
280/* Remove from eset2 all events of eset1 */
281#define DMEV_REM(eset1, eset2) ((eset2) = (((dm_eventset_t) (eset2)) & (~((dm_eventset_t) (eset1)))))
282
283/* Restrict eset2 by eset1 (remove from eset2 any event that is not in eset1) */
284#define DMEV_RES(eset1, eset2) ((eset2) = ((((dm_eventset_t) (eset1)) & ((dm_eventset_t) (eset2))) & (~((~((dm_eventset_t) DM_EVENT_INVALID)) << DM_EVENT_HIGHEST))))
285
286/* Check if eset1 and eset2 are equal (have the same events) */
287#define DMEV_ISEQ(eset1, eset2)  ((((dm_eventset_t) (eset1)) & (~((~((dm_eventset_t) DM_EVENT_INVALID)) << DM_EVENT_HIGHEST))) == (((dm_eventset_t) (eset2)) & (~((~((dm_eventset_t) DM_EVENT_INVALID)) << DM_EVENT_HIGHEST))))
288
289/* Check if eset1 and eset2 are disjoint (have no events in common) */
290#define DMEV_ISDISJ(eset1, eset2)  ((((dm_eventset_t) (eset1)) & ((dm_eventset_t) (eset2)) & (~((~((dm_eventset_t) DM_EVENT_INVALID)) << DM_EVENT_HIGHEST))) == (dm_eventset_t) DM_EVENT_INVALID)
291
292/* Check if eset1 is a subset of eset2 (all events of eset1 are in eset2) */
293#define DMEV_ISSUB(eset1, eset2)  ((((dm_eventset_t) (eset1)) & ((dm_eventset_t) (eset2)) & (~((~((dm_eventset_t) DM_EVENT_INVALID)) << DM_EVENT_HIGHEST))) == (((dm_eventset_t) (eset1)) & (~((~((dm_eventset_t) DM_EVENT_INVALID)) << DM_EVENT_HIGHEST))))
294
295/* Normalize the contents of eset (unused bits in the mask are cleared).
296   Useful if eset was not obtained entirely by means of DMEV_XXX() macros*/
297#define DMEV_NORM(eset)  ((eset) = (((dm_eventset_t)(eset)) & (~((~((dm_eventset_t) DM_EVENT_INVALID)) << DM_EVENT_HIGHEST))))
298
299/* Extent types */
300typedef enum
301{
302  DM_EXTENT_INVALID,
303  DM_EXTENT_RES,
304  DM_EXTENT_HOLE
305} dm_extenttype_t;
306
307struct dm_extent
308{
309  dm_extenttype_t     ex_type;
310  dm_signed32         ex_pad_to_dword;  /* dm_off_t is 64b, need to pad */
311  dm_off_t            ex_offset;
312  dm_size_t           ex_length;
313};
314typedef struct dm_extent dm_extent_t;
315
316/* Disposition information */
317struct dm_dispinfo
318{
319  dm_ssize_t          _link;
320  dm_vardata_t        di_fshandle;
321  dm_eventset_t       di_eventset;
322};
323typedef struct dm_dispinfo dm_dispinfo_t;
324
325typedef dm_scalar128 dm_token_t;
326typedef dm32_scalar128 dm32_token_t;
327
328/* Comparison macros for tokens - GPFS specific - not in XDSM standard */
329#define DM_TOKEN_EQ(x, y)  DM_SCALAR128_EQ(x, y)
330#define DM_TOKEN_NE(x, y)  DM_SCALAR128_NE(x, y)
331#define DM_TOKEN_LT(x, y)  DM_SCALAR128_LT(x, y)
332#define DM_TOKEN_GT(x, y)  DM_SCALAR128_GT(x, y)
333#define DM_TOKEN_LE(x, y)  DM_SCALAR128_LE(x, y)
334#define DM_TOKEN_GE(x, y)  DM_SCALAR128_GE(x, y)
335
336/* Sequence number for event cancellation */
337typedef dm_scalar128 dm_sequence_t;
338typedef dm32_scalar128 dm32_sequence_t;
339
340/* Comparison macros for sequence numbers - GPFS specific - not in XDSM standard */
341#define DM_SEQUENCE_EQ(x, y)  DM_SCALAR128_EQ(x, y)
342#define DM_SEQUENCE_NE(x, y)  DM_SCALAR128_NE(x, y)
343#define DM_SEQUENCE_LT(x, y)  DM_SCALAR128_LT(x, y)
344#define DM_SEQUENCE_GT(x, y)  DM_SCALAR128_GT(x, y)
345#define DM_SEQUENCE_LE(x, y)  DM_SCALAR128_LE(x, y)
346#define DM_SEQUENCE_GE(x, y)  DM_SCALAR128_GE(x, y)
347
348/* Event message header */
349struct dm_eventmsg
350{
351  dm_ssize_t          _link;
352  dm_eventtype_t      ev_type;
353  dm_token_t          ev_token;
354  dm_sequence_t       ev_sequence;
355  dm_nodeid_t         ev_nodeid;   /* GPFS specific - not in XDSM standard */
356  dm_vardata_t        ev_data;
357};
358typedef struct dm_eventmsg dm_eventmsg_t;
359
360struct dm32_eventmsg
361{
362  dm_ssize_t          _link;
363  dm_eventtype_t      ev_type;
364  dm32_token_t        ev_token;
365  dm32_sequence_t     ev_sequence;
366  dm_nodeid_t         ev_nodeid;   /* GPFS specific - not in XDSM standard */
367  dm_vardata_t        ev_data;
368};
369typedef struct dm32_eventmsg dm32_eventmsg_t;
370typedef struct dm_eventmsg dm64_eventmsg_t;
371
372/* Cancel event message */
373struct dm_cancel_event
374{
375  dm_sequence_t       ce_sequence;
376  dm_token_t          ce_token;
377};
378typedef struct dm_cancel_event dm_cancel_event_t;
379
380/* Data event message */
381struct dm_data_event
382{
383  dm_vardata_t        de_handle;
384  dm_off_t            de_offset;
385  dm_size_t           de_length;
386};
387typedef struct dm_data_event dm_data_event_t;
388
389/* Destroy event message */
390struct dm_destroy_event
391{
392  dm_vardata_t        ds_handle;
393  dm_attrname_t       ds_attrname;
394  dm_vardata_t        ds_attrcopy;
395};
396typedef struct dm_destroy_event dm_destroy_event_t;
397
398/* Mount event message */
399struct dm_mount_event
400{
401  mode_t              me_mode;
402  dm_vardata_t        me_handle1;
403  dm_vardata_t        me_handle2;
404  dm_vardata_t        me_name1;
405  dm_vardata_t        me_name2;
406  dm_vardata_t        me_roothandle;
407};
408typedef struct dm_mount_event dm_mount_event_t;
409
410/* Namespace event message */
411struct dm_namesp_event
412{
413  mode_t              ne_mode;
414  dm_vardata_t        ne_handle1;
415  dm_vardata_t        ne_handle2;
416  dm_vardata_t        ne_name1;
417  dm_vardata_t        ne_name2;
418  int                 ne_retcode;
419};
420typedef struct dm_namesp_event  dm_namesp_event_t;
421
422/* Flags for the mode field of mount, preunmount and unmount event messages */
423#define DM_MOUNT_RDONLY       (0x1)
424#define DM_UNMOUNT_FORCE      (0x2)
425#define DM_LOCAL_MOUNT        (0x4) /* GPFS specific - not in XDSM standard */
426#define DM_REMOTE_MOUNT       (0x8) /* GPFS specific - not in XDSM standard */
427
428struct dm_timestruct
429{
430  time_t              dm_tv_sec;
431  dm_signed32         dm_tv_nsec;
432};
433typedef struct dm_timestruct  dm_timestruct_t;
434
435/* DMAPI file attributes */
436struct dm_fileattr
437{
438  mode_t              fa_mode;
439  uid_t               fa_uid;
440  gid_t               fa_gid;
441  time_t              fa_atime;
442  time_t              fa_mtime;
443  time_t              fa_ctime;
444  time_t              fa_dtime;
445  dm_off_t            fa_size;
446};
447typedef struct dm_fileattr  dm_fileattr_t;
448
449struct dm_fileattr32
450{
451  mode_t              fa_mode;
452  uid_t               fa_uid;
453  gid_t               fa_gid;
454  dm_signed32         fa_atime;
455  dm_signed32         fa_mtime;
456  dm_signed32         fa_ctime;
457  dm_signed32         fa_dtime;
458  dm_off_t            fa_size;
459};
460typedef struct dm_fileattr32  dm_fileattr32_t;
461
462struct dm_fileattr64
463{
464  mode_t              fa_mode;
465  uid_t               fa_uid;
466  gid_t               fa_gid;
467  dm_signed32         fa_pad_to_dword;
468  dm_signed64         fa_atime;
469  dm_signed64         fa_mtime;
470  dm_signed64         fa_ctime;
471  dm_signed64         fa_dtime;
472  dm_off_t            fa_size;
473};
474typedef struct dm_fileattr64  dm_fileattr64_t;
475
476/* Message types for user events */
477typedef enum
478{
479  DM_MSGTYPE_INVALID,
480  DM_MSGTYPE_SYNC,
481  DM_MSGTYPE_ASYNC
482} dm_msgtype_t;
483
484/* Region descriptor */
485struct dm_region
486{
487  dm_off_t            rg_offset;
488  dm_size_t           rg_size;
489  u_int               rg_flags;
490  dm_signed32         rg_opaque; /* GPFS specific - not in XDSM standard */
491};
492typedef struct dm_region dm_region_t;
493
494#define DM_REGION_NOEVENT       (0x0)
495#define DM_REGION_READ          (0x1)
496#define DM_REGION_WRITE         (0x2)
497#define DM_REGION_TRUNCATE      (0x4)
498
499/* Responses for dm_respond_event() */
500typedef enum
501{
502  DM_RESP_INVALID,
503  DM_RESP_CONTINUE,
504  DM_RESP_ABORT,
505  DM_RESP_DONTCARE
506} dm_response_t;
507
508/* Access rights */
509typedef enum
510{
511  DM_RIGHT_NULL,
512  DM_RIGHT_SHARED,
513  DM_RIGHT_EXCL
514} dm_right_t;
515
516/* Status information */
517struct dm_stat
518{
519  dm_ssize_t          _link;
520  dm_vardata_t        dt_handle;
521  dm_vardata_t        dt_compname;
522  dm_eventset_t       dt_emask;
523  int                 dt_nevents;
524  int                 dt_pers;
525  int                 dt_pmanreg;
526  time_t              dt_dtime;
527  u_int               dt_change;
528  dev_t               dt_dev;
529  dm_ino_t            dt_ino; 
530  mode_t              dt_mode;
531  nlink_t             dt_nlink;
532  uid_t               dt_uid;
533  gid_t               dt_gid;
534  dev_t               dt_rdev;
535  dm_off_t            dt_size;
536  time_t              dt_atime;
537  time_t              dt_mtime;
538  time_t              dt_ctime;
539  u_int               dt_blksize;
540  dm_size_t           dt_blocks;
541  int                 dt_gpfsqa1; /* GPFS specific - not in XDSM standard */
542  int                 dt_gpfsqa2; /* GPFS specific - not in XDSM standard */
543};
544typedef struct dm_stat  dm_stat_t;
545
546#if SPAIXLVL >= 500
547struct dm_stat32
548{
549  dm_ssize_t          _link;
550  dm_vardata_t        dt_handle;
551  dm_vardata_t        dt_compname;
552  dm_eventset_t       dt_emask;
553  int                 dt_nevents;
554  int                 dt_pers;
555  int                 dt_pmanreg;
556  dm_signed32         dt_dtime;
557  u_int               dt_change;
558  dm_unsigned32       dt_dev;
559  dm_unsigned32       dt_ino;
560  mode_t              dt_mode;
561  nlink_t             dt_nlink;
562  uid_t               dt_uid;
563  gid_t               dt_gid;
564  dm_unsigned32       dt_rdev;
565  dm_off_t            dt_size;
566  dm_signed32         dt_atime;
567  dm_signed32         dt_mtime;
568  dm_signed32         dt_ctime;
569  u_int               dt_blksize;
570  dm_size_t           dt_blocks;
571  int                 dt_gpfsqa1; /* GPFS specific - not in XDSM standard */
572  int                 dt_gpfsqa2; /* GPFS specific - not in XDSM standard */
573};
574typedef struct dm_stat32  dm_stat32_t;
575
576struct dm_stat64
577{
578  dm_ssize_t          _link;
579  dm_vardata_t        dt_handle;
580  dm_vardata_t        dt_compname;
581  dm_eventset_t       dt_emask;
582  int                 dt_nevents;
583  int                 dt_pers;
584  int                 dt_pmanreg;
585  dm_signed64         dt_dtime;
586  u_int               dt_change;
587  dm_unsigned64       dt_dev;
588  dm_unsigned64       dt_ino;
589  mode_t              dt_mode;
590  nlink_t             dt_nlink;
591  uid_t               dt_uid;
592  gid_t               dt_gid;
593  dm_unsigned64       dt_rdev;
594  dm_off_t            dt_size;
595  dm_signed64         dt_atime;
596  dm_signed64         dt_mtime;
597  dm_signed64         dt_ctime;
598  u_int               dt_blksize;
599  dm_size_t           dt_blocks;
600  int                 dt_gpfsqa1; /* GPFS specific - not in XDSM standard */
601  int                 dt_gpfsqa2; /* GPFS specific - not in XDSM standard */
602};
603typedef struct dm_stat64  dm_stat64_t;
604#elif defined(GPFS_ARCH_X86_64)
605#ifdef __64BIT__
606#ifdef API_32BIT
607struct dm32_usigned64
608{
609  dm_unsigned32  high;
610  dm_unsigned32  low;
611};
612typedef struct dm32_usigned64  dm32_usigned64;
613struct dm32_signed64
614{
615  dm_signed32  high;
616  dm_signed32  low;
617};
618typedef struct dm32_signed64  dm32_signed64;
619struct dm_stat32
620{
621  dm_ssize_t          _link;
622  dm_vardata_t        dt_handle;
623  dm_vardata_t        dt_compname;
624  dm_eventset_t       dt_emask;
625  int                 dt_nevents;
626  int                 dt_pers;
627  int                 dt_pmanreg;
628  dm_signed32         dt_dtime;
629  u_int               dt_change;
630  dm32_usigned64      dt_dev;
631  dm32_usigned64      dt_ino;
632  mode_t              dt_mode;
633  dm_signed32         dt_nlink;
634  uid_t               dt_uid;
635  gid_t               dt_gid;
636  dm32_usigned64      dt_rdev;
637  dm32_signed64       dt_size;
638  dm_signed32         dt_atime;
639  dm_signed32         dt_mtime;
640  dm_signed32         dt_ctime;
641  u_int               dt_blksize;
642  dm32_usigned64      dt_blocks;
643  int                 dt_gpfsqa1; /* GPFS specific - not in XDSM standard */
644  int                 dt_gpfsqa2; /* GPFS specific - not in XDSM standard */
645};
646typedef struct dm_stat32  dm_stat32_t;
647typedef struct dm_stat  dm_stat64_t;
648#endif /* API_32BIT */
649#endif /* __64BIT__ */
650#else  /*GPFS_ARCH_X86_64*/
651typedef struct dm_stat dm_stat64_t;
652typedef struct dm_stat dm_stat32_t;
653#endif
654
655/* File attribute masks */
656#define DM_AT_ATIME             (0x0001)
657#define DM_AT_CFLAG             (0x0002)
658#define DM_AT_CTIME             (0x0004)
659#define DM_AT_DTIME             (0x0008)
660#define DM_AT_EMASK             (0x0010)
661#define DM_AT_GID               (0x0020)
662#define DM_AT_HANDLE            (0x0040)
663#define DM_AT_MODE              (0x0080)
664#define DM_AT_MTIME             (0x0100)
665#define DM_AT_PATTR             (0x0200)
666#define DM_AT_PMANR             (0x0400)
667#define DM_AT_SIZE              (0x0800)
668#define DM_AT_STAT              (0x1000)
669#define DM_AT_UID               (0x2000)
670
671struct dm_xstat
672{
673  dm_ssize_t          _link;
674  dm_stat_t           dx_statinfo;
675  dm_vardata_t        dx_attrdata;
676};
677typedef struct dm_xstat dm_xstat_t;
678
679#if SPAIXLVL >= 500 || (defined(GPFS_ARCH_X86_64) && defined(__64BIT__))
680struct dm_xstat32
681{
682  dm_ssize_t          _link;
683  dm_stat32_t         dx_statinfo;
684  dm_vardata_t        dx_attrdata;
685};
686typedef struct dm_xstat32 dm_xstat32_t;
687
688struct dm_xstat64
689{
690  dm_ssize_t          _link;
691  dm_stat64_t         dx_statinfo;
692  dm_vardata_t        dx_attrdata;
693};
694typedef struct dm_xstat64 dm_xstat64_t;
695#else /* SPAIXLVL >= 500 */
696typedef struct dm_xstat dm_xstat32_t;
697typedef struct dm_xstat dm_xstat64_t;
698#endif
699
700/* Max size of a session label */
701#define DM_SESSION_INFO_LEN     256
702
703/* Special session identifier */
704#define DM_NO_SESSION           ((dm_sessid_t) 0)
705
706/* Flag indicating whether to wait in dm_get_events */
707#define DM_EV_WAIT              (0x1)
708
709/* Flag indicating whether to wait in dm_request_right */
710#define DM_RR_WAIT              (0x1)
711
712/* Special file handles */
713#define DM_GLOBAL_HANP          ((void *) 0xFFFFFFFD)
714#define DM_GLOBAL_HLEN          ((size_t)0)
715
716#define DM_INVALID_HANP         ((void *) 0xFFFFFFFF)
717#define DM_INVALID_HLEN         ((size_t)0)
718
719/* Special tokens */
720static const dm_token_t                _dmNoToken = { 0, 0 };
721#define DM_NO_TOKEN             _dmNoToken
722
723static const dm_token_t                _dmInvalidToken = { 0, 1 };
724#define DM_INVALID_TOKEN        _dmInvalidToken
725
726/* Flag for the dm_write_invis() call */
727#define DM_WRITE_SYNC           (0x1)
728
729/* Version identifier */
730#define DM_VER_STR_CONTENTS     "GPFS DMAPI 2.20"
731
732/* File handle components */
733typedef dm_unsigned64 dm_fsid_t;
734
735typedef dm_unsigned32 dm_igen_t;
736
737#if SPAIXLVL >= 500
738typedef dm_unsigned32 dm_ino32_t;
739typedef dm_unsigned64 dm_ino64_t;
740#else
741typedef ino_t         dm_ino32_t;
742typedef ino_t         dm_ino64_t;
743#endif
744
745struct dm_inherit
746{
747  dm_attrname_t       ih_name;
748  mode_t              ih_filetype;
749};
750typedef struct dm_inherit dm_inherit_t;
751
752#endif /* _DMAPI_TYPES_H */
Note: See TracBrowser for help on using the repository browser.