Added IOR, and GPFS libraries 5.0.3-2

This commit is contained in:
Caubet Serrabou Marc
2019-04-16 14:45:46 +02:00
parent ab00a45e66
commit 8dfb2be152
27 changed files with 16152 additions and 6 deletions

View File

@@ -6,14 +6,13 @@ pbuild::add_to_group 'System'
pbuild::install_docfiles AUTHORS NEWS README_S3
cd ${SRC_DIR}
export GPFS_VERSION="5.0.2-3"
export C_INCLUDE_PATH+=":$BUILDBLOCK_DIR/files/gpfs/$GPFS_VERSION/include/"
export LIBRARY_PATH+=":$BUILDBLOCK_DIR/files/gpfs/$GPFS_VERSION/lib/"
# pbuild::compile_in_sourcetree
pbuild::pre_configure() {
pbuild::add_configure_args "LIBS=/tmp/libgpfs.so"
cd ${SRC_DIR}
./bootstrap
}
pbuild::configure() {
./configure LIBS=/tmp/libgpfs.so
}

View File

@@ -0,0 +1,944 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* */
/* */
/* Licensed Materials - Property of IBM */
/* */
/* Restricted Materials of IBM */
/* */
/* (C) COPYRIGHT International Business Machines Corp. 2007,2018 */
/* All Rights Reserved */
/* */
/* US Government Users Restricted Rights - Use, duplication or */
/* disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */
/* */
/* IBM_PROLOG_END_TAG */
/* @(#)46 1.20 src/avs/fs/mmfs/ts/mmantras/api_event.h, mmfs, avs_rtac502, rtac5021836a 11/17/16 18:55:10 */
#ifndef _h_api_event
#define _h_api_event
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <pthread.h>
#include <sys/time.h>
/* Define event types */
enum
{
/* Internal events */
MOUNT = 0,
UNMOUNT = 1,
ADDDISK = 2,
DELDISK = 3,
CHDISK = 4,
SGMGR_TAKEOVER = 5,
NODE_FAILURE = 6,
NODE_RECOVERY = 7,
FILESYSTEM_CREATION = 8,
FILESYSTEM_DELETION = 9,
FILESYSTEM_STATE_CHANGE = 10,
NEW_CONNECTION = 11,
EVENT_COLLECTION_BUFFER_OVERFLOW = 12,
TOKEN_MANAGER_STATUS = 13,
HUNG_THREAD = 14,
STGPOOL_UTILIZATION = 15,
SDR_CHANGED = 16,
/* Command events */
MMADDDISK = 17,
MMDELDISK = 18,
/* Console log events */
CONSOLE_LOG = 19,
/* Long ioTime warning */
LONG_IOTIME = 20,
/* User generated event */
USER_EVENT = 21,
/* NSD RAID related events */
RECOVERYGROUP_TAKEOVER = 22, /* RG server takeover */
RECOVERYGROUP_RELINQUISH = 23, /* RG server relinquish */
RECOVERYGROUP_OPEN_FAILED = 24, /* RG open failed */
RECOVERYGROUP_PANIC = 25, /* RG panic resign */
PDISK_FAILED = 26, /* pdisk declared dead */
PDISK_RECOVERED = 27, /* pdisk recovered */
PDISK_REPLACE_PDISK = 28, /* pdisk disk replacement */
PDISK_PATH_FAILED = 29, /* pdisk path failed */
DA_REBUILD_FAILED = 30, /* DA rebuild failed */
NSD_CKSUM_MISMATCH = 31, /* checksum error on an NSD RPC */
LOGGROUP_PANIC = 32,
LOGGROUP_OPEN_FAILED = 33,
/* last event: MAX_EVENT_CLASSES */
MAX_EVENT_CLASSES = 34
};
#define MAX_EVENT_FIELD 256 // string lengh
struct EventNameTableEntry
{
const char *name;
int len;
};
/* Define event names */
const struct EventNameTableEntry EventNamesP[MAX_EVENT_CLASSES + 1] =
{
/* 0 */ { "mount", 5 },
/* 1 */ { "unmount", 7 },
/* 2 */ { "adddisk", 7 },
/* 3 */ { "deldisk", 7 },
/* 4 */ { "chdisk", 6 },
/* 5 */ { "takeover", 8 },
/* 6 */ { "failure", 7 },
/* 7 */ { "recovery", 8 },
/* 8 */ { "createfs", 8 },
/* 9 */ { "deletefs", 8 },
/* 10 */ { "fsstatechange", 13 },
/* 11 */ { "newconnection", 13 },
/* 12 */ { "exception", 9 },
/* 13 */ { "sgStats", 7 },
/* 14 */ { "hungthread", 10 },
/* 15 */ { "poolutil", 8 },
/* 16 */ { "sdrChanged", 10 },
/* 17 */ { "mmadddisk", 9 },
/* 18 */ { "mmdeldisk", 9 },
/* 19 */ { "consoleLog", 10 },
/* 20 */ { "longIO", 6 },
/* 21 */ { "userEvent", 9 },
/* 22 */ { "rgTakeover", 10 },
/* 23 */ { "rgRelinquish", 12 },
/* 24 */ { "rgOpenFailed", 12 },
/* 25 */ { "rgPanic", 7 },
/* 26 */ { "pdFailed", 8 },
/* 27 */ { "pdRecovered", 11 },
/* 28 */ { "pdReplacePdisk", 14 },
/* 29 */ { "pdPathFailed", 12 },
/* 30 */ { "daRebuildFailed",15 },
/* 31 */ { "nsdCksumMismatch",16 },
/* 32 */ { "lgPanic", 7 },
/* 33 */ { "lgOpenFailed", 12 },
{ 0, 0 }
};
#if 0
/* Data for callback for response from each node. */
typedef struct MyData
{
char *responseBuffer;
int responseBufferSize;
char *asyncEvents;
int asyncEventsSize;
Mmpmon_Callback_String callback;
FILE *file;
const char *command;
} MyData;
#endif
/* Super class of all events classes. */
class Event
{
friend class EventsHandler;
struct timeval creationTime;
char severity[MAX_EVENT_FIELD];
public:
Event();
~Event();
inline struct timeval getCreationTime() { return creationTime; }
inline char *getSeverity() { return severity; }
};
/* Mount, unmount events */
class MountActionEvent : public Event
{
private:
char nodeIpAddr[MAX_EVENT_FIELD];
char fsName[MAX_EVENT_FIELD];
public:
MountActionEvent(char *nodeIpAddr, char *fsName);
~MountActionEvent();
inline char *getNodeIpAddr() { return nodeIpAddr; }
inline char *getFsName() { return fsName; }
};
/* Adddisk, deldisk events */
class DiskActionEvent : public Event
{
private:
char nodeIpAddr[MAX_EVENT_FIELD];
char fsName[MAX_EVENT_FIELD];
char diskName[MAX_EVENT_FIELD];
public:
DiskActionEvent(char *nodeIpAddr, char *fsName, char *diskName);
~DiskActionEvent();
inline char *getNodeIpAddr() { return nodeIpAddr; }
inline char *getFsName() { return fsName; }
inline char *getDiskName() { return diskName; }
};
/* Chdisk event */
class ChdiskEvent : public Event
{
private:
char nodeIpAddr[MAX_EVENT_FIELD];
char fsName[MAX_EVENT_FIELD];
char diskName[MAX_EVENT_FIELD];
char status[MAX_EVENT_FIELD];
char availability[MAX_EVENT_FIELD];
char fgName[MAX_EVENT_FIELD];
char meta[MAX_EVENT_FIELD];
char data[MAX_EVENT_FIELD];
public:
ChdiskEvent(char *nodeIpAddr, char *fsName, char *diskName,
char *status, char *availability, char *fgName,
char *meta, char *data);
~ChdiskEvent();
inline char *getNodeIpAddr() { return nodeIpAddr; }
inline char *getFsName() { return fsName; }
inline char *getDiskName() { return diskName; }
inline char *getStatus() { return status; }
inline char *getAvailability() { return availability; }
inline char *getFgName() { return fgName; }
inline char *getMeta() { return meta; }
inline char *getData() { return data; }
};
/* Stripe group manager takeover event */
class SgmgrTakeoverEvent : public Event
{
private:
char sgmgrIpAddr[MAX_EVENT_FIELD];
char prevSgmgrIpAddr[MAX_EVENT_FIELD];
char fsName[MAX_EVENT_FIELD];
public:
SgmgrTakeoverEvent(char *sgmgrIpAddr, char *prevSgmgrIpAddr, char *fsName);
~SgmgrTakeoverEvent();
inline char *getSgmgrIpAddr() { return sgmgrIpAddr; }
inline char *getPrevSgmgrIpAddr() { return prevSgmgrIpAddr; }
inline char *getFsName() { return fsName; }
};
/* Node failure, recovery events */
class NodeStatusEvent : public Event
{
private:
char nodeIpAddr[MAX_EVENT_FIELD];
public:
NodeStatusEvent(char *nodeIpAddr);
~NodeStatusEvent();
inline char *getNodeIpAddr() { return nodeIpAddr; }
};
/* File system creation, deletion events */
class FilesystemActionEvent : public Event
{
private:
char sgmgrIpAddr[MAX_EVENT_FIELD];
char fsName[MAX_EVENT_FIELD];
public:
FilesystemActionEvent(char *sgmgrIpAddr, char *fsName);
~FilesystemActionEvent();
inline char *getSgmgrIpAddr() { return sgmgrIpAddr; }
inline char *getFsName() { return fsName; }
};
/* File system state change event */
class FilesystemStateChangeEvent : public Event
{
private:
char fsName[MAX_EVENT_FIELD];
char userUnbalanced[MAX_EVENT_FIELD];
char metaUnbalanced[MAX_EVENT_FIELD];
char userIllreplicated[MAX_EVENT_FIELD];
char metaIllreplicated[MAX_EVENT_FIELD];
char userExposed[MAX_EVENT_FIELD];
char metaExposed[MAX_EVENT_FIELD];
public:
FilesystemStateChangeEvent(char *fsName, char *userUnbalanced,
char *metaUnbalanced, char *userIllreplicated,
char *metaIllreplicated, char *userExposed,
char *metaExposed);
~FilesystemStateChangeEvent();
inline char *getFsName() { return fsName; }
inline char *getUserUnbalanced() { return userUnbalanced; }
inline char *getMetaUnbalanced() { return metaUnbalanced; }
inline char *getUserIllreplicated() { return userIllreplicated; }
inline char *getMetaIllreplicated() { return metaIllreplicated; }
inline char *getUserExposed() { return userExposed; }
inline char *getMetaExposed() { return metaExposed; }
};
/* Hung thread event */
class HungThreadEvent : public Event
{
private:
char nodeIpAddr[MAX_EVENT_FIELD];
time_t waitTime;
char diagnosis[MAX_EVENT_FIELD];
public:
HungThreadEvent(char *nodeAddr, time_t time, char *desc);
~HungThreadEvent();
inline char *getNodeIpAddr() { return nodeIpAddr; }
inline time_t getWaitTime() { return waitTime; }
inline char *getDiagnosis() { return diagnosis; }
};
/* tm stats event */
class TmStatsEvent: public Event
{
private:
char nodeIpAddr[MAX_EVENT_FIELD];
char fsName[MAX_EVENT_FIELD];
int tmSpace;
int tmRequest;
public:
TmStatsEvent(char *nodeAddr, char *fsName, int tmSpace, int tmRequest);
~TmStatsEvent();
inline char *getNodeIpAddr() { return nodeIpAddr; }
inline char *getFsName() { return fsName; }
inline int getTmSpace() { return tmSpace; }
inline int getTmRequest() { return tmRequest; }
};
#if 0
/* File system utilization event */
class FilesystemUtilizationEvent : public Event
{
private:
char fsName[MAX_EVENT_FIELD];
int fsUsage;
public:
FilesystemUtilizationEvent(char *name, int usage);
~FilesystemUtilizationEvent();
inline char *getFsName() { return fsName; }
inline int getFsUsage() { return fsUsage; }
};
#endif
/* Storage pool utilization event */
class StgPoolUtilizationEvent : public Event
{
private:
char fsName[MAX_EVENT_FIELD];
char poolName[MAX_EVENT_FIELD];
char status[MAX_EVENT_FIELD];
int poolUsage;
public:
StgPoolUtilizationEvent(char *fsname, char *poolname, char *status,
int usage);
~StgPoolUtilizationEvent();
inline char *getFsName() { return fsName; }
inline char *getPoolName() { return poolName; }
inline char *getStatus() { return status; }
inline int getPoolUsage() { return poolUsage; }
};
class SDRChangedEvent : public Event
{
private:
char nodeName[MAX_EVENT_FIELD];
public:
SDRChangedEvent(char *nodeName);
~SDRChangedEvent();
inline char *getNodeName() { return nodeName; }
};
class UserGeneratedEvent : public Event
{
private:
char nodeName[MAX_EVENT_FIELD];
char data[MAX_EVENT_FIELD];
public:
UserGeneratedEvent(char *nodeName, char *data);
~UserGeneratedEvent();
inline char *getNodeName() { return nodeName; }
inline char *getData() { return data; }
};
/* Adddisk, deldisk command events */
class DiskCmdEvent : public Event
{
private:
char nodeName[MAX_EVENT_FIELD];
char fsName[MAX_EVENT_FIELD];
char diskName[MAX_EVENT_FIELD];
char cmd[MAX_EVENT_FIELD];
char status[MAX_EVENT_FIELD];
int result;
public:
DiskCmdEvent(char *nodeName, char *fsName, char *diskName, char *cmd,
char *status, int result);
~DiskCmdEvent();
inline char *getNodeName() { return nodeName; }
inline char *getFsName() { return fsName; }
inline char *getDiskName() { return diskName; }
inline char *getCmd() { return cmd; }
inline char *getStatus() { return status; }
inline int getResult() { return result; }
};
/* Console message events */
class ConsoleLogEvent : public Event
{
private:
char nodeName[MAX_EVENT_FIELD];
char msgTxt[MAX_EVENT_FIELD];
int msgLevel;
public:
ConsoleLogEvent(char *nodeName, char *msgTxt, int msgLevel);
~ConsoleLogEvent() {};
inline char *getNodeName() { return nodeName; }
inline char *getMsgTxt() { return msgTxt; }
inline int getMsgLevel() { return msgLevel; }
};
/* Long ioTime warning events */
class LongIoTimeEvent : public Event
{
private:
char nodeName[MAX_EVENT_FIELD];
char fsName[MAX_EVENT_FIELD];
char diskName[MAX_EVENT_FIELD];
char cmd[MAX_EVENT_FIELD];
int ioLength;
time_t ioTime; /* in microseconds */
public:
LongIoTimeEvent(char *nodeName, char *fsName, char *diskName, char *cmd,
int ioLength, time_t ioTime_us);
~LongIoTimeEvent() {};
inline char *getNodeName() { return nodeName; }
inline char *getFsName() { return fsName; }
inline char *getDiskName() { return diskName; }
inline char *getCmd() { return cmd; }
inline int getIoLength() { return ioLength; }
inline time_t getIoTime() { return ioTime; }
};
/* NSD RAID related events */
/* Recovery Group Takeveover:
RG server has begun serving an RG
*/
class RgTakeoverEvent : public Event
{
private:
char nodeName[MAX_EVENT_FIELD];
char rgName[MAX_EVENT_FIELD];
char reason[MAX_EVENT_FIELD];
int err;
public:
RgTakeoverEvent(char *nodeName, char *rgName, char *reason, int err);
~RgTakeoverEvent() {};
inline char *getNodeName() { return nodeName; }
inline char *getRgName() { return rgName; }
inline char *getReason() { return reason; }
inline int getErr() { return err; }
};
/* Recovery Group Relinquish
RG server has stopped serving an RG
*/
class RgRelinquishEvent: public Event
{
private:
char nodeName[MAX_EVENT_FIELD];
char rgName[MAX_EVENT_FIELD];
char reason[MAX_EVENT_FIELD];
int err;
public:
RgRelinquishEvent(char *nodeName, char *rgName, char *reason, int err);
~RgRelinquishEvent() {};
inline char *getNodeName() { return nodeName; }
inline char *getRgName() { return rgName; }
inline char *getReason() { return reason; }
inline int getErr() { return err; }
};
/* Recovery Group OpenFailed
rgOpenFailed event will always be followed by rgTakeover with an error
code (and the same reason string.)
*/
class RgOpenFailedEvent: public Event
{
private:
char nodeName[MAX_EVENT_FIELD];
char rgName[MAX_EVENT_FIELD];
char reason[MAX_EVENT_FIELD];
int err;
public:
RgOpenFailedEvent(char *nodeName, char *rgName, char *reason, int err);
~RgOpenFailedEvent() {};
inline char *getNodeName() { return nodeName; }
inline char *getRgName() { return rgName; }
inline char *getReason() { return reason; }
inline int getErr() { return err; }
};
/* Recovery Group Panic
rgPanic
*/
class RgPanicEvent: public Event
{
private:
char nodeName[MAX_EVENT_FIELD];
char rgName[MAX_EVENT_FIELD];
char reason[MAX_EVENT_FIELD];
int err;
public:
RgPanicEvent(char *nodeName, char *rgName, char *reason, int err);
~RgPanicEvent() {};
inline char *getNodeName() { return nodeName; }
inline char *getRgName() { return rgName; }
inline char *getReason() { return reason; }
inline int getErr() { return err; }
};
/* Log Group OpenFailed (lgOpenFailed) */
class LgOpenFailedEvent: public Event
{
private:
char nodeName[MAX_EVENT_FIELD];
char rgName[MAX_EVENT_FIELD];
char lgName[MAX_EVENT_FIELD];
char reason[MAX_EVENT_FIELD];
int err;
public:
LgOpenFailedEvent(char *nodeName, char *rgName, char lgName,
char *reason, int err);
~LgOpenFailedEvent() {};
inline char *getNodeName() { return nodeName; }
inline char *getRgName() { return rgName; }
inline char *getLgName() { return lgName; }
inline char *getReason() { return reason; }
inline int getErr() { return err; }
};
/* Log Group Panic (lgPanic) */
class LgPanicEvent: public Event
{
private:
char nodeName[MAX_EVENT_FIELD];
char rgName[MAX_EVENT_FIELD];
char lgName[MAX_EVENT_FIELD];
char reason[MAX_EVENT_FIELD];
int err;
public:
LgPanicEvent(char *nodeName, char *rgName, char *lgName,
char *reason, int err);
~LgPanicEvent() {};
inline char *getNodeName() { return nodeName; }
inline char *getRgName() { return rgName; }
inline char *getLgName() { return lgName; }
inline char *getReason() { return reason; }
inline int getErr() { return err; }
};
/* disk array requires disk replacement */
class PdReplacePdiskEvent : public Event
{
private:
char nodeName[MAX_EVENT_FIELD];
char location[MAX_EVENT_FIELD];
char fru[MAX_EVENT_FIELD];
char wwn[MAX_EVENT_FIELD]; /* SCSI World Wide Name */
char rgName[MAX_EVENT_FIELD];
char daName[MAX_EVENT_FIELD];
char pdName[MAX_EVENT_FIELD];
char state[MAX_EVENT_FIELD];
int priority;
public:
PdReplacePdiskEvent(char *nodeName, char *location, char *fru,
char *wwn, char *rgName, char *daName,
char *pdName, char *state, int priority);
~PdReplacePdiskEvent() {};
inline char *getNodeName() { return nodeName; }
inline char *getLocation() { return location; }
inline char *getFru() { return fru; }
inline char *getWwn() { return wwn; }
inline char *getRgName() { return rgName; }
inline char *getDaName() { return daName; }
inline char *getPdName() { return pdName; }
inline char *getState() { return state; }
inline int getPriority() { return priority; }
};
/*
* a pDisk has failed
*/
class PdFailedEvent : public Event
{
private:
char nodeName[MAX_EVENT_FIELD];
char location[MAX_EVENT_FIELD];
char fru[MAX_EVENT_FIELD];
char wwn[MAX_EVENT_FIELD]; /* SCSI World Wide Name */
char rgName[MAX_EVENT_FIELD];
char daName[MAX_EVENT_FIELD];
char pdName[MAX_EVENT_FIELD];
char state[MAX_EVENT_FIELD];
public:
PdFailedEvent(char *nodeName, char *location, char *fru, char *wwn,
char *rgName, char *daName, char *pdName, char *state);
~PdFailedEvent() {};
inline char *getNodeName() { return nodeName; }
inline char *getLocation() { return location; }
inline char *getFru() { return fru; }
inline char *getWwn() { return wwn; }
inline char *getRgName() { return rgName; }
inline char *getDaName() { return daName; }
inline char *getPdName() { return pdName; }
inline char *getState() { return state; }
};
/*
* a pDisk has recovered
*/
class PdRecoveredEvent : public Event
{
private:
char nodeName[MAX_EVENT_FIELD];
char location[MAX_EVENT_FIELD];
char fru[MAX_EVENT_FIELD];
char wwn[MAX_EVENT_FIELD]; /* SCSI World Wide Name */
char rgName[MAX_EVENT_FIELD];
char daName[MAX_EVENT_FIELD];
char pdName[MAX_EVENT_FIELD];
public:
PdRecoveredEvent(char *nodeName, char *location, char *fru, char *wwn,
char *rgName, char *daName, char *pdName);
~PdRecoveredEvent() {};
inline char *getNodeName() { return nodeName; }
inline char *getLocation() { return location; }
inline char *getFru() { return fru; }
inline char *getWwn() { return wwn; }
inline char *getRgName() { return rgName; }
inline char *getDaName() { return daName; }
inline char *getPdName() { return pdName; }
};
/*
* pdPathFailed
*/
class PdPathFailedEvent : public Event
{
private:
char nodeName[MAX_EVENT_FIELD];
char location[MAX_EVENT_FIELD];
char fru[MAX_EVENT_FIELD];
char wwn[MAX_EVENT_FIELD]; /* SCSI World Wide Name */
char rgName[MAX_EVENT_FIELD];
char daName[MAX_EVENT_FIELD];
char pdName[MAX_EVENT_FIELD];
char deviceName[MAX_EVENT_FIELD];
public:
PdPathFailedEvent(char *nodeName, char *location, char *fru, char *wwn,
char *rgName, char *daName, char *pdName,
char *deviceName);
~PdPathFailedEvent() {};
inline char *getNodeName() { return nodeName; }
inline char *getLocation() { return location; }
inline char *getFru() { return fru; }
inline char *getWwn() { return wwn; }
inline char *getRgName() { return rgName; }
inline char *getDaName() { return daName; }
inline char *getPdName() { return pdName; }
inline char *getDeviceName(){ return deviceName; }
};
/*
* daRebuildFailed: Decluster Array rebuild failed
*/
class DaRebuildFailedEvent : public Event
{
private:
char nodeName[MAX_EVENT_FIELD];
char rgName[MAX_EVENT_FIELD];
char daName[MAX_EVENT_FIELD];
int remainingRedundancy;
public:
DaRebuildFailedEvent(char *nodeName, char *rgName, char *daName,
int remainingRedundancy);
~DaRebuildFailedEvent() {};
inline char *getNodeName() { return nodeName; }
inline char *getRgName() { return rgName; }
inline char *getDaName() { return daName; }
inline int getRemainingRedundancy() { return remainingRedundancy; }
};
/*
* nsdCksumMismatch: checksum error detected on an NSD RPC transaction
*/
class NsdCksumMismatchEvent : public Event
{
private:
char nodeName[MAX_EVENT_FIELD]; /* reporting node */
char myRole[MAX_EVENT_FIELD]; /* reporting side of the event:
"client" or "server" */
char ckOtherNode[MAX_EVENT_FIELD]; /* address of the other side involved */
char ckNSD[MAX_EVENT_FIELD]; /* NSD name of the NSD/Vdisk in question */
char ckReason[MAX_EVENT_FIELD]; /* reason for checksum error:
"server_detected_error_receiving_for_write" or
"client_detected_error_receiving_on_read" */
Int64 ckStartSector; /* starting sector of the failing transmission */
Int32 ckDataLen; /* data length of the failing transmission */
UInt32 ckErrorCountClient; /* cumulative number of errors for the involved
client since server has begun serving */
UInt32 ckErrorCountServer; /* cumulative number of errors for the server */
UInt32 ckErrorCountNSD; /* cumulative number of errors for the involved
NSD since server has begun serving */
Int32 ckReportingInterval; /* value of the reporting interval at the
time the event was generated */
public:
NsdCksumMismatchEvent(char *nodeName, char *myRole, char *ckOtherNode,
char *ckNSD, char *ckReason,
Int64 ckStartSector, Int32 ckDataLen,
UInt32 ckErrorCountClient, UInt32 ckErrorCountServer,
UInt32 ckErrorCountNSD, Int32 ckReportingInterval);
~NsdCksumMismatchEvent() {};
inline char *getNodeName() { return nodeName; }
inline char *getMyRole() { return myRole; }
inline char *getCkReason() { return ckReason; }
inline char *getCkNSD() { return ckNSD; }
inline char *getCkOtherNode() { return ckOtherNode; }
inline UInt64 getCkStartSector() { return ckStartSector; }
inline Int32 getCkDataLen() { return ckDataLen; }
inline UInt32 getCkErrorCountClient() { return ckErrorCountClient; }
inline UInt32 getCkErrorCountServer() { return ckErrorCountServer; }
inline UInt32 getCkErrorCountNSD() { return ckErrorCountNSD; }
inline Int32 getCkReportingInterval(){ return ckReportingInterval; }
};
/*
* Derived event classes
*/
#define MountEvent MountActionEvent
#define UnmountEvent MountActionEvent
#define AdddiskEvent DiskActionEvent
#define DeldiskEvent DiskActionEvent
#define NodeFailureEvent NodeStatusEvent
#define NodeRecoveryEvent NodeStatusEvent
#define FilesystemCreationEvent FilesystemActionEvent
#define FilesystemDeletionEvent FilesystemActionEvent
#define NewConnectionEvent NodeStatusEvent
#define EventCollectionBufferOverflowEvent NodeStatusEvent
#define MmAdddiskEvent DiskCmdEvent
#define MmDeldiskEvent DiskCmdEvent
/* Description of linked list struct for holding an event */
class EventItem
{
private:
/* Ptr to null-terminated string associated with this object */
char *bufP;
/* Ptr to prev item -or- NULL if front of list */
EventItem *prevP;
/* Ptr to next item -or- NULL if end of list */
EventItem *nextP;
public:
/* Constructor */
EventItem();
/* Destructor */
~EventItem();
/* Access member functions */
void copyBuf(char* _bufP);
inline char* getBufP() const { return bufP; }
inline EventItem* getNextP() const { return nextP; }
/* Given a string as input, duplicate the string and
create an associated linked list descriptor. */
static EventItem* strdup(const char *strP);
/* Append item(s) after this item
which must be current end-of-list. */
void append(EventItem* _nextP);
/* Destroy list */
static void destroyList(EventItem* listP);
};
typedef struct
{
int (*fn)(Event *event, void *data);
void *data;
} CallbackInfo;
#ifndef dfprintf
#define dfprintf if (debug) fprintf
#endif
/* It manages two threads:
1. receiveHandler: It connects to GPFS daemon and listens to events
genereated in GPFS. When an event occurs, it stores this event to list.
2. sendHandler: It extracts an event one by one and invokes callback
function registered with each event type. */
class EventsHandler
{
private:
pthread_t sendThread;
pthread_t receiveThread;
EventItem listAnchor; // nextP points to first in list; prevP always NULL
EventItem* lastInListP; // ptr to last EventItem in list
CallbackInfo eventCallback[MAX_EVENT_CLASSES];
MmpmonWrapperUtils *wrapper;
int debug;
PollingHandler *pollingHandler; // notify polling handler of certain events
int terminate;
/* It sleeps until somebody wakes it up. If it is woken up, it checks if there
are events in list. If there are, it extracts an event one by one,
find out event type and invokes callback function of each event. */
static void *sendHandlerBody(void *arg);
/* It connects to GPFS daemon and listens to events generated in GPFS. If an
event occurs, it stores this event to list and wakes up sendHandler thread. */
static void *receiveHandlerBody(void *arg);
/* Extract an event from list */
char *getEventFromList(char* bufP, const int bufSize);
/* Wake up sendHandler thread */
void wakeSendThread();
/* Wait receiveHandler thread */
void waitReceiveThread();
/* Get event type */
int getEventType(char* response);
/* Create event object of corresponding type */
Event *createEventObject(int type, char *response);
public:
static MErrno init(PollingHandler *pollH, int debg=0);
static void term();
EventsHandler(MErrno *errP, int debg=0);
~EventsHandler();
/* Append an event to list */
void appendEventToList(EventItem* firstItemP, // first item in list to append
EventItem* lastItemP, // last item in list to append
int numItems, // number items being appended
int numBytes); // total bytes being appended
/* Create threads and wait until they finish */
void run();
/* refresh event registration */
void refreshEvents();
/* External management application registers its callback function by invoking
this function. */
void registerEventCallback(int type, int (*callback)(Event *event, void *data), void *callbackData);
MmpmonWrapperUtils *getMmpmonWrapper() { return wrapper; }
};
/* Pointer to EventsHandler object */
extern EventsHandler *theEventsHandler;
/* Callback function which is invoked when we get events. It creates EventItem
object and make it be added to list. */
static int receiveEvent(char *buf, void *data);
#endif /* _h_api_event */

View File

@@ -0,0 +1,422 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* */
/* */
/* Licensed Materials - Property of IBM */
/* */
/* Restricted Materials of IBM */
/* */
/* (C) COPYRIGHT International Business Machines Corp. 2011,2018 */
/* All Rights Reserved */
/* */
/* US Government Users Restricted Rights - Use, duplication or */
/* disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */
/* */
/* IBM_PROLOG_END_TAG */
/* @(#)81 1.8 src/avs/fs/mmfs/ts/mmantras/api_nsdRAID.h, mmfs, avs_rtac502, rtac5021836a 5/27/15 08:13:15 */
#ifndef _h_api_nsdRAID
#define _h_api_nsdRAID
/*
* api_nsdRAID.h
*
* classes:
* gpfsRecoveryGroupSdrInfo
* gpfsRecoveryGroup
* gpfsRecoveryGroupDeclusteredArray
* gpfsDeclusteredArrayVdisk
* gpfsDeclusteredArrayPdisk
* gpfsNsdRAIDConfigParms
* gpfsDeclusteredArrayVdiskIoStats
*
* gpfsRecoveryGroupSdrInfo - portion of NSD RAID recovery group
* information stored in GPFS SDR file.
*
* gpfsRecoveryGroup - GPFS recovery group (RG) information
* -- gpfsRecoveryGroupDeclusteredArray - GPFS declustered array (DA)
* information in a Recovery Group
* --- gpfsDeclusteredArrayVdisk - virtual disk (vdisk) information
* in recovery group RG declustered array DA
* --- gpfsDeclusteredArrayPdisk - physical disk (pdisk) information
* in recovery group RG declustered array DA
*
* gpfsNsdRAIDConfigParms - an array of NSD RAID configuration parameters
* -- gpfsNsdRAIDConfigVar - an NSD RAID configuration parameter
*
* gpfsDeclusteredArrayVdiskIoStats
*
* Externals:
* int getNsdRAIDSdrInfo(gpfsRecoveryGroupSdrInfo *rgSdrTableP,
* int *nRgSdrAllocP);
* int getRecoveryGroupSummary(gpfsRecoveryGroup *rgP);
* int getRecoveryGroupDeclusteredArrays(gpfsRecoveryGroup *rgP);
* int getNsdRAIDParameters(gpfsNsdRAIDConfigParms *configTableP,
* int *nAllocP);
* int gpfsRGDefined();
*/
#define GNRB_MAX_BASENAME 63
#define RAID_NAME_LEN (GNRB_MAX_BASENAME + 1)
#define MAX_DA 16 /* RG_MAX_DECLUSTERED_ARRAYS */
#define STR8_LEN 8
#define STR32_LEN 32
#define STR64_LEN 64
#define STR128_LEN 128
#define PDISK_STATE_LEN 160
#define STATE_STR_LEN STR64_LEN
#define SERVER_LIST_LEN STR128_LEN
#define PATH_LEN STR64_LEN
#define PVID_MAX_CHARS 20 /* defined in GPFS */
/* number of Recovery Group defined in the cluster */
extern int nRGDefined; /* -1 uninitialized, 0 no RG defined */
/*
* gpfsDeclusteredArrayPdisk - description of a pdisk
*/
class gpfsDeclusteredArrayPdisk
{
char gpfsPdiskName[RAID_NAME_LEN]; /* Pdisk Name */
UInt32 gpfsPdiskReplacementPriority; /* replacementPriority
(daCalcReplacementPriorityLocked) */
char gpfsPdiskDevicePath[PATH_LEN]; /* path */
char gpfsPdiskState[PDISK_STATE_LEN];/* State, possible values see:
PdiskState_t::toString() */
UInt64 gpfsPdiskFreeSpace; /* free space bytes */
char gpfsPdiskFru[STR32_LEN]; /* Field Replaceable Unit number */
char gpfsPdiskLocation[STR32_LEN]; /* where the disk is physically located
in the carrier */
public:
gpfsDeclusteredArrayPdisk();
~gpfsDeclusteredArrayPdisk();
void init();
void update(char *pDiskName, int prior, char *path,
char *state, UInt64 freeSpace, char *fru, char *location);
void print_gpfsDeclusteredArrayPdisk(int verbose = 0);
char *getPdiskName() { return gpfsPdiskName; }
UInt32 getPdiskReplacementPriority()
{ return gpfsPdiskReplacementPriority; }
char *getPdiskDevicePath() { return gpfsPdiskDevicePath; }
char *getPdiskState(){ return gpfsPdiskState; }
UInt64 getPdiskFreeSpace() { return gpfsPdiskFreeSpace; }
char *getPdiskFru() { return gpfsPdiskFru; }
char *getPdiskLocation() { return gpfsPdiskLocation; }
};
/*
* gpfsDeclusteredArrayVdiskIoStats - vdisk IO stats
*/
class gpfsDeclusteredArrayVdiskIoStats
{
friend class gpfsDeclusteredArrayVdisk;
UInt64 gpfsVdiskIoStatRead;
UInt64 gpfsVdiskIoStatShortWrite;
UInt64 gpfsVdiskIoStatMediumWrite;
UInt64 gpfsVdiskIoStatFTW;
UInt64 gpfsVdiskIoStatPromotedFTW;
UInt64 gpfsVdiskIoStatFlushedUpdateWrite;
UInt64 gpfsVdiskIoStatFlushedPromotedFTW;
UInt64 gpfsVdiskIoStatMigrate;
UInt64 gpfsVdiskIoStatScrub;
UInt64 gpfsVdiskIoStatLogWrite;
public:
gpfsDeclusteredArrayVdiskIoStats();
~gpfsDeclusteredArrayVdiskIoStats();
void init();
UInt64 getVdiskIoStatRead() { return gpfsVdiskIoStatRead; }
UInt64 getVdiskIoStatShortWrite()
{ return gpfsVdiskIoStatShortWrite; }
UInt64 getVdiskIoStatMediumWrite()
{ return gpfsVdiskIoStatMediumWrite; }
UInt64 getVdiskIoStatFTW() { return gpfsVdiskIoStatFTW; }
UInt64 getVdiskIoStatPromotedFTW()
{ return gpfsVdiskIoStatPromotedFTW; }
UInt64 getVdiskIoStatFlushedUpdateWrite()
{ return gpfsVdiskIoStatFlushedUpdateWrite; }
UInt64 getVdiskIoStatFlushedPromotedFTW()
{ return gpfsVdiskIoStatFlushedPromotedFTW; }
UInt64 getVdiskIoStatMigrate() { return gpfsVdiskIoStatMigrate; }
UInt64 getVdiskIoStatScrub() { return gpfsVdiskIoStatScrub; }
UInt64 getVdiskIoStatLogWrite() { return gpfsVdiskIoStatLogWrite; }
};
/*
* gpfsDeclusteredArrayVdisk - description of a vdisk
*/
class gpfsDeclusteredArrayVdisk
{
friend class gpfsDeclusteredArrayVdiskIoStats;
char gpfsVdiskName[RAID_NAME_LEN]; /* Vdisk name */
char gpfsVdiskRaidCode[STR32_LEN]; /* RaidCode, see ErasureCodeNames[]
"8WayStriping",
"2WayReplication",
"3WayReplication",
"4WayReplication",
"8+2p",
"8+3p" */
UInt32 gpfsVdiskBlockSizeInKiB; /* BlockSizeInKiB */
UInt64 gpfsVdiskSize; /* VdiskSize in bytes */
char gpfsVdiskState[STATE_STR_LEN];/* State, possible values:
"ok", "critical", "offline",
"%d/%d-degraded"
(faultLevel, faultTolerance)*/
char gpfsVdiskRemarks[STR32_LEN]; /* Vidsk remarks, possible values:
"log", "" */
gpfsDeclusteredArrayVdiskIoStats gpfsVdiskIoStats;
public:
gpfsDeclusteredArrayVdisk();
~gpfsDeclusteredArrayVdisk();
void init();
void update(char *vDiskName, char *vDiskRaidCode, int vDiskBlockSizeInKiB,
UInt64 vDiskSize, char *vDiskState, char *vDiskRemarks);
void print_gpfsDeclusteredArrayVdisk(int verbose = 0);
char *getVdiskName() { return gpfsVdiskName; }
char *getVdiskRaidCode() { return gpfsVdiskRaidCode; }
UInt32 getVdiskBlockSizeInKiB() { return gpfsVdiskBlockSizeInKiB; }
UInt64 getVdiskSize() { return gpfsVdiskSize; }
char *getVdiskState() { return gpfsVdiskState; }
char *getVdiskRemarks() { return gpfsVdiskRemarks; }
gpfsDeclusteredArrayVdiskIoStats *getVdiskIoStatsP()
{ return &gpfsVdiskIoStats; }
};
/*
* gpfsRecoveryGroupDeclusteredArray - description of a Declustered Array
*/
class gpfsRecoveryGroupDeclusteredArray
{
friend class gpfsDeclusteredArrayPdisk;
friend class gpfsDeclusteredArrayVdisk;
char gpfsDeclusteredArrayName[RAID_NAME_LEN]; /* declustered array name */
char gpfsDeclusteredArrayNeedsService[STR8_LEN]; /* needs services */
UInt32 gpfsDeclusteredArrayVdisks; /* number of vDisks */
UInt32 gpfsDeclusteredArrayPdisks; /* number of pDisks */
UInt32 gpfsDeclusteredArraySpares; /* Spares */
UInt32 gpfsDeclusteredArrayReplaceThreshold; /* replace threshold */
UInt64 gpfsDeclusteredArrayFreeSpace;
UInt32 gpfsDeclusteredArrayScrubDuration; /* scrub duration in days*/
char gpfsDeclusteredArrayBackgroundTask[STR32_LEN]; /* background task
see: IM_ServiceLevel_tToString()
"inactive"
"rebuild-critical"
"rebuild-1r"
"rebuild-2r"
"rebuild-3r"
"rebuild-offline"
"rebalance"
"scrub1"
"scrub2"
"in-transition"
"metadata"
"error"
"Unknown IM_ServiceLevel_t" */
UInt32 gpfsDeclusteredArrayTaskPercentComplete; /* task percent complete */
char gpfsDeclusteredArrayTaskPrioriy[STR32_LEN];/* task prioriy
"high", "low" */
gpfsDeclusteredArrayPdisk *daPdiskArrayP;/* pointer to
gpfsDeclusteredArrayPdisk Table */
gpfsDeclusteredArrayVdisk *daVdiskArrayP;/* pointer to
gpfsDeclusteredArrayVdisk Table */
public:
gpfsRecoveryGroupDeclusteredArray();
~gpfsRecoveryGroupDeclusteredArray();
void init();
void update(char *daName, char *daNeedsService,
int nDaVdisks, int nDaPdisks, int nDaSpares,
int replaceThr, UInt64 freeSpace, int scrubDuration,
char *bgTaskType, int bgTaskPct, char *priority);
void allocDiskArrays(int nPdisks, int nVdisks);
void deallocDiskArrays();
void print_gpfsDeclusterArray(int verbose = 0);
gpfsDeclusteredArrayPdisk *getDeclusteredArrayPdiskP(int index);
gpfsDeclusteredArrayVdisk *getDeclusteredArrayVdiskP(int index);
char *getDeclusteredArrayName()
{ return gpfsDeclusteredArrayName; }
char *getDeclusteredNeedsService()
{ return gpfsDeclusteredArrayNeedsService; }
UInt32 getDeclusteredArrayVdisks ()
{ return gpfsDeclusteredArrayVdisks; }
UInt32 getDeclusteredArrayPdisks()
{ return gpfsDeclusteredArrayPdisks; }
UInt32 getDeclusteredArraySpares()
{ return gpfsDeclusteredArraySpares; }
UInt32 getDeclusteredArrayReplaceThreshold()
{ return gpfsDeclusteredArrayReplaceThreshold; }
UInt64 getDeclusteredArrayFreeSpace()
{ return gpfsDeclusteredArrayFreeSpace; }
UInt32 getDeclusteredArrayScrubDuration()
{ return gpfsDeclusteredArrayScrubDuration; }
char *getDeclusteredArrayBackgroundTask()
{ return gpfsDeclusteredArrayBackgroundTask; }
UInt32 getDeclusteredArrayTaskPercentComplete()
{ return gpfsDeclusteredArrayTaskPercentComplete; }
char *getDeclusteredArrayTaskPrioriy()
{ return gpfsDeclusteredArrayTaskPrioriy; }
};
/*
* gpfsRecoveryGroup - description of a recovery group
*/
class gpfsRecoveryGroup
{
friend class gpfsRecoveryGroupDeclusteredArray;
char gpfsRecoveryGroupName[RAID_NAME_LEN]; /* RecoveryGroup Name */
char gpfsRecoveryGroupActiveServer[STR64_LEN]; /* active server */
char gpfsRecoveryGroupServers[SERVER_LIST_LEN]; /* primary and backup
servers */
char gpfsRecoveryGroupId[PVID_MAX_CHARS];
UInt32 gpfsRecoveryGroupDeclusterArrays; /* DA with vdisks */
UInt32 gpfsRecoveryGroupVdisks; /* vDdisks */
UInt32 gpfsRecoveryGroupPdisks; /* pDisks */
gpfsRecoveryGroupDeclusteredArray gpfsDeclusteredArray[MAX_DA];
public:
gpfsRecoveryGroup();
~gpfsRecoveryGroup();
void init();
void updateRgSdrInfo(char *rgName, char *serverList, char *rgId);
void updateRgSummary(int nDas, int nVdisks, int nPdisks);
void updateRgServers(char *activeServerP, char *serversP);
void print_gpfsRecoveryGroup(char *banner);
char *getRecoveryGroupName() { return gpfsRecoveryGroupName; };
char *getRecoveryGroupActiveServer()
{ return gpfsRecoveryGroupActiveServer; }
char *getRecoveryGroupServers()
{ return gpfsRecoveryGroupServers; }
char *getRecoveryGroupId()
{ return gpfsRecoveryGroupId; }
UInt32 getRecoveryGroupDeclusterArrays()
{ return gpfsRecoveryGroupDeclusterArrays; }
UInt32 getRecoveryGroupVdisks()
{ return gpfsRecoveryGroupVdisks; }
UInt32 getRecoveryGroupPdisks()
{ return gpfsRecoveryGroupPdisks; }
gpfsRecoveryGroupDeclusteredArray *getRecoveryGroupDeclusterArraysP()
{ return gpfsDeclusteredArray; };
gpfsRecoveryGroupDeclusteredArray *getDeclusteredArrayP(int index);
};
/*
* gpfsRecoveryGroupSdrInfo - NSD RAID information from GPFS SDR
*/
class gpfsRecoveryGroupSdrInfo
{
char gpfsRecoveryGroupName[RAID_NAME_LEN];
char gpfsRecoveryGroupServerList[SERVER_LIST_LEN];
char gpfsRecoveryGroupId[PVID_MAX_CHARS]; /* PVID_MAX_CHARS = 20 */
public:
gpfsRecoveryGroupSdrInfo();
~gpfsRecoveryGroupSdrInfo();
void init();
void update(char *newName, char *newServerList, char *newId);
void print_gpfsRecoveryGroupSdrInfo();
char *getRecoveryGroupName() { return gpfsRecoveryGroupName; };
char *getRecoveryGroupServerList() { return gpfsRecoveryGroupServerList; };
char *getRecoveryGroupId() { return gpfsRecoveryGroupId; };
};
/*
* gpfsNsdRAIDConfigParms - NSD RAID related config parameters/variables
* gpfsNsdRAIDConfigVar - config variable (name and value string)
*/
class gpfsNsdRAIDConfigVar
{
friend class gpfsNsdRAIDConfigParms;
char configVarName[STR64_LEN];
char configVarValueStr[STR64_LEN];
public:
gpfsNsdRAIDConfigVar();
~gpfsNsdRAIDConfigVar();
void init();
char *getNsdRaidConfigVar() { return configVarName; };
char *getNsdRaidConfigValue() { return configVarValueStr; };
};
class gpfsNsdRAIDConfigParms
{
UInt32 nParms; /* num parameters defined */
UInt32 nParmsAlloc; /* maximum allocated array */
gpfsNsdRAIDConfigVar *gpfsNsdRAIDConfigVarTableP;
public:
gpfsNsdRAIDConfigParms(int maxElem);
~gpfsNsdRAIDConfigParms();
int init(int maxElem);
UInt32 getNParms() { return nParms; };
UInt32 getNParmsAlloc() { return nParmsAlloc; };
void setNParms(int nFound) { nParms = nFound; };
void setNParmsAlloc(int nAlloc) { nParmsAlloc = nAlloc; };
int findNsdRAIDConfigParmIndex(char *varName);
void updateNsdRAIDConfigParm(int index, char *varName, char *varValue);
void print_gpfsNsdRAIDConfigParms();
gpfsNsdRAIDConfigVar *getConfigVarP(int index);
};
extern int getNsdRAIDSdrInfo(
gpfsRecoveryGroupSdrInfo *rgSdrTableP, /* buffer */
int *nRgSdrAllocP /* in: size of the buffer
out: num of RGs in this cluster */);
extern int getRecoveryGroupSummary(gpfsRecoveryGroup *rgP);
extern int getRecoveryGroupDeclusteredArrays(gpfsRecoveryGroup *rgP);
extern int getNsdRAIDParameters(gpfsNsdRAIDConfigParms *configTableP,
int *nAllocP);
extern int gpfsRGDefined();
#endif /* _h_api_nsdRAID */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,66 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* */
/* */
/* Licensed Materials - Property of IBM */
/* */
/* Restricted Materials of IBM */
/* */
/* (C) COPYRIGHT International Business Machines Corp. 2010,2018 */
/* All Rights Reserved */
/* */
/* US Government Users Restricted Rights - Use, duplication or */
/* disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */
/* */
/* IBM_PROLOG_END_TAG */
/* @(#)18 1.5 src/avs/fs/mmfs/ts/mmantras/api_types.h, mmfs, avs_rtac502, rtac5021836a 12/22/10 14:55:05 */
#ifndef _h_api_types
#define _h_api_types
/*
* api_types.h
* type definition used in MMANTRAS library
*/
typedef enum
{
M_OK = 0,
M_ERR = 1,
M_RECOVERED = 2
} MErrno;
typedef short Int16;
typedef int Int32;
typedef long long Int64;
typedef unsigned short UInt16;
typedef unsigned int UInt32;
typedef unsigned long long UInt64;
typedef unsigned int Boolean_t;
struct threadUtil
{
UInt32 current;
UInt32 highest;
UInt32 maximum;
};
typedef struct threadUtil threadUtil_t;
struct pCacheCmdInfo
{
UInt32 queuedPcacheCmds;
UInt32 inflightPcacheCmds;
UInt32 completedPcacheCmds;
UInt32 errorPcacheCmds;
UInt32 filteredPcacheCmds;
UInt32 enoentPcacheCmds;
};
typedef struct pCacheCmdInfo pCacheCmdInfo_t;
/* mmantras library debug routine */
extern void ts_print(const char *str);
#endif /* _h_api_types */

View File

@@ -0,0 +1,647 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* */
/* */
/* Licensed Materials - Property of IBM */
/* */
/* Restricted Materials of IBM */
/* */
/* (C) COPYRIGHT International Business Machines Corp. 1997,2018 */
/* All Rights Reserved */
/* */
/* US Government Users Restricted Rights - Use, duplication or */
/* disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */
/* */
/* IBM_PROLOG_END_TAG */
/* @(#)05 1.16 src/avs/fs/mmfs/ts/dm/dmapi.h, mmfs, avs_rtac502, rtac5021836a 11/23/09 18:22:10 */
/*
*
* Define library calls for GPFS DMAPI
*
*/
#ifndef _DMAPI_H
#define _DMAPI_H
#include "dmapi_types.h"
/*
* Function declarations for GPFS DMAPI
*/
#ifdef __cplusplus
extern "C"
{
#endif
extern int dm_clear_inherit(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
dm_attrname_t *attrnamep /* IN */
);
extern int dm_create_by_handle(
dm_sessid_t sid, /* IN */
void *dirhanp, /* IN */
size_t dirhlen, /* IN */
dm_token_t token, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
char *cname /* IN */
);
extern int dm_create_session(
dm_sessid_t oldsid, /* IN */
char *sessinfop, /* IN */
dm_sessid_t *newsidp /* OUT */
);
extern int dm_create_userevent(
dm_sessid_t sid, /* IN */
size_t msglen, /* IN */
void *msgdatap, /* IN */
dm_token_t *tokenp /* OUT */
);
extern int dm_destroy_session(
dm_sessid_t sid /* IN */
);
extern int dm_downgrade_right(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token /* IN */
);
extern int dm_fd_to_handle(
int fd, /* IN */
void **hanpp, /* OUT */
size_t *hlenp /* OUT */
);
extern int dm_find_eventmsg(
dm_sessid_t sid, /* IN */
dm_token_t token, /* IN */
size_t buflen, /* IN */
void *bufp, /* OUT */
size_t *rlenp /* OUT */
);
extern int dm_get_allocinfo(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
dm_off_t *offp, /* IN/OUT */
u_int nelem, /* IN */
dm_extent_t *extentp, /* OUT */
u_int *nelemp /* OUT */
);
extern int dm_get_bulkall(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
u_int mask, /* IN */
dm_attrname_t *attrnamep, /* IN */
dm_attrloc_t *locp, /* IN/OUT */
size_t buflen, /* IN */
void *bufp, /* OUT */
size_t *rlenp /* OUT */
);
extern int dm_get_bulkattr(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
u_int mask, /* IN */
dm_attrloc_t *locp, /* IN/OUT */
size_t buflen, /* IN */
void *bufp, /* OUT */
size_t *rlenp /* OUT */
);
extern int dm_get_config(
void *hanp, /* IN */
size_t hlen, /* IN */
dm_config_t flagname, /* IN */
dm_size_t *retvalp /* OUT */
);
extern int dm_get_config_events(
void *hanp, /* IN */
size_t hlen, /* IN */
u_int nelem, /* IN */
dm_eventset_t *eventsetp, /* OUT */
u_int *nelemp /* OUT */
);
extern int dm_get_dirattrs(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
u_int mask, /* IN */
dm_attrloc_t *locp, /* IN/OUT */
size_t buflen, /* IN */
void *bufp, /* OUT */
size_t *rlenp /* OUT */
);
extern int dm_get_dmattr(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
dm_attrname_t *attrnamep, /* IN */
size_t buflen, /* IN */
void *bufp, /* OUT */
size_t *rlenp /* OUT */
);
extern int dm_get_eventlist(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
u_int nelem, /* IN */
dm_eventset_t *eventsetp, /* OUT */
u_int *nelemp /* OUT */
);
extern int dm_get_events(
dm_sessid_t sid, /* IN */
u_int maxmsgs, /* IN */
u_int flags, /* IN */
size_t buflen, /* IN */
void *bufp, /* OUT */
size_t *rlenp /* OUT */
);
extern int dm_get_fileattr(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
u_int mask, /* IN */
dm_stat_t *statp /* OUT */
);
extern int dm_get_mountinfo(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
size_t buflen, /* IN */
void *bufp, /* OUT */
size_t *rlenp /* OUT */
);
extern int dm_get_region(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
u_int nelem, /* IN */
dm_region_t *regbufp, /* OUT */
u_int *nelemp /* OUT */
);
extern int dm_getall_disp(
dm_sessid_t sid, /* IN */
size_t buflen, /* IN */
void *bufp, /* OUT */
size_t *rlenp /* OUT */
);
extern int dm_getall_dmattr(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
size_t buflen, /* IN */
void *bufp, /* OUT */
size_t *rlenp /* OUT */
);
extern int dm_getall_inherit(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
u_int nelem, /* IN */
dm_inherit_t *inheritbufp, /* OUT */
u_int *nelemp /* OUT */
);
extern int dm_getall_sessions(
u_int nelem, /* IN */
dm_sessid_t *sidbufp, /* OUT */
u_int *nelemp /* OUT */
);
extern int dm_getall_tokens(
dm_sessid_t sid, /* IN */
u_int nelem, /* IN */
dm_token_t *tokenbufp, /* OUT */
u_int *nelemp /* OUT */
);
extern int dm_handle_cmp(
void *hanp1, /* IN */
size_t hlen1, /* IN */
void *hanp2, /* IN */
size_t hlen2 /* IN */
);
extern void dm_handle_free(
void *hanp, /* IN */
size_t hlen /* IN */
);
extern u_int dm_handle_hash(
void *hanp, /* IN */
size_t hlen /* IN */
);
extern dm_boolean_t dm_handle_is_valid(
void *hanp, /* IN */
size_t hlen /* IN */
);
extern int dm_handle_to_fshandle(
void *hanp, /* IN */
size_t hlen, /* IN */
void **fshanpp, /* OUT */
size_t *fslenp /* OUT */
);
extern int dm_handle_to_fsid(
void *hanp, /* IN */
size_t hlen, /* IN */
dm_fsid_t *fsidp /* OUT */
);
extern int dm_handle_to_igen(
void *hanp, /* IN */
size_t hlen, /* IN */
dm_igen_t *igenp /* OUT */
);
extern int dm_handle_to_ino(
void *hanp, /* IN */
size_t hlen, /* IN */
dm_ino_t *inop /* OUT */
);
extern int dm_handle_to_snap(
void *hanp, /* IN */
size_t hlen, /* IN */
dm_snap_t *isnapp /* OUT */
);
extern int dm_handle_to_path(
void *dirhanp, /* IN */
size_t dirhlen1, /* IN */
void *targhanp, /* IN */
size_t targhlen, /* IN */
size_t buflen, /* IN */
char *pathbufp, /* OUT */
size_t *rlenp /* OUT */
);
extern int dm_init_attrloc(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
dm_attrloc_t *locp /* OUT */
);
extern int dm_init_service(
char **versionstrpp /* OUT */
);
extern int dm_make_fshandle(
dm_fsid_t *fsidp, /* IN */
void **hanpp, /* OUT */
size_t *hlenp /* OUT */
);
extern int dm_make_handle(
dm_fsid_t *fsidp, /* IN */
dm_ino_t *inop, /* IN */
dm_igen_t *igenp, /* IN */
void **hanpp, /* OUT */
size_t *hlenp /* OUT */
);
extern int dm_make_xhandle(
dm_fsid_t *fsidp, /* IN */
dm_ino_t *inop, /* IN */
dm_igen_t *igenp, /* IN */
dm_snap_t *isnapp, /* IN */
void **hanpp, /* OUT */
size_t *hlenp /* OUT */
);
extern int dm_mkdir_by_handle(
dm_sessid_t sid, /* IN */
void *dirhanp, /* IN */
size_t dirhlen, /* IN */
dm_token_t token, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
char *cname /* IN */
);
extern int dm_move_event(
dm_sessid_t srcsid, /* IN */
dm_token_t token, /* IN */
dm_sessid_t targetsid, /* IN */
dm_token_t *rtokenp /* OUT */
);
extern int dm_obj_ref_hold(
dm_sessid_t sid, /* IN */
dm_token_t token, /* IN */
void *hanp, /* IN */
size_t hlen /* IN */
);
extern int dm_obj_ref_query(
dm_sessid_t sid, /* IN */
dm_token_t token, /* IN */
void *hanp, /* IN */
size_t hlen /* IN */
);
extern int dm_obj_ref_rele(
dm_sessid_t sid, /* IN */
dm_token_t token, /* IN */
void *hanp, /* IN */
size_t hlen /* IN */
);
extern int dm_path_to_fshandle(
char *path, /* IN */
void **hanpp, /* OUT */
size_t *hlenp /* OUT */
);
extern int dm_path_to_handle(
char *path, /* IN */
void **hanpp, /* OUT */
size_t *hlenp /* OUT */
);
extern int dm_pending(
dm_sessid_t sid, /* IN */
dm_token_t token, /* IN */
dm_timestruct_t *delay /* IN */
);
extern int dm_probe_hole(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
dm_off_t off, /* IN */
dm_size_t len, /* IN */
dm_off_t *roffp, /* OUT */
dm_size_t *rlenp /* OUT */
);
extern int dm_punch_hole(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
dm_off_t off, /* IN */
dm_size_t len /* IN */
);
extern int dm_query_right(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
dm_right_t *rightp /* OUT */
);
extern int dm_query_session(
dm_sessid_t sid, /* IN */
size_t buflen, /* IN */
void *bufp, /* OUT */
size_t *rlenp /* OUT */
);
extern dm_ssize_t dm_read_invis(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
dm_off_t off, /* IN */
dm_size_t len, /* IN */
void *bufp /* OUT */
);
extern int dm_release_right(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token /* IN */
);
extern int dm_remove_dmattr(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
int setdtime, /* IN */
dm_attrname_t *attrnamep /* IN */
);
extern int dm_remove_dmattr_nosync(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
int setdtime, /* IN */
dm_attrname_t *attrnamep /* IN */
);
extern int dm_request_right(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
u_int flags, /* IN */
dm_right_t right /* IN */
);
extern int dm_respond_event(
dm_sessid_t sid, /* IN */
dm_token_t token, /* IN */
dm_response_t response, /* IN */
int reterror, /* IN */
size_t buflen, /* IN */
void *respbufp /* IN */
);
extern int dm_send_msg(
dm_sessid_t targetsid, /* IN */
dm_msgtype_t msgtype, /* IN */
size_t buflen, /* IN */
void *bufp /* IN */
);
extern int dm_set_disp(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
dm_eventset_t *eventsetp, /* IN */
u_int maxevent /* IN */
);
extern int dm_set_dmattr(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
dm_attrname_t *attrnamep, /* IN */
int setdtime, /* IN */
size_t buflen, /* IN */
void *bufp /* IN */
);
extern int dm_set_dmattr_nosync(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
dm_attrname_t *attrnamep, /* IN */
int setdtime, /* IN */
size_t buflen, /* IN */
void *bufp /* IN */
);
extern int dm_set_eventlist(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
dm_eventset_t *eventsetp, /* IN */
u_int maxevent /* IN */
);
extern int dm_set_eventlist_nosync(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
dm_eventset_t *eventsetp, /* IN */
u_int maxevent /* IN */
);
extern int dm_set_fileattr(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
u_int mask, /* IN */
dm_fileattr_t *attrp /* IN */
);
extern int dm_set_inherit(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
dm_attrname_t *attrnamep, /* IN */
mode_t mode /* IN */
);
extern int dm_set_region(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
u_int nelem, /* IN */
dm_region_t *regbufp, /* IN */
dm_boolean_t *exactflagp /* OUT */
);
extern int dm_set_region_nosync(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
u_int nelem, /* IN */
dm_region_t *regbufp, /* IN */
dm_boolean_t *exactflagp /* OUT */
);
extern int dm_set_return_on_destroy(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
dm_attrname_t *attrnamep, /* IN */
dm_boolean_t enable /* IN */
);
extern int dm_symlink_by_handle(
dm_sessid_t sid, /* IN */
void *dirhanp, /* IN */
size_t dirhlen, /* IN */
dm_token_t token, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
char *cname, /* IN */
char *path /* IN */
);
extern int dm_sync_by_handle(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token /* IN */
);
extern int dm_sync_dmattr_by_handle(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token /* IN */
);
extern int dm_upgrade_right(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token /* IN */
);
extern dm_ssize_t dm_write_invis(
dm_sessid_t sid, /* IN */
void *hanp, /* IN */
size_t hlen, /* IN */
dm_token_t token, /* IN */
int flags, /* IN */
dm_off_t off, /* IN */
dm_size_t len, /* IN */
void *bufp /* IN */
);
#ifdef __cplusplus
}
#endif
#endif /* _DMAPI_H */

View File

@@ -0,0 +1,591 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* */
/* */
/* Licensed Materials - Property of IBM */
/* */
/* Restricted Materials of IBM */
/* */
/* (C) COPYRIGHT International Business Machines Corp. 1997,2018 */
/* All Rights Reserved */
/* */
/* US Government Users Restricted Rights - Use, duplication or */
/* disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */
/* */
/* IBM_PROLOG_END_TAG */
/* @(#)06 1.57 src/avs/fs/mmfs/ts/dm/dmapi_types.h, mmfs, avs_rtac502, rtac5021836a 2/17/17 10:31:56 */
/*
*
* Define external types for GPFS DMAPI
*
*/
#ifndef _DMAPI_TYPES_H
#define _DMAPI_TYPES_H
#include <sys/types.h>
/*
* Type definitions for GPFS DMAPI external interfaces
*/
/* Basic scalar types */
typedef int dm_signed32;
typedef unsigned int dm_unsigned32;
typedef long long dm_signed64;
typedef unsigned long long dm_unsigned64;
struct dm_scalar128
{
dm_unsigned64 high;
dm_unsigned64 low;
#ifdef __cplusplus
bool operator == (const dm_scalar128& rhs) const
{ return high == rhs.high && low == rhs.low; };
bool operator != (const dm_scalar128& rhs) const
{ return high != rhs.high || low != rhs.low; };
bool operator < (const dm_scalar128& rhs) const
{ return high < rhs.high || (high == rhs.high && low < rhs.low); };
bool operator > (const dm_scalar128& rhs) const
{ return high > rhs.high || (high == rhs.high && low > rhs.low); };
bool operator <= (const dm_scalar128& rhs) const
{ return high < rhs.high || (high == rhs.high && low <= rhs.low); };
bool operator >= (const dm_scalar128& rhs) const
{ return high > rhs.high || (high == rhs.high && low >= rhs.low); };
#endif /* __cplusplus */
};
typedef struct dm_scalar128 dm_scalar128;
#define DM_SCALAR128_EQ(x, y) (((x).high==(y).high) && ((x).low==(y).low))
#define DM_SCALAR128_NE(x, y) (((x).high!=(y).high) || ((x).low!=(y).low))
#define DM_SCALAR128_LT(x, y) (((x).high<(y).high) || (((x).high==(y).high) && ((x).low<(y).low)))
#define DM_SCALAR128_GT(x, y) (((x).high>(y).high) || (((x).high==(y).high) && ((x).low>(y).low)))
#define DM_SCALAR128_LE(x, y) (((x).high<(y).high) || (((x).high==(y).high) && ((x).low<=(y).low)))
#define DM_SCALAR128_GE(x, y) (((x).high>(y).high) || (((x).high==(y).high) && ((x).low>=(y).low)))
typedef dm_signed64 dm_off_t;
typedef dm_unsigned64 dm_size_t;
typedef dm_signed64 dm_ssize_t;
#ifdef _AIX
typedef ino_t dm_ino_t;
#else
typedef dm_unsigned64 dm_ino_t;
#endif
typedef dm_unsigned64 dm_fsid_t;
typedef dm_unsigned32 dm_igen_t;
typedef dm_unsigned64 dm_snap_t;
#define DM_SNAP_ROOT ((dm_snap_t) 0)
#define DM_SNAP_INVALID ((dm_snap_t) -1)
typedef enum
{
DM_FALSE = 0,
DM_TRUE = 1
} dm_boolean_t;
/* Iterator for a filesystem scan */
typedef dm_signed64 dm_attrloc_t;
/* Variable-length data */
struct dm_vardata
{
int vd_offset;
unsigned int vd_length;
};
typedef struct dm_vardata dm_vardata_t;
/* Interpreters for variable length data */
#define DM_GET_LEN(basePtr, vardataFieldName) \
(((basePtr)->vardataFieldName.vd_offset == 0) ? \
(size_t)DM_INVALID_HLEN : \
(((basePtr)->vardataFieldName.vd_offset == 1) ? \
(size_t)DM_GLOBAL_HLEN : \
((basePtr)->vardataFieldName.vd_length) \
))
/* The prtType parameter in the DM_GET_VALUE() macro is pointer type
(for example "int *"). The value of the macro is a pointer of the give type,
or NULL if the data length (as given by the DM_GET_LEN() macro) is zero. */
#define DM_GET_VALUE(basePtr, vardataFieldName, ptrType) \
(((basePtr)->vardataFieldName.vd_offset == 0) ? \
(ptrType)DM_INVALID_HANP : \
(((basePtr)->vardataFieldName.vd_offset == 1) ? \
(ptrType)DM_GLOBAL_HANP : \
(((basePtr)->vardataFieldName.vd_length == 0) ? \
NULL : \
(ptrType)((char *)(basePtr)+(basePtr)->vardataFieldName.vd_offset)\
)))
/* Iterator for lists of variable length structures */
/* The ptrType parameter in the DM_STEP_TO_NEXT() macro is a pointer type
(for example "dm_attrlist_t *"). The value of the macro is a pointer
of the given type, or NULL if the current element is the last in the list.*/
#define DM_STEP_TO_NEXT(basePtr, ptrType) \
(((basePtr)->_link == 0) ? NULL : \
(ptrType)((char *)(basePtr) + (basePtr)->_link))
#define DM_ATTR_NAME_SIZE 8
/* Name of an extended attribute */
struct dm_attrname
{
u_char an_chars[DM_ATTR_NAME_SIZE];
};
typedef struct dm_attrname dm_attrname_t;
/* Session identifier */
typedef dm_unsigned64 dm_sessid_t;
/* Node identifier */
typedef dm_unsigned32 dm_nodeid_t; /* GPFS Specific - not in XDSM standard */
/* List of extended attributes */
struct dm_attrlist
{
dm_ssize_t _link;
dm_attrname_t al_name;
dm_vardata_t al_data;
};
typedef struct dm_attrlist dm_attrlist_t;
/* Attributes of the GPFS DMAPI implementation */
typedef enum
{
DM_CONFIG_INVALID, /* Lower than any attribute */
DM_CONFIG_BULKALL,
DM_CONFIG_CREATE_BY_HANDLE,
DM_CONFIG_DTIME_OVERLOAD,
DM_CONFIG_LEGACY,
DM_CONFIG_LOCK_UPGRADE,
DM_CONFIG_MAX_ATTR_ON_DESTROY,
DM_CONFIG_MAX_ATTRIBUTE_SIZE,
DM_CONFIG_MAX_HANDLE_SIZE,
DM_CONFIG_MAX_MANAGED_REGIONS,
DM_CONFIG_MAX_MESSAGE_DATA,
DM_CONFIG_OBJ_REF,
DM_CONFIG_PENDING,
DM_CONFIG_PERS_ATTRIBUTES,
DM_CONFIG_PERS_EVENTS,
DM_CONFIG_PERS_INHERIT_ATTRIBS,
DM_CONFIG_PERS_MANAGED_REGIONS,
DM_CONFIG_PUNCH_HOLE,
DM_CONFIG_TOTAL_ATTRIBUTE_SPACE,
DM_CONFIG_WILL_RETRY,
DM_CONFIG_MAX /* GPFS specific - higher than any attribute */
} dm_config_t;
#define DM_CONFIG_LOWEST (DM_CONFIG_INVALID + 1) /* GPFS specific - lowest attribute */
#define DM_CONFIG_HIGHEST (DM_CONFIG_MAX -1) /* GPFS specific - highest attribute */
/* Names of events */
typedef enum
{
DM_EVENT_INVALID, /* Lower than any event */
DM_EVENT_CLOSE,
DM_EVENT_MOUNT,
DM_EVENT_PREUNMOUNT, DM_EVENT_UNMOUNT,
DM_EVENT_NOSPACE,
DM_EVENT_DEBUT,
DM_EVENT_CREATE, DM_EVENT_POSTCREATE,
DM_EVENT_REMOVE, DM_EVENT_POSTREMOVE,
DM_EVENT_RENAME, DM_EVENT_POSTRENAME,
DM_EVENT_SYMLINK, DM_EVENT_POSTSYMLINK,
DM_EVENT_LINK, DM_EVENT_POSTLINK,
DM_EVENT_READ,
DM_EVENT_WRITE,
DM_EVENT_TRUNCATE,
DM_EVENT_ATTRIBUTE,
DM_EVENT_CANCEL,
DM_EVENT_DESTROY,
DM_EVENT_USER,
DM_EVENT_PREPERMCHANGE,
DM_EVENT_POSTPERMCHANGE,
DM_EVENT_DIRECT_READ, /* GPFS specific */
DM_EVENT_MAX /* Higher than any event */
} dm_eventtype_t;
#define DM_EVENT_BASE_MAX DM_EVENT_PREPERMCHANGE
#define DM_EVENT_MAX_POSSIBLE 32
#define DM_EVENT_EXP_COUNT (DM_EVENT_MAX-DM_EVNT_BASE_MAX)
/* Set of events */
typedef dm_unsigned32 dm_eventset_t;
#define DM_EVENT_LOWEST (DM_EVENT_INVALID + 1) /* GPFS specific - lowest event */
#define DM_EVENT_HIGHEST (DM_EVENT_MAX - 1) /* GPFS specific - highest event */
/* Operations on sets of events */
#define DMEV_SET(ev, eset) (((((int) (ev)) >= DM_EVENT_LOWEST) \
&& (((int) (ev)) <= DM_EVENT_HIGHEST)) \
? (eset) |= (((dm_eventset_t) 1) << (((int) (ev)) - 1)) \
: (eset))
#define DMEV_CLR(ev, eset) (((((int) (ev)) >= DM_EVENT_LOWEST) \
&& (((int) (ev)) <= DM_EVENT_HIGHEST)) \
? (eset) &= ~(((dm_eventset_t) 1) << (((int) (ev)) - 1)) \
: (eset))
#define DMEV_ZERO(eset) ((eset) = (dm_eventset_t) DM_EVENT_INVALID)
#define DMEV_ISSET(ev, eset) ((((int) (ev)) >= DM_EVENT_LOWEST) \
&& (((int) (ev)) <= DM_EVENT_HIGHEST) \
&& (((dm_eventset_t) (eset)) & (((dm_eventset_t) 1) << (((int) (ev)) - 1))))
/* GPFS Specific event set operations - not in XDSM standard */
/* Add all events to eset */
#define DMEV_ALL(eset) ((eset) = ~((~((dm_eventset_t) DM_EVENT_INVALID)) << DM_EVENT_HIGHEST))
/* check if eset is empty (contains no events) */
#define DMEV_ISZERO(eset) ((((dm_eventset_t) (eset)) & (~((~((dm_eventset_t) DM_EVENT_INVALID)) << DM_EVENT_HIGHEST))) == (dm_eventset_t) DM_EVENT_INVALID)
/* check if eset contains all events */
#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))
/* Add to eset2 all events of eset1 */
#define DMEV_ADD(eset1, eset2) ((eset2) = ((((dm_eventset_t) (eset1)) | ((dm_eventset_t) (eset2))) & (~((~((dm_eventset_t) DM_EVENT_INVALID)) << DM_EVENT_HIGHEST))))
/* Remove from eset2 all events of eset1 */
#define DMEV_REM(eset1, eset2) ((eset2) = (((dm_eventset_t) (eset2)) & (~((dm_eventset_t) (eset1)))))
/* Restrict eset2 by eset1 (remove from eset2 any event that is not in eset1) */
#define DMEV_RES(eset1, eset2) ((eset2) = ((((dm_eventset_t) (eset1)) & ((dm_eventset_t) (eset2))) & (~((~((dm_eventset_t) DM_EVENT_INVALID)) << DM_EVENT_HIGHEST))))
/* Check if eset1 and eset2 are equal (have the same events) */
#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))))
/* Check if eset1 and eset2 are disjoint (have no events in common) */
#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)
/* Check if eset1 is a subset of eset2 (all events of eset1 are in eset2) */
#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))))
/* Normalize the contents of eset (unused bits in the mask are cleared).
Useful if eset was not obtained entirely by means of DMEV_XXX() macros*/
#define DMEV_NORM(eset) ((eset) = (((dm_eventset_t)(eset)) & (~((~((dm_eventset_t) DM_EVENT_INVALID)) << DM_EVENT_HIGHEST))))
/* Extent types */
typedef enum
{
DM_EXTENT_INVALID,
DM_EXTENT_RES,
DM_EXTENT_HOLE
} dm_extenttype_t;
struct dm_extent
{
dm_extenttype_t ex_type;
dm_signed32 ex_pad_to_dword; /* dm_off_t is 64b, need to pad */
dm_off_t ex_offset;
dm_size_t ex_length;
};
typedef struct dm_extent dm_extent_t;
/* Disposition information */
struct dm_dispinfo
{
dm_ssize_t _link;
dm_vardata_t di_fshandle;
dm_eventset_t di_eventset;
};
typedef struct dm_dispinfo dm_dispinfo_t;
typedef dm_scalar128 dm_token_t;
/* Comparison macros for tokens - GPFS specific - not in XDSM standard */
#define DM_TOKEN_EQ(x, y) DM_SCALAR128_EQ(x, y)
#define DM_TOKEN_NE(x, y) DM_SCALAR128_NE(x, y)
#define DM_TOKEN_LT(x, y) DM_SCALAR128_LT(x, y)
#define DM_TOKEN_GT(x, y) DM_SCALAR128_GT(x, y)
#define DM_TOKEN_LE(x, y) DM_SCALAR128_LE(x, y)
#define DM_TOKEN_GE(x, y) DM_SCALAR128_GE(x, y)
/* Sequence number for event cancellation */
typedef dm_scalar128 dm_sequence_t;
/* Comparison macros for sequence numbers - GPFS specific - not in XDSM standard */
#define DM_SEQUENCE_EQ(x, y) DM_SCALAR128_EQ(x, y)
#define DM_SEQUENCE_NE(x, y) DM_SCALAR128_NE(x, y)
#define DM_SEQUENCE_LT(x, y) DM_SCALAR128_LT(x, y)
#define DM_SEQUENCE_GT(x, y) DM_SCALAR128_GT(x, y)
#define DM_SEQUENCE_LE(x, y) DM_SCALAR128_LE(x, y)
#define DM_SEQUENCE_GE(x, y) DM_SCALAR128_GE(x, y)
/* Event message header */
struct dm_eventmsg
{
dm_ssize_t _link;
dm_eventtype_t ev_type;
dm_token_t ev_token;
dm_sequence_t ev_sequence;
dm_nodeid_t ev_nodeid; /* GPFS specific - not in XDSM standard */
dm_vardata_t ev_data;
};
typedef struct dm_eventmsg dm_eventmsg_t;
/* Cancel event message */
struct dm_cancel_event
{
dm_sequence_t ce_sequence;
dm_token_t ce_token;
};
typedef struct dm_cancel_event dm_cancel_event_t;
/* Data event message */
struct dm_data_event
{
dm_vardata_t de_handle;
dm_off_t de_offset;
dm_size_t de_length;
};
typedef struct dm_data_event dm_data_event_t;
/* Destroy event message */
struct dm_destroy_event
{
dm_vardata_t ds_handle;
dm_attrname_t ds_attrname;
dm_vardata_t ds_attrcopy;
};
typedef struct dm_destroy_event dm_destroy_event_t;
/* Mount event message */
struct dm_mount_event
{
mode_t me_mode;
dm_vardata_t me_handle1;
dm_vardata_t me_handle2;
dm_vardata_t me_name1;
dm_vardata_t me_name2;
dm_vardata_t me_roothandle;
};
typedef struct dm_mount_event dm_mount_event_t;
/* Namespace event message */
struct dm_namesp_event
{
mode_t ne_mode;
dm_vardata_t ne_handle1;
dm_vardata_t ne_handle2;
dm_vardata_t ne_name1;
dm_vardata_t ne_name2;
int ne_retcode;
};
typedef struct dm_namesp_event dm_namesp_event_t;
/* Flags for the mode field of mount, preunmount and unmount event messages */
#define DM_MOUNT_RDONLY (0x1)
#define DM_UNMOUNT_FORCE (0x2)
#define DM_LOCAL_MOUNT (0x4) /* GPFS specific - not in XDSM standard */
#define DM_REMOTE_MOUNT (0x8) /* GPFS specific - not in XDSM standard */
struct dm_timestruct
{
time_t dm_tv_sec;
dm_signed32 dm_tv_nsec;
};
typedef struct dm_timestruct dm_timestruct_t;
/* DMAPI file attributes */
struct dm_fileattr
{
mode_t fa_mode;
uid_t fa_uid;
gid_t fa_gid;
time_t fa_atime;
time_t fa_mtime;
time_t fa_ctime;
time_t fa_dtime;
dm_off_t fa_size;
};
typedef struct dm_fileattr dm_fileattr_t;
struct dm_fileattr32
{
mode_t fa_mode;
uid_t fa_uid;
gid_t fa_gid;
dm_signed32 fa_atime;
dm_signed32 fa_mtime;
dm_signed32 fa_ctime;
dm_signed32 fa_dtime;
dm_off_t fa_size;
};
typedef struct dm_fileattr32 dm_fileattr32_t;
struct dm_fileattr64
{
mode_t fa_mode;
#if defined(__sun)
u_int fa_uid;
u_int fa_gid;
#else
uid_t fa_uid;
gid_t fa_gid;
#endif
dm_signed32 fa_pad_to_dword;
dm_signed64 fa_atime;
dm_signed64 fa_mtime;
dm_signed64 fa_ctime;
dm_signed64 fa_dtime;
dm_off_t fa_size;
};
typedef struct dm_fileattr64 dm_fileattr64_t;
/* Message types for user events */
typedef enum
{
DM_MSGTYPE_INVALID,
DM_MSGTYPE_SYNC,
DM_MSGTYPE_ASYNC
} dm_msgtype_t;
/* Region descriptor */
struct dm_region
{
dm_off_t rg_offset;
dm_size_t rg_size;
u_int rg_flags;
dm_signed32 rg_opaque; /* GPFS specific - not in XDSM standard */
};
typedef struct dm_region dm_region_t;
#define DM_REGION_NOEVENT (0x0)
#define DM_REGION_READ (0x1)
#define DM_REGION_WRITE (0x2)
#define DM_REGION_TRUNCATE (0x4)
#define DM_REGION_DIRECT_READ (0x8) /* GPFS specific - read without recall */
/* Responses for dm_respond_event() */
typedef enum
{
DM_RESP_INVALID,
DM_RESP_CONTINUE,
DM_RESP_ABORT,
DM_RESP_DONTCARE
} dm_response_t;
/* Access rights */
typedef enum
{
DM_RIGHT_NULL,
DM_RIGHT_SHARED,
DM_RIGHT_EXCL
} dm_right_t;
/* Status information */
struct dm_stat
{
dm_ssize_t _link;
dm_vardata_t dt_handle;
dm_vardata_t dt_compname;
dm_eventset_t dt_emask;
int dt_nevents;
int dt_pers;
int dt_pmanreg;
time_t dt_dtime;
u_int dt_change;
dev_t dt_dev;
dm_ino_t dt_ino;
mode_t dt_mode;
nlink_t dt_nlink;
uid_t dt_uid;
gid_t dt_gid;
dev_t dt_rdev;
dm_off_t dt_size;
time_t dt_atime;
time_t dt_mtime;
time_t dt_ctime;
u_int dt_blksize;
dm_size_t dt_blocks;
int dt_gpfsqa1; /* GPFS specific - not in XDSM standard */
int dt_gpfsqa2; /* GPFS specific - not in XDSM standard */
u_int dt_poolid; /* GPFS specific - not in XDSM standard */
int dt_fopen; /* GPFS specific - not in XDSM standard */
};
typedef struct dm_stat dm_stat_t;
/* File attribute masks */
#define DM_AT_ATIME (0x0001)
#define DM_AT_CFLAG (0x0002)
#define DM_AT_CTIME (0x0004)
#define DM_AT_DTIME (0x0008)
#define DM_AT_EMASK (0x0010)
#define DM_AT_GID (0x0020)
#define DM_AT_HANDLE (0x0040)
#define DM_AT_MODE (0x0080)
#define DM_AT_MTIME (0x0100)
#define DM_AT_PATTR (0x0200)
#define DM_AT_PMANR (0x0400)
#define DM_AT_SIZE (0x0800)
#define DM_AT_STAT (0x1000)
#define DM_AT_UID (0x2000)
#define DM_AT_FOPEN (0x4000) /* Is the file open elsewhere?
Only valid on dm_get_fileattr */
struct dm_xstat
{
dm_ssize_t _link;
dm_stat_t dx_statinfo;
dm_vardata_t dx_attrdata;
};
typedef struct dm_xstat dm_xstat_t;
/* Max size of a session label */
#define DM_SESSION_INFO_LEN 256
/* Special session identifier */
#define DM_NO_SESSION ((dm_sessid_t) 0)
/* Flag indicating whether to wait in dm_get_events */
#define DM_EV_WAIT (0x1)
/* Flag indicating whether to wait in dm_request_right */
#define DM_RR_WAIT (0x1)
/* Flag indicating whether the request right call is from panache eviction */
#define DM_PCACHE_EVICT (0x10)
/* Special file handles */
#define DM_GLOBAL_HANP ((void *)(size_t)0xFFFFFFFD)
#define DM_GLOBAL_HLEN ((size_t)0)
#define DM_INVALID_HANP ((void *)(size_t)0xFFFFFFFF)
#define DM_INVALID_HLEN ((size_t)0)
/* Special tokens */
static const dm_token_t _dmNoToken = { 0, 0 };
#define DM_NO_TOKEN _dmNoToken
static const dm_token_t _dmInvalidToken = { 0, 1 };
#define DM_INVALID_TOKEN _dmInvalidToken
/* Flag for the dm_write_invis() call */
#define DM_WRITE_SYNC (0x1)
/* Version identifier
Warning: Do not change this version number unless coordinated with
external callers, for example TSM, of GPFS dmapi library.
*/
#define DM_VER_STR_CONTENTS "GPFS DMAPI 4.10"
struct dm_inherit
{
dm_attrname_t ih_name;
mode_t ih_filetype;
};
typedef struct dm_inherit dm_inherit_t;
#endif /* _DMAPI_TYPES_H */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,131 @@
/* */
/* Copyright (C) 2001 International Business Machines */
/* All rights reserved. */
/* */
/* This file is part of the GPFS user library. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions */
/* are met: */
/* */
/* 1. Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* 2. Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* 3. The name of the author may not be used to endorse or promote products */
/* derived from this software without specific prior written */
/* permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR */
/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES */
/* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. */
/* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, */
/* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; */
/* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, */
/* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF */
/* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* */
/* @(#)69 1.9 src/avs/fs/mmfs/ts/util/gpfs_lwe.h, mmfs, avs_rtac502, rtac5021836a 1/18/17 17:22:53 */
/*
* Library calls for GPFS interfaces
*/
#ifndef H_GPFS_LWE
#define H_GPFS_LWE
#ifdef __cplusplus
extern "C" {
#endif
static const char LWE_JSON[] =
"{\"type\":\"record\",\
\"name\":\"LWE\",\
\"fields\":[\
{\"name\": \"fsName\", \"type\": \"string\"},\
{\"name\": \"event\", \"type\": \"string\"},\
{\"name\": \"pathName\", \"type\": \"string\"},\
{\"name\": \"pathNewName\", \"type\": \"string\"},\
{\"name\": \"URL\", \"type\": \"string\"},\
{\"name\": \"inode\", \"type\": \"long\"},\
{\"name\": \"openFlags\", \"type\": \"string\"},\
{\"name\": \"poolName\", \"type\": \"string\"},\
{\"name\": \"fileSize\", \"type\": \"long\"},\
{\"name\": \"ownerUserId\", \"type\": \"int\"},\
{\"name\": \"ownerGroupId\", \"type\": \"int\"},\
{\"name\": \"atime\", \"type\": \"string\"},\
{\"name\": \"mtime\", \"type\": \"string\"},\
{\"name\": \"nowTime\", \"type\": \"string\"},\
{\"name\": \"elapsedTime\", \"type\": \"string\"},\
{\"name\": \"clientUserId\", \"type\": \"string\"},\
{\"name\": \"clientGroupId\", \"type\": \"string\"},\
{\"name\": \"clientIp\", \"type\": \"string\"},\
{\"name\": \"processId\", \"type\": \"int\"}\
{\"name\": \"targetPoolName\", \"type\": \"string\"},\
{\"name\": \"bytesRead\", \"type\": \"long\"},\
{\"name\": \"bytesWritten\", \"type\": \"long\"},\
{\"name\": \"clusterName\", \"type\": \"string\"},\
{\"name\": \"nodeName\", \"type\": \"string\"},\
]}";
#define GPFS_DEVNAMEX "/dev/ss0" /* Must be the same as GPFS_DEVNAME */
#define kLWEvent 169 /* Must be the same as LWEvent in enum kxOps */
#define LWE_MAX_FIELD 256
#define LWE_UPDATE 201
typedef long long Int64_t;
struct lweHeader
{
int lwe_version; /* in/out */
int lwe_fd; /* in */
int lwe_sync; /* in: sync request */
int lwe_event; /* in: events requeste */
/* out: event returned */
int lwe_data; /* in: data requested */
/* out: data returned */
int lwe_rc; /* out for all the rest */
int lwe_seq; /* Event sequence number */
};
struct lweAttr
{
struct lweHeader lweHdr;
Int64_t lwe_inode;
int lwe_oiOpenFlags; /* Original value of open flags */
/* Original credentials when the file was opened */
int lwe_userId;
int lwe_groupId;
int lwe_processId;
int lwe_ownerUserId;
int lwe_ownerGroupId;
Int64_t lwe_fileSize;
Int64_t lwe_bytesRead;
Int64_t lwe_bytesWritten;
Int64_t lwe_elapsedTime;
struct timespec lwe_atime;
struct timespec lwe_mtime;
struct timespec lwe_nowTime;
int lwe_plen;
int lwe_plen2;
char lwe_fsName[LWE_MAX_FIELD+1];
char lwe_NFS_IP[NFS_IP_SIZE+1];
char lwe_poolName[LWE_MAX_FIELD+1];
char lwe_targetPoolName[LWE_MAX_FIELD+1];
char lwe_clusterName[LWE_MAX_FIELD+1];
char lwe_nodeName[LWE_MAX_FIELD+1];
/* keep path at the end */
char lwe_path[PATH_MAX+1];
char lwe_path2[PATH_MAX+1];
};
#define LWE_ONE_PATH (sizeof(struct lweAttr)-PATH_MAX)
#define LWE_NO_PATH (sizeof(struct lweAttr)-(PATH_MAX*2))
#ifdef __cplusplus
}
#endif
#endif /* H_GPFS_LWE */

View File

@@ -0,0 +1,60 @@
/* */
/* Copyright (C) 2001 International Business Machines */
/* All rights reserved. */
/* */
/* This file is part of the GPFS user library. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions */
/* are met: */
/* */
/* 1. Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* 2. Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* 3. The name of the author may not be used to endorse or promote products */
/* derived from this software without specific prior written */
/* permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR */
/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES */
/* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. */
/* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, */
/* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; */
/* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, */
/* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF */
/* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* */
/* @(#)39 1.11 src/avs/fs/mmfs/ts/util/gpfs_lweTypes.h, mmfs, avs_rtac502, rtac5021836a 2/14/17 13:21:48 */
#ifndef _h_lwe_types
#define _h_lwe_types
/*
*
* The content of this file has been moved to /usr/lpp/mmfs/include/gpfs.h
* with new naming convention as list below
* and the use of this file is deprected.
/*
* lwe_eventtype_t -> gpfs_lwe_eventtype_t
* lwe_resp_t -> gpfs_lwe_resp_t
* lwe_sessid_t -> gpfs_lwe_sessid_t
* lwe_token_t -> gpfs_lwe_token_t
* lwe_event_t -> gpfs_lwe_event_t
* _gpfsLweNoToken -> gpfs_lwe_no_token
* LWE_NO_TOKEN -> GPFS_LWE_NO_TOKEN
* _gpfsLweInvalidToken -> _gpfs_lwe_invalid_token
* LWE_INVALID_TOKEN -> GPFS_LWE_INVALID_TOKEN
*/
#define MAX_LWESESSION_INFO_LEN 100
#define LWE_NO_SESSION 0
#define LWE_EV_WAIT 0
#define LWE_EV_NOWAIT 1
#endif /* _h_lwe_types */

View File

@@ -0,0 +1,746 @@
/* */
/* Copyright (C) 2001 International Business Machines */
/* All rights reserved. */
/* */
/* This file is part of the GPFS user library. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions */
/* are met: */
/* */
/* 1. Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* 2. Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* 3. The name of the author may not be used to endorse or promote products */
/* derived from this software without specific prior written */
/* permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR */
/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES */
/* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. */
/* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, */
/* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; */
/* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, */
/* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF */
/* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* */
/* @(#)83 1.75 src/avs/fs/mmfs/ts/util/gpfs_nfs.h, mmfs, avs_rtac502, rtac5021836a 1/6/17 08:59:35 */
/*
* Library calls for GPFS interfaces
*/
#ifndef H_GPFS_NFS
#define H_GPFS_NFS
#ifdef __cplusplus
extern "C" {
#endif
#ifdef WIN32
struct flock
{};
#endif
/* GANESHA common information */
#define GPFS_DEVNAMEX "/dev/ss0" /* Must be the same as GPFS_DEVNAME */
#define kGanesha 140 /* Must be the same as Ganesha in enum kxOps */
#define OPENHANDLE_GET_VERSION 100
#define OPENHANDLE_GET_VERSION2 1002
#define OPENHANDLE_NAME_TO_HANDLE 101
#define OPENHANDLE_OPEN_BY_HANDLE 102
#define OPENHANDLE_LAYOUT_TYPE 106
#define OPENHANDLE_GET_DEVICEINFO 107
#define OPENHANDLE_GET_DEVICELIST 108
#define OPENHANDLE_LAYOUT_GET 109
#define OPENHANDLE_LAYOUT_RETURN 110
#define OPENHANDLE_INODE_UPDATE 111
#define OPENHANDLE_GET_XSTAT 112
#define OPENHANDLE_SET_XSTAT 113
#define OPENHANDLE_CHECK_ACCESS 114
#define OPENHANDLE_OPEN_SHARE_BY_HANDLE 115
#define OPENHANDLE_GET_LOCK 116
#define OPENHANDLE_SET_LOCK 117
#define OPENHANDLE_THREAD_UPDATE 118
#define OPENHANDLE_LAYOUT_COMMIT 119
#define OPENHANDLE_DS_READ 120
#define OPENHANDLE_DS_WRITE 121
#define OPENHANDLE_GET_VERIFIER 122
#define OPENHANDLE_FSYNC 123
#define OPENHANDLE_SHARE_RESERVE 124
#define OPENHANDLE_GET_NODEID 125
#define OPENHANDLE_SET_DELEGATION 126
#define OPENHANDLE_CLOSE_FILE 127
#define OPENHANDLE_LINK_BY_FH 128
#define OPENHANDLE_RENAME_BY_FH 129
#define OPENHANDLE_STAT_BY_NAME 130
#define OPENHANDLE_GET_HANDLE 131
#define OPENHANDLE_READLINK_BY_FH 132
#define OPENHANDLE_UNLINK_BY_NAME 133
#define OPENHANDLE_CREATE_BY_NAME 134
#define OPENHANDLE_READ_BY_FD 135
#define OPENHANDLE_WRITE_BY_FD 136
#define OPENHANDLE_CREATE_BY_NAME_ATTR 137
#define OPENHANDLE_GRACE_PERIOD 138
#define OPENHANDLE_ALLOCATE_BY_FD 139
#define OPENHANDLE_REOPEN_BY_FD 140
#define OPENHANDLE_FADVISE_BY_FD 141
#define OPENHANDLE_SEEK_BY_FD 142
#define OPENHANDLE_STATFS_BY_FH 143
#define OPENHANDLE_GETXATTRS 144
#define OPENHANDLE_SETXATTRS 145
#define OPENHANDLE_REMOVEXATTRS 146
#define OPENHANDLE_LISTXATTRS 147
#define OPENHANDLE_MKNODE_BY_NAME 148
#define OPENHANDLE_reserved 149
#define OPENHANDLE_TRACE_ME 150
#define OPENHANDLE_QUOTA 151
#define OPENHANDLE_FS_LOCATIONS 152
struct trace_arg
{
uint32_t level;
uint32_t len;
char *str;
};
#define ganesha_v1 1
#define ganesha_v2 2
int gpfs_ganesha(int op, void *oarg);
#define OPENHANDLE_HANDLE_LEN 40
#define OPENHANDLE_KEY_LEN 28
#define OPENHANDLE_VERSION 2
struct xstat_cred_t
{
uint32_t principal; /* user id */
uint32_t group; /* primary group id */
uint16_t num_groups; /* number secondary groups for this user */
#define XSTAT_CRED_NGROUPS 32
uint32_t eGroups[XSTAT_CRED_NGROUPS];/* array of secondary groups */
};
struct gpfs_time_t
{
uint32_t t_sec;
uint32_t t_nsec;
};
struct gpfs_file_handle
{
uint16_t handle_size;
uint16_t handle_type;
uint16_t handle_version;
uint16_t handle_key_size;
uint32_t handle_fsid[2];
/* file identifier */
unsigned char f_handle[OPENHANDLE_HANDLE_LEN];
};
struct name_handle_arg
{
int dfd;
int flag;
const char *name;
struct gpfs_file_handle *handle;
int expfd;
};
struct get_handle_arg
{
int mountdirfd;
int len;
const char *name;
struct gpfs_file_handle *dir_fh;
struct gpfs_file_handle *out_fh;
};
struct open_arg
{
int mountdirfd;
int flags;
int openfd;
struct gpfs_file_handle *handle;
const char *cli_ip;
};
struct link_fh_arg
{
int mountdirfd;
int len;
const char *name;
struct gpfs_file_handle *dir_fh;
struct gpfs_file_handle *dst_fh;
};
struct rename_fh_arg
{
int mountdirfd;
int old_len;
const char *old_name;
int new_len;
const char *new_name;
struct gpfs_file_handle *old_fh;
struct gpfs_file_handle *new_fh;
};
struct glock
{
int cmd;
int lfd;
void *lock_owner;
struct flock flock;
};
#define GPFS_F_CANCELLK (1024 + 5) /* Maps to Linux F_CANCELLK */
#define FL_RECLAIM 4
#define EGRACE 140
struct set_get_lock_arg
{
int mountdirfd;
struct glock *lock;
int reclaim;
};
struct open_share_arg
{
int mountdirfd;
int flags;
int openfd;
struct gpfs_file_handle *handle;
int share_access;
int share_deny;
int reclaim;
};
struct share_reserve_arg
{
int mountdirfd;
int openfd;
int share_access;
int share_deny;
};
struct fadvise_arg
{
int mountdirfd;
int openfd;
uint64_t offset;
uint64_t length;
uint32_t *hints;
};
struct gpfs_io_info {
uint32_t io_what;
uint64_t io_offset;
uint64_t io_len;
uint32_t io_eof;
uint32_t io_alloc;
};
struct fseek_arg
{
int mountdirfd;
int openfd;
struct gpfs_io_info *info;
};
struct close_file_arg
{
int mountdirfd;
int close_fd;
int close_flags;
void *close_owner;
};
struct link_arg
{
int file_fd;
int dir_fd;
const char *name;
};
struct readlink_arg
{
int fd;
char *buffer;
int size;
};
struct readlink_fh_arg
{
int mountdirfd;
struct gpfs_file_handle *handle;
char *buffer;
int size;
};
struct nfsd4_pnfs_deviceid {
/** FSAL_ID - to dispatch getdeviceinfo based on */
uint8_t fsal_id;
/** Break up the remainder into useful chunks */
uint8_t device_id1;
uint16_t device_id2;
uint32_t device_id4;
uint64_t devid;
};
struct gpfs_exp_xdr_stream {
int *p;
int *end;
};
enum x_nfsd_fsid {
x_FSID_DEV = 0,
x_FSID_NUM,
x_FSID_MAJOR_MINOR,
x_FSID_ENCODE_DEV,
x_FSID_UUID4_INUM,
x_FSID_UUID8,
x_FSID_UUID16,
x_FSID_UUID16_INUM,
x_FSID_MAX
};
enum x_pnfs_layouttype {
x_LAYOUT_NFSV4_1_FILES = 1,
x_LAYOUT_OSD2_OBJECTS = 2,
x_LAYOUT_BLOCK_VOLUME = 3,
x_NFS4_PNFS_PRIVATE_LAYOUT = 0x80000000
};
/* used for both layout return and recall */
enum x_pnfs_layoutreturn_type {
x_RETURN_FILE = 1,
x_RETURN_FSID = 2,
x_RETURN_ALL = 3
};
enum x_pnfs_iomode {
x_IOMODE_READ = 1,
x_IOMODE_RW = 2,
x_IOMODE_ANY = 3,
};
enum stable_nfs
{
x_UNSTABLE4 = 0,
x_DATA_SYNC4 = 1,
x_FILE_SYNC4 = 2
};
struct pnfstime4 {
uint64_t seconds;
uint32_t nseconds;
};
struct nfsd4_pnfs_dev_iter_res {
uint64_t gd_cookie; /* request/repsonse */
uint64_t gd_verf; /* request/repsonse */
uint64_t gd_devid; /* response */
uint32_t gd_eof; /* response */
};
/* Arguments for set_device_notify */
struct pnfs_devnotify_arg {
struct nfsd4_pnfs_deviceid dn_devid; /* request */
uint32_t dn_layout_type; /* request */
uint32_t dn_notify_types; /* request/response */
};
struct nfsd4_layout_seg {
uint64_t clientid;
uint32_t layout_type;
uint32_t iomode;
uint64_t offset;
uint64_t length;
};
struct nfsd4_pnfs_layoutget_arg {
uint64_t lg_minlength;
uint64_t lg_sbid;
struct gpfs_file_handle *lg_fh;
uint32_t lg_iomode;
};
struct nfsd4_pnfs_layoutget_res {
struct nfsd4_layout_seg lg_seg; /* request/resopnse */
uint32_t lg_return_on_close;
};
struct nfsd4_pnfs_layoutcommit_arg {
struct nfsd4_layout_seg lc_seg; /* request */
uint32_t lc_reclaim; /* request */
uint32_t lc_newoffset; /* request */
uint64_t lc_last_wr; /* request */
struct pnfstime4 lc_mtime; /* request */
uint32_t lc_up_len; /* layout length */
void *lc_up_layout; /* decoded by callback */
};
struct nfsd4_pnfs_layoutcommit_res {
uint32_t lc_size_chg; /* boolean for response */
uint64_t lc_newsize; /* response */
};
struct nfsd4_pnfs_layoutreturn_arg {
uint32_t lr_return_type; /* request */
struct nfsd4_layout_seg lr_seg; /* request */
uint32_t lr_reclaim; /* request */
uint32_t lrf_body_len; /* request */
void *lrf_body; /* request */
void *lr_cookie; /* fs private */
};
struct x_xdr_netobj {
unsigned int len;
unsigned char *data;
};
struct pnfs_filelayout_devaddr {
struct x_xdr_netobj r_netid;
struct x_xdr_netobj r_addr;
};
/* list of multipath servers */
struct pnfs_filelayout_multipath {
uint32_t fl_multipath_length;
struct pnfs_filelayout_devaddr *fl_multipath_list;
};
struct pnfs_filelayout_device {
uint32_t fl_stripeindices_length;
uint32_t *fl_stripeindices_list;
uint32_t fl_device_length;
struct pnfs_filelayout_multipath *fl_device_list;
};
struct pnfs_filelayout_layout {
uint32_t lg_layout_type; /* response */
uint32_t lg_stripe_type; /* response */
uint32_t lg_commit_through_mds; /* response */
uint64_t lg_stripe_unit; /* response */
uint64_t lg_pattern_offset; /* response */
uint32_t lg_first_stripe_index; /* response */
struct nfsd4_pnfs_deviceid device_id; /* response */
uint32_t lg_fh_length; /* response */
struct gpfs_file_handle *lg_fh_list; /* response */
};
enum stripetype4 {
STRIPE_SPARSE = 1,
STRIPE_DENSE = 2
};
struct deviceinfo_arg
{
int mountdirfd;
int type;
struct nfsd4_pnfs_deviceid devid;
struct gpfs_exp_xdr_stream xdr;
};
struct layoutget_arg
{
int fd;
struct gpfs_file_handle *handle;
struct nfsd4_pnfs_layoutget_arg args;
struct pnfs_filelayout_layout *file_layout;
struct gpfs_exp_xdr_stream *xdr;
};
struct layoutreturn_arg
{
int mountdirfd;
struct gpfs_file_handle *handle;
struct nfsd4_pnfs_layoutreturn_arg args;
};
struct dsread_arg
{
int mountdirfd;
struct gpfs_file_handle *handle;
char *bufP;
uint64_t offset;
uint64_t length;
uint64_t *filesize;
int options;
};
/* define flags for options */
#define IO_SKIP_HOLE (1 << 0) /* 01 */
#define IO_SKIP_DATA (1 << 1) /* 02 */
#define IO_ALLOCATE (1 << 2) /* 04 */
#define IO_DEALLOCATE (1 << 3) /* 08 */
struct dswrite_arg
{
int mountdirfd;
struct gpfs_file_handle *handle;
char *bufP;
uint64_t offset;
uint64_t length;
uint32_t stability_wanted;
uint32_t *stability_got;
uint32_t *verifier4;
int options;
};
struct read_arg
{
int mountdirfd;
int fd;
char *bufP;
uint64_t offset;
uint64_t length;
uint32_t stability_wanted;
uint32_t *stability_got;
uint32_t *verifier4;
int options;
};
struct write_arg
{
int mountdirfd;
int fd;
char *bufP;
uint64_t offset;
uint64_t length;
uint32_t stability_wanted;
uint32_t *stability_got;
uint32_t *verifier4;
int options;
};
struct alloc_arg
{
int fd;
uint64_t offset;
uint64_t length;
int options;
};
struct layoutcommit_arg
{
int mountdirfd;
struct gpfs_file_handle *handle;
uint64_t offset;
uint64_t length;
uint32_t reclaim; /* True if this is a reclaim commit */
uint32_t new_offset; /* True if the client has suggested a new offset */
uint64_t last_write; /* The offset of the last byte written, if
new_offset if set, otherwise undefined. */
uint32_t time_changed; /* True if the client provided a new value for mtime */
struct gpfs_time_t new_time; /* If time_changed is true, the client-supplied
modification tiem for the file. otherwise, undefined. */
struct gpfs_exp_xdr_stream *xdr;
};
struct fsync_arg
{
int mountdirfd;
struct gpfs_file_handle *handle;
uint64_t offset;
uint64_t length;
uint32_t *verifier4;
};
struct statfs_arg
{
int mountdirfd;
struct gpfs_file_handle *handle;
struct statfs *buf;
};
struct stat_arg
{
int mountdirfd;
struct gpfs_file_handle *handle;
struct stat *buf;
};
struct grace_period_arg
{
int mountdirfd;
int grace_sec;
};
struct create_name_arg
{
int mountdirfd; /* in */
struct gpfs_file_handle *dir_fh;/* in */
uint32_t dev; /* in dev or posix flags */
int mode; /* in */
int len; /* in */
const char *name; /* in */
struct gpfs_file_handle *new_fh;/* out */
struct stat *buf; /* in/out */
int attr_valid; /* in */
int attr_changed; /* in */
struct gpfs_acl *acl; /* in/out */
};
struct stat_name_arg
{
int mountdirfd;
int len;
const char *name;
struct gpfs_file_handle *handle;
struct stat *buf;
};
struct callback_arg
{
int interface_version;
int mountdirfd;
int *reason;
struct gpfs_file_handle *handle;
struct glock *fl;
int *flags;
struct stat *buf;
struct pnfs_deviceid *dev_id;
uint32_t *expire_attr;
};
#define GPFS_INTERFACE_VERSION 10000
#define GPFS_INTERFACE_SUB_VER 1
/* Defines for the flags in callback_arg, keep up to date with CXIUP_xxx */
#define UP_NLINK 0x00000001 /* update nlink */
#define UP_MODE 0x00000002 /* update mode and ctime */
#define UP_OWN 0x00000004 /* update mode,uid,gid and ctime */
#define UP_SIZE 0x00000008 /* update fsize */
#define UP_SIZE_BIG 0x00000010 /* update fsize if bigger */
#define UP_TIMES 0x00000020 /* update all times */
#define UP_ATIME 0x00000040 /* update atime only */
#define UP_PERM 0x00000080 /* update fields needed for permission checking*/
#define UP_RENAME 0x00000100 /* this is a rename op */
#define UP_DESTROY_FLAG 0x00000200 /* clear destroyIfDelInode flag */
#define UP_GANESHA 0x00000400 /* this is a ganesha op */
/* reason list for reason in callback_arg */
#define INODE_INVALIDATE 1
#define INODE_UPDATE 2
#define INODE_LOCK_GRANTED 3
#define INODE_LOCK_AGAIN 4
#define THREAD_STOP 5
#define THREAD_PAUSE 6
#define BREAK_DELEGATION 7
#define LAYOUT_FILE_RECALL 8
#define LAYOUT_RECALL_ANY 9
#define LAYOUT_NOTIFY_DEVICEID 10
/* define flags for attr_valid */
#define XATTR_STAT (1 << 0)
#define XATTR_ACL (1 << 1)
#define XATTR_NO_CACHE (1 << 2)
#define XATTR_EXPIRE (1 << 3)
#define XATTR_FSID (1 << 4)
/* define flags for attr_chaged */
#define XATTR_MODE (1 << 0) // 01
#define XATTR_UID (1 << 1) // 02
#define XATTR_GID (1 << 2) // 04
#define XATTR_SIZE (1 << 3) // 08
#define XATTR_ATIME (1 << 4) // 10
#define XATTR_MTIME (1 << 5) // 20
#define XATTR_CTIME (1 << 6) // 40
#define XATTR_ATIME_SET (1 << 7) // 80
#define XATTR_MTIME_SET (1 << 8) // 100
#define XATTR_ATIME_NOW (1 << 9) // 200
#define XATTR_MTIME_NOW (1 << 10)// 400
#define XATTR_SPACE_RESERVED (1 << 11)// 800
struct fsal_fsid {
uint64_t major;
uint64_t minor;
};
struct xstat_arg
{
int attr_valid;
int mountdirfd;
struct gpfs_file_handle *handle;
struct gpfs_acl *acl;
int attr_changed;
struct stat *buf;
struct fsal_fsid *fsid;
uint32_t *expire_attr;
};
struct getxattr_arg {
int mountdirfd;
struct gpfs_file_handle *handle;
uint32_t name_len;
char *name;
uint32_t value_len;
void *value;
};
struct setxattr_arg {
int mountdirfd;
struct gpfs_file_handle *handle;
int type;
uint32_t name_len;
char *name;
uint32_t value_len;
void *value;
};
struct removexattr_arg {
int mountdirfd;
struct gpfs_file_handle *handle;
uint32_t name_len;
char *name;
};
struct listxattr_arg {
int mountdirfd;
struct gpfs_file_handle *handle;
uint64_t cookie;
uint64_t verifier;
uint32_t eof;
uint32_t name_len;
void *names;
};
struct fs_loc_arg {
int mountdirfd;
struct gpfs_file_handle *handle;
int fs_root_len;
char *fs_root;
int fs_path_len;
char *fs_path;
int fs_server_len;
char *fs_server;
};
struct xstat_access_arg
{
int mountdirfd;
struct gpfs_file_handle *handle;
struct gpfs_acl *acl;
struct xstat_cred_t *cred;
unsigned int posix_mode;
unsigned int access; /* v4maske */
unsigned int *supported;
};
struct quotactl_arg
{
const char *pathname;
int cmd;
int qid;
void *bufferP;
};
#ifdef __cplusplus
}
#endif
#endif /* H_GPFS_NFS */

View File

@@ -0,0 +1,397 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* */
/* */
/* Licensed Materials - Property of IBM */
/* */
/* Restricted Materials of IBM */
/* */
/* (C) COPYRIGHT International Business Machines Corp. 2018 */
/* All Rights Reserved */
/* */
/* US Government Users Restricted Rights - Use, duplication or */
/* disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */
/* */
/* IBM_PROLOG_END_TAG */
/* */
/* Copyright (C) 2018 International Business Machines */
/* All rights reserved. */
/* */
/* This file is part of the GPFS user library. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions */
/* are met: */
/* */
/* 1. Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the following disclaimer. */
/* 2. Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* 3. The name of the author may not be used to endorse or promote products */
/* derived from this software without specific prior written */
/* permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR */
/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES */
/* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. */
/* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, */
/* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; */
/* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, */
/* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF */
/* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* */
/* @(#)71 1.5.1.3 src/avs/fs/mmfs/ts/util/gpfs_watch.h, mmfs, avs_rtac502, rtac502s001a 10/1/18 14:10:41 */
/*
* Library calls for GPFS WATCH FOLDER interfaces
*/
#ifndef _h_gpfs_watch
#define _h_gpfs_watch
/* inotify emulation for GPFS - using LWE/policy, Kafka, and so forth */
#include <sys/inotify.h>
#include <sys/types.h>
#include <libio.h>
/* gpfs_diag_watch flags. Log messages written to /var/adm/ras/mmwf.log */
#define GPFS_WATCH_NODEBUG (0x0) //default
#define GPFS_WATCH_DEBUG (0x1)
/* public API methods - mimicking the Linux inotify API */
/* :notyet: integration of our inotify fd with standard unix fd for poll()ing */
# ifdef __cplusplus
extern "C" {
# endif
/* NAME: gpfs_init_watch
*
* FUNCTION: The gpfs_init_watch subroutine initializes a watch and returns a
* parent watch descriptor (pwd). The gpfs_init_watch subroutine
* checks if you have enabled watch folder. It also checks if you
* will exceed the maximum number of watches per file system (25).
*
* If you have not enabled watch folder functionality, gpfs_init_watch
* will fail. If you already have 100 watches on your cluster for all
* file systems combined, gpfs_init_watch will fail.
*
* Note: The parent watch descriptor and the child watch descriptors
* are not Linux file descriptors. For example, one cannot poll the
* descriptors.
*
* PARAMETERS: void
*
* RETURNS: The gpfs_init_watch subroutine returns the pwd on success or -1 on
* failure.
*
* Errno: Errno is set if -1 is returned.
* ENOKEY
* Watch folder is not enabled. Check with IBM Spectrum Scale™
* support to enable it.
* EINTR
* Maximum number of watches were exceeded on this cluster. The
* maximum number of watches allowed per cluster is 100.
* Note: Further errnos might be reported depending on the inner
* instrumentation of the API. Use gpfs_watch_strerror to learn
* more about an error.
*
* EXAMPLES: For an example using gpfs_*_watch,
* see /usr/lpp/mmfs/samples/util/tswf.C.
*/
int gpfs_init_watch(); /* returning an inotify fd */
/* NAME: gpfs_add_watch
*
* FUNCTION: The gpfs_add_watch subroutine watches files in the folder
* specified by pathname. The watch is non-recursive like
* Linux inotify. This means that the contents in subdirectories
* under the watched directory are not watched. The gpfs_add_watch
* subroutine registers your intention to watch said folder. In
* addition, it also verifies if the file system that you want to
* watch is owned by the local cluster. Currently, watches over
* file systems mounted on an accessing cluster are not supported.
*
* PARAMETERS:
* pwd
* The parent watch descriptor that is returned by gpfs_init_watch.
* You can set up multiple child watches (directory, fileset, or
* inode space) under the same parent watch as long as they are
* watching the same file system.
* pathname
* The path of the directory that is being watched.
* event_mask
* One or more of the events {IN_ACCESS,IN_ATTRIB,IN_CLOSE_NOWRITE,
* IN_CLOSE_WRITE,IN_CREATE,IN_DELETE,
* IN_DELETE_SELF,IN_MODIFY,IN_MOVED_FROM,
* IN_MOVE_SELF}
*
* RETURNS: The gpfs_add_watch subroutine returns the child watch descriptor (cwd)
* on success or -1 on failure.
*
* Errno: Errno is set if -1 is returned.
* EBADF
* Invalid pwd was passed.
* ENODEV
* The path is not a mounted IBM Spectrum Scale™ file system.
* EXDEV
* The path belongs to a different file system.
* ENOSYS
* This cluster is not the owning cluster for this file system.
* EINTR
* Exceeded the number of watches allowed for a file system (25).
* EDOM
* The file system level needs to be upgraded. Watch folder is
* not supported.
* EDESTADDRREQ
* The message queue for this cluster is not ready. Enable the
* message queue before starting a watch.
* ENODATA
* Message queue error.
* EHOSTUNREACH
* Could not find the node name.
* Note: Further errnos might be reported depending on the inner
* instrumentation of the API. Use gpfs_watch_strerror to learn
* more about an error.
*
* EXAMPLES: For an example using gpfs_*_watch,
* see /usr/lpp/mmfs/samples/util/tswf.C.
*/
/* gpfs_add_watch restriction -- all watches added to a
given inotify fd must be for the same file system */
int gpfs_add_watch(int fd, const char* pathname, int mask); /* returning an inotify wd */
/* NAME: gpfs_add_fset_watch
*
* FUNCTION: The gpfs_add_fset_watch subroutine watches all files and directories
* in the fileset specified by pathname. The watch is recursive in that
* subdirectories in the fileset and their contents are watched. You do
* not have to set up additional watches to watch the subdirectories.
* However, nested dependent or independent filesets under the fileset
* at pathname are not watched.
*
* PARAMETERS:
* pwd
* The parent watch descriptor that is returned by gpfs_init_watch.
* You can set up multiple child watches (directory, fileset, or
* inode space) under the same parent watch as long as they are
* watching the same file system.
* pathname
* The root of the fileset that is being watched.
* event_mask
* One or more of the events {IN_ACCESS,IN_ATTRIB,IN_CLOSE_NOWRITE,
* IN_CLOSE_WRITE,IN_CREATE,IN_DELETE,
* IN_DELETE_SELF,IN_MODIFY,IN_MOVED_FROM,
* IN_MOVE_SELF}
*
* RETURNS: The gpfs_add_fset_watch subroutine returns the child watch descriptor
* (cwd) on success or -1 on failure.
* The gpfs_add_fset_watch subroutine fails if pathname does not point
* to the root of a fileset.
*
* Errno: Errno is set if -1 is returned.
* EBADF
* Invalid pwd was passed.
* ENODEV
* The path is not a mounted IBM Spectrum Scale™ file system.
* EXDEV
* The pathname is not the root of a fileset.
* ENOSYS
* This cluster is not the owning cluster for this file system.
* EINTR
* Exceeded the number of watches allowed for a file system (25).
* EDOM
* The file system level needs to be upgraded. Watch folder is
* not supported.
* EDESTADDRREQ
* The message queue for this cluster is not ready. Enable the
* message queue before starting a watch.
* ENODATA
* Message queue error.
* EHOSTUNREACH
* Could not find the node name.
* Note: Further errnos might be reported depending on the inner
* instrumentation of the API. Use gpfs_watch_strerror to learn
* more about an error.
*
* EXAMPLES: For an example using gpfs_*_watch,
* see /usr/lpp/mmfs/samples/util/tswf.C.
*/
int gpfs_add_fset_watch(int fd, const char* pathname, int mask);
/* NAME: gpfs_add_inodespace_watch
*
* FUNCTION: The gpfs_add_inodespace_watch subroutine watches all files and
* directories in the inode space specified by pathname. This is a
* recursive watch, so subdirectories and their contents in the inode
* space are also watched. Nested dependent filesets are watched;
* however, nested independent filesets are not watched.
*
* PARAMETERS:
* pwd
* The parent watch descriptor that is returned by gpfs_init_watch.
* You can set up multiple child watches (directory, fileset, or
* inode space) under the same parent watch as long as they are
* watching the same file system.
* pathname
* The root of the fileset of the corresponding inode space that
* is being watched. The pathname is expected to point to the root
* of an independent fileset.
* event_mask
* One or more of the events {IN_ACCESS,IN_ATTRIB,IN_CLOSE_NOWRITE,
* IN_CLOSE_WRITE,IN_CREATE,IN_DELETE,
* IN_DELETE_SELF,IN_MODIFY,IN_MOVED_FROM,
* IN_MOVE_SELF}
*
* RETURNS: The gpfs_add_inodespace_watch subroutine returns the child watch
* descriptor (cwd) on success or -1 on failure.
*
* Errno: Errno is set if -1 is returned.
* EBADF
* Invalid pwd was passed.
* ENODEV
* The path is not a mounted IBM Spectrum Scale™ file system.
* EXDEV
* The pathname is not the root of an independent fileset.
* ENOSYS
* This cluster is not the owning cluster for this file system.
* EINTR
* Exceeded the number of watches allowed for a file system (25).
* EDOM
* The file system level needs to be upgraded. Watch folder is
* not supported.
* EDESTADDRREQ
* The message queue for this cluster is not ready. Enable the
* message queue before starting a watch.
* ENODATA
* Message queue error.
* EHOSTUNREACH
* Could not find the node name.
* Note: Further errnos might be reported depending on the inner
* instrumentation of the API. Use gpfs_watch_strerror to learn
* more about an error.
*
* EXAMPLES: For an example using gpfs_*_watch,
* see /usr/lpp/mmfs/samples/util/tswf.C.
*
*/
int gpfs_add_inodespace_watch(int fd, const char* pathname, int mask);
/* NAME: gpfs_read_watch
*
* FUNCTION: The gpfs_read_watch subroutine reads a file access event.
* The metadata for the event is populated in buf in the inotify_struct
* format:
*
* struct inotify_event {
* int cwd; // Child watch descriptor
* uint32_t mask; // Mask describing event
* uint32_t cookie; // Unique cookie associating related
* // events such as rename
* uint32_t len; // Size of file path
* char name[]; // Optional null-terminated file path
* };
*
* The gpfs_read_watch subroutine tries to fill up buf with as
* many events as it can.
*
* PARAMETERS:
* pwd
* The parent watch descriptor that is returned by gpfs_init_watch.
* buf
* Pointer to a preallocated buffer.
* count
* Number of bytes in buf.
*
* RETURNS: The gpfs_read_watch subroutine returns -1 on failure.
*
* Errno: Errno is set if -1 is returned.
* Note: Further errnos might be reported depending on the inner
* instrumentation of the API. Use gpfs_watch_strerror to learn
* more about an error.
*
* EXAMPLES: For an example using gpfs_*_watch,
* see /usr/lpp/mmfs/samples/util/tswf.C.
*
*/
ssize_t gpfs_read_watch(int fd, void* buf, size_t count); /* read one or more inotify structs (layed end-to-end) */
/* NAME: gpfs_rm_watch
*
* FUNCTION: The gpfs_rm_watch subroutine stops the watch for the specified cwd.
*
* PARAMETERS:
* pwd
* The parent watch descriptor that is returned by gpfs_init_watch.
* cwd
* The child watch descriptor that is returned by gpfs_add_*_watch.
*
* RETURNS: The gpfs_rm_watch subroutine returns 0 on success or -1 on error.
*
* Errno: Errno is set if -1 is returned.
* Note: Further errnos might be reported depending on the inner
* instrumentation of the API. Use gpfs_watch_strerror to learn
* more about an error.
*
* EXAMPLES: For an example using gpfs_*_watch,
* see /usr/lpp/mmfs/samples/util/tswf.C.
*
*/
int gpfs_rm_watch(int fd, int wd); /*removing the wd from the inotify fd */
/* NAME: gpfs_watch_strerror
*
* FUNCTION: The gpfs_watch_strerror subroutine provides some additional
* information for the last error encountered.
*
* PARAMETERS:
* pwd
* The parent watch descriptor that is returned by gpfs_init_watch.
*
* RETURNS: The gpfs_watch_strerror subroutine returns the character string with
* the error message or NULL if there is no descriptive error.
*
* EXAMPLES: For an example using gpfs_*_watch,
* see /usr/lpp/mmfs/samples/util/tswf.C.
*
*/
const char* gpfs_watch_strerror(int fd); /* C-string describing last error */
/* NAME: gpfs_close_watch
*
* FUNCTION: The gpfs_close_watch subroutine destroys resources that are
* associated with a parent watch descriptor (pwd).
*
* PARAMETERS:
* pwd
* The parent watch descriptor that is returned by gpfs_init_watch.
*
* RETURNS: The gpfs_close_watch subroutine returns 0 on success or -1 on failure.
*
* Errno: Errno is set if -1 is returned.
* Note: Further errnos might be reported depending on the inner
* instrumentation of the API. Use gpfs_watch_strerror to learn
* more about an error.
*
* EXAMPLES: For an example using gpfs_*_watch,
* see /usr/lpp/mmfs/samples/util/tswf.C.
*
*/
int gpfs_close_watch(int fd); /* destroying the inotify fd and all associated wds and any other resources */
/* NAME: gpfs_diag_watch
*
* FUNCTION: The gpfs_diag_watch subroutine provides some additional diagnostics
*
* RETURNS:
*
* EXAMPLES: For an example using gpfs_*_watch,
* see /usr/lpp/mmfs/samples/util/tswf.C.
*/
int gpfs_diag_watch(int fd, int dflags); /* set diagnostics */
# ifdef __cplusplus
}
# endif
#endif /* _h_gpfs_watch */

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.