978 lines
26 KiB
C
978 lines
26 KiB
C
/****************************************************************************
|
|
|
|
|
| (C) Copyright 2002 Novell, Inc.
|
|
| All Rights Reserved.
|
|
|
|
|
| This program is free software; you can redistribute it and/or
|
|
| modify it under the terms of version 2 of the GNU General Public
|
|
| License as published by the Free Software Foundation.
|
|
|
|
|
| This program is distributed in the hope that it will be useful,
|
|
| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| GNU General Public License for more details.
|
|
|
|
|
| You should have received a copy of the GNU General Public License
|
|
| along with this program; if not, contact Novell, Inc.
|
|
|
|
|
| To contact Novell about this file by physical or electronic mail,
|
|
| you may find current contact information at www.novell.com
|
|
|
|
|
|***************************************************************************
|
|
|
|
|
| NetWare Loadable Storage Services (LSS) module
|
|
|
|
|
|---------------------------------------------------------------------------
|
|
|
|
|
| $Author: taysom $
|
|
| $Date: 2004-12-31 01:10:58 +0530 (Fri, 31 Dec 2004) $
|
|
|
|
|
| $RCSfile$
|
|
| $Revision: 465 $
|
|
|
|
|
|---------------------------------------------------------------------------
|
|
| This module is used to:
|
|
| Define structures, bit masks, etc needed by an LSS
|
|
+-------------------------------------------------------------------------*/
|
|
|
|
#ifndef _XMSG_H_
|
|
#define _XMSG_H_
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#ifndef _OMNI_H_
|
|
#include <library/omni.h>
|
|
#endif
|
|
|
|
#ifndef _XUNICODE_H_
|
|
#include <library/xUnicode.h>
|
|
#endif
|
|
|
|
#ifndef _ZMSG_H_
|
|
#include <public/zMsg.h>
|
|
#endif
|
|
|
|
#ifndef _NSS_MSG_H_
|
|
#include <include/msg.h>
|
|
#endif
|
|
|
|
#ifndef _VOLUME_H_
|
|
#include <include/volume.h>
|
|
#endif
|
|
|
|
#ifndef _FULLDIRECTORYINFO_H_
|
|
#include <include/fullDirectoryInfo.h>
|
|
#endif
|
|
|
|
/* FixFixFix(CFS) - Remove in OPT code before SP1 */
|
|
|
|
#define xMSG_DEBUG( _msg ) \
|
|
{ \
|
|
static char xMSG_Debug_Char = 0; \
|
|
LB_memset( _msg, xMSG_Debug_Char++, sizeof(_msg) ); \
|
|
}
|
|
|
|
#define xMSG_INIT_VALUES( _msg, _numDataAreas, _readMask, _writeMask ) \
|
|
xMSG_DEBUG( _msg ); \
|
|
(_msg)->sys.numDataAreas = _numDataAreas; \
|
|
(_msg)->sys.readMask = _readMask; \
|
|
(_msg)->sys.writeMask = _writeMask;
|
|
|
|
#define xMSG_INIT( _msg ) \
|
|
xMSG_INIT_VALUES( _msg, 0, 0x00, 0x00);
|
|
|
|
/***********************************************************************/
|
|
|
|
/** Information from the Master Volume to plug into Slave Volume **/
|
|
typedef struct XlssMasterVolumeInfo_s {
|
|
QUAD XMVI_enabledAttributes;
|
|
QUAD XMVI_numFiles;
|
|
QUAD XMVI_numObjects;
|
|
QUAD XMVI_totalBlocks;
|
|
QUAD XMVI_inUseBlocks;
|
|
QUAD XMVI_purgeableBlocks;
|
|
QUAD XMVI_numDeletedFiles;
|
|
} XlssMasterVolumeInfo_s;
|
|
|
|
/**************************************************************************/
|
|
|
|
//FixFixFix(CFS) Make this configurable
|
|
#define CFS_UPDATE_VOL_STATS_SECS 3 /* 3 seconds */
|
|
|
|
typedef struct CsaVolumeInfo_s
|
|
{
|
|
Volume_s *CVI_volume;
|
|
DQhead_t CVI_csaVolumeDoorHead;
|
|
DQlink_t CVI_csaBeastHead;
|
|
OneShot_s CVI_volumeStatsUpdateTimer;
|
|
FsmLite_s CVI_fsm;
|
|
BOOL CVI_scheduled;
|
|
XlssMasterVolumeInfo_s CVI_volStatsLastSent;
|
|
|
|
} CsaVolumeInfo_s;
|
|
|
|
typedef struct CroVolumeDoor_s
|
|
{
|
|
mDoor_s CVO_door;
|
|
Volume_s *CVO_volume;
|
|
Key_t CVO_CSAVolumeKey;
|
|
Key_t CVO_CSAVolumeKeyReconnect;
|
|
} CroVolumeDoor_s;
|
|
|
|
/**************************************************************************/
|
|
|
|
#define INVALID_BEAST_LEASE_ID 0
|
|
|
|
#define CRO_RECONNECT_STATE_NOT_IN_SYNC 1
|
|
#define CRO_RECONNECT_STATE_SYNC_PHASE1 2
|
|
#define CRO_RECONNECT_STATE_IN_SYNC 3
|
|
|
|
/***************************************************************************/
|
|
|
|
extern NINT XLSSArrayIndex;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef QUAD CSALeaseID_t;
|
|
|
|
/***********************************************************************/
|
|
|
|
typedef struct XLSSBeastLeaseList_s {
|
|
Zid_t XBLL_beastZid;
|
|
CSALeaseID_t XBLL_beastLeaseID;
|
|
LONG XBLL_dataSeqNum;
|
|
} XLSSBeastLeaseList_s;
|
|
|
|
|
|
#define XLSS_MAX_ZIDS_TO_SYNC 50
|
|
|
|
/***********************************************************************/
|
|
//FixFixFix(XLSS) : Do we need to send taskID, saID, flags send over ??
|
|
|
|
typedef struct XLSS_GeneralMsg_s{
|
|
LONG XL_taskID;
|
|
WORD XL_saID;
|
|
WORD XL_flags;
|
|
} XLSS_GeneralMsg_s;
|
|
|
|
typedef struct CSA_GeneralMsg_s{
|
|
LONG XS_errStatus;
|
|
} CSA_GeneralMsg_s;
|
|
|
|
|
|
/* FixFixFix - This inits taskID, flags and saID TWICE */
|
|
#define CSA_REMOTE_GENMSG_TO_LOCAL_GENMSG(_pktGenMsg, _genMsg) \
|
|
{ \
|
|
if (_pktGenMsg == NULL) \
|
|
{ \
|
|
COMN_SETUP_GENERAL_MSG_NO_CONNECTION_RESOLVE(_genMsg); \
|
|
} \
|
|
else \
|
|
{ \
|
|
COMN_SETUP_GENERAL_MSG_NO_CONNECTION_RESOLVE(_genMsg); \
|
|
(_genMsg)->taskID = (_pktGenMsg)->XL_taskID; \
|
|
(_genMsg)->saID = (_pktGenMsg)->XL_saID; \
|
|
(_genMsg)->flags = (_pktGenMsg)->XL_flags; \
|
|
} \
|
|
}
|
|
|
|
#define CSA_LOCAL_GENMSG_TO_REMOTE_GENMSG(_status, _genMsg, _pktGenMsg) \
|
|
{ \
|
|
if (_status == zOK) \
|
|
{ \
|
|
(_pktGenMsg)->XS_errStatus = zOK; \
|
|
} \
|
|
else \
|
|
{ \
|
|
(_pktGenMsg)->XS_errStatus = GetErrno((_genMsg)); \
|
|
} \
|
|
}
|
|
|
|
#define XLSS_REMOTE_GENMSG_TO_LOCAL_GENMSG(_status, _pktGenMsg, _genMsg) \
|
|
{ \
|
|
if ((_pktGenMsg)->XS_errStatus == zOK) \
|
|
{ \
|
|
_status = zOK; \
|
|
} \
|
|
else \
|
|
{ \
|
|
SetErrno((_genMsg), (_pktGenMsg)->XS_errStatus); \
|
|
_status = zFAILURE; \
|
|
} \
|
|
}
|
|
|
|
#define XLSS_LOCAL_GENMSG_TO_REMOTE_GENMSG(_genMsg, _pktGenMsg) \
|
|
{ \
|
|
(_pktGenMsg)->XL_taskID = (_genMsg)->taskID; \
|
|
(_pktGenMsg)->XL_saID = (_genMsg)->saID; \
|
|
(_pktGenMsg)->XL_flags = (_genMsg)->flags; \
|
|
}
|
|
|
|
/***************************************************************************/
|
|
|
|
/********************************************************/
|
|
/*** These are the messages used to break Beast Leases ***/
|
|
/********************************************************/
|
|
typedef struct CSA_BeastLeaseBreakMsg_s
|
|
{ /* REQUEST Message */
|
|
CSALeaseID_t CBLM_beastLeaseID; /* Unique Beast Lease ID. XLSS must
|
|
* pass this back in its reply.
|
|
*/
|
|
Zid_t CBLM_zid; /* Zid of beast that needs its Beast
|
|
* Lease broken.
|
|
*/
|
|
LONG CBLM_delayHint; /* Number of milliseconds before
|
|
* XLSS should attempt to get the
|
|
* Beast Lease again.
|
|
*/
|
|
} CSA_BeastLeaseBreakMsg_s;
|
|
|
|
|
|
//typedef struct XLSS_BeastLeaseBreakMsg_s
|
|
//{ /* REPLY Message */
|
|
// CSALeaseID_t XBLM_beastLeaseID; /* Unique Beast Lease ID. */
|
|
// Zid_t XBLM_zid; /* Zid of beast that beast lease was
|
|
// * broken on.
|
|
// */
|
|
//} XLSS_BeastLeaseBreakMsg_s;
|
|
|
|
|
|
typedef struct XLSS_BeastLeaseTossMsg_s
|
|
{
|
|
CSALeaseID_t XBLM_beastLeaseID; /* Unique Beast Lease ID. */
|
|
Zid_t XBLM_zid; /* Zid of beast that beast lease was
|
|
* broken on.
|
|
*/
|
|
} XLSS_BeastLeaseTossMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct XLSS_GetBeastMsg_s
|
|
{
|
|
Zid_t XGBM_zid;
|
|
XLSS_GeneralMsg_s XGBM_genMsg;
|
|
} XLSS_GetBeastMsg_s;
|
|
|
|
|
|
#define XLSS_MAX_PACKED_BEAST_SIZE 2048
|
|
|
|
typedef struct CSA_GetBeastMsg_s
|
|
{
|
|
CSA_GeneralMsg_s CGBM_genMsg;
|
|
CSALeaseID_t CGBM_beastLeaseID; /* Beast Lease ID used by slave
|
|
* if it wants to tell the master
|
|
* that the beast got tossed.
|
|
*/
|
|
LONG CGBM_dataSeqNum; /* Number of times data has changed
|
|
* on this beast
|
|
*/
|
|
/* msg->sys.data[0].start */
|
|
// BYTE CGBM_packedBeast[XLSS_PACKED_BEAST_SIZE];
|
|
} CSA_GetBeastMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct XLSS_LookupByNameMsg_s
|
|
{
|
|
Zid_t XLBM_directoryZid;
|
|
XLSS_GeneralMsg_s XLBM_genMsg;
|
|
LONG XLBM_nSpaceID;
|
|
LONG XLBM_nameType;
|
|
LONG XLBM_nameUniquifier;
|
|
/* msg->sys.data[0].start */
|
|
// unicode_t XLBM_name[zMAX_COMPONENT_NAME];
|
|
} XLSS_LookupByNameMsg_s;
|
|
|
|
typedef struct CSA_LookupByNameMsg_s
|
|
{
|
|
CSA_GeneralMsg_s CLBM_genMsg;
|
|
LONG CLBM_nameUniquifier;
|
|
Zid_t CLBM_zid;
|
|
/* msg->sys.data[1].start */
|
|
// FullDirectoryInfo_s CLBM_dirInfo;
|
|
} CSA_LookupByNameMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct XLSS_GetStorageInfoMsg_s
|
|
{
|
|
Zid_t XGSM_zid;
|
|
XLSS_GeneralMsg_s XGSM_genMsg;
|
|
} XLSS_GetStorageInfoMsg_s;
|
|
|
|
|
|
typedef struct CSA_GetStorageInfoMsg_s
|
|
{
|
|
CSA_GeneralMsg_s CGSM_genMsg;
|
|
GetStorageInfo_s CGSM_storageInfo;
|
|
} CSA_GetStorageInfoMsg_s;
|
|
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct XLSS_IsBlockInBeastMsg_s
|
|
{
|
|
Zid_t XIBM_zid;
|
|
Blknum_t XIBM_block;
|
|
} XLSS_IsBlockInBeastMsg_s;
|
|
|
|
|
|
typedef struct CSA_IsBlockInBeastMsg_s
|
|
{
|
|
BOOL CIBM_retReply;
|
|
} CSA_IsBlockInBeastMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct XLSS_GetFileBlkMsg_s
|
|
{
|
|
Zid_t XGFM_zid;
|
|
XLSS_GeneralMsg_s XGFM_genMsg;
|
|
Blknum_t XGFM_fileBlk;
|
|
} XLSS_GetFileBlkMsg_s;
|
|
|
|
|
|
typedef struct CSA_GetFileBlkMsg_s
|
|
{
|
|
CSA_GeneralMsg_s CGFM_genMsg;
|
|
Blknum_t CGFM_volBlk;
|
|
/* msg->sys.data[0].start */
|
|
// BOOL CGFM_buffer[PAGE_SIZE];
|
|
} CSA_GetFileBlkMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct XLSS_AsyncReadMsg_s
|
|
{
|
|
Zid_t XARM_zid;
|
|
Blknum_t XARM_fileBlk;
|
|
} XLSS_AsyncReadMsg_s;
|
|
|
|
typedef struct CSA_AsyncReadMsg_s
|
|
{
|
|
STATUS CARM_status;
|
|
Blknum_t CARM_volBlk;
|
|
/* msg->sys.data[0].start */
|
|
// BOOL CARM_buffer[PAGE_SIZE];
|
|
} CSA_AsyncReadMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct XLSS_GetExtentListMsg_s
|
|
{
|
|
Zid_t XGEM_zid;
|
|
XLSS_GeneralMsg_s XGEM_genMsg;
|
|
Blknum_t XGEM_startingBlk;
|
|
} XLSS_GetExtentListMsg_s;
|
|
|
|
|
|
typedef struct CSA_GetExtentListMsg_s
|
|
{
|
|
CSA_GeneralMsg_s CGEM_genMsg;
|
|
LONG CGEM_retNumExtents;
|
|
Blknum_t CGEM_retNextBlock;
|
|
/* msg.sys.data[0].start */
|
|
// Blknum_t CGEM_extentList[XLSS_NUM_EXTENTS];
|
|
} CSA_GetExtentListMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct XLSS_IsDirectoryEmptyMsg_s
|
|
{
|
|
Zid_t XIDM_dirZid;
|
|
XLSS_GeneralMsg_s XIDM_genMsg;
|
|
LONG XIDM_nameType;
|
|
} XLSS_IsDirectoryEmptyMsg_s;
|
|
|
|
typedef struct CSA_IsDirectoryEmptyMsg_s
|
|
{
|
|
CSA_GeneralMsg_s CIDM_genMsg;
|
|
BOOL CIDM_retValue;
|
|
} CSA_IsDirectoryEmptyMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct XLSS_GetPhysicalExtentMsg_s
|
|
{
|
|
Zid_t XGPM_zid;
|
|
QUAD XGPM_startOffset;
|
|
} XLSS_GetPhysicalExtentMsg_s;
|
|
|
|
typedef struct CSA_GetPhysicalExtentMsg_s
|
|
{
|
|
STATUS CGPM_status;
|
|
LONG CGPM_retNumExtents;
|
|
QUAD CGPM_retOffset;
|
|
/* msg->sys.data[0].start */
|
|
// BYTE CGPM_retData[XLSS_PHYSICAL_EXTENT_DATA];
|
|
} CSA_GetPhysicalExtentMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct XLSS_DioReadUnitsMsg_s
|
|
{
|
|
VolumeID_t XDRM_volumeID;
|
|
Zid_t XDRM_zid;
|
|
Zid_t XDRM_saID;
|
|
QUAD XDRM_startSector;
|
|
LONG XDRM_length;
|
|
} XLSS_DioReadUnitsMsg_s;
|
|
|
|
typedef struct CSA_DioReadUnitsMsg_s
|
|
{
|
|
STATUS CDRM_status;
|
|
// BYTE CDRM_retData[PAGE_SIZE];
|
|
} CSA_DioReadUnitsMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
#define XLSS_SMAPOPT_MASK (SMAPOPT_matchAllEntries | SMAPOPT_returnLastEntry)
|
|
|
|
typedef struct XLSS_WildcardLookupMsg_s
|
|
{
|
|
Zid_t XWLM_directoryZid;
|
|
XLSS_GeneralMsg_s XWLM_genMsg;
|
|
LONG XWLM_nSpaceID;
|
|
LONG XWLM_nameType;
|
|
LONG XWLM_smapID;
|
|
LONG XWLM_smapOptions;
|
|
|
|
/* msg->sys.data[0].start */
|
|
// unicode_t XWLM_pattern[zMAX_COMPONENT_NAME];
|
|
} XLSS_WildcardLookupMsg_s;
|
|
|
|
typedef struct CSA_WildcardLookupMsg_s
|
|
{
|
|
CSA_GeneralMsg_s CWLM_genMsg;
|
|
LONG CWLM_smapID;
|
|
LONG CWLM_smapOptions;
|
|
LONG CWLM_nameUniquifier;
|
|
Zid_t CWLM_zid;
|
|
/* msg->sys.data[1].start */
|
|
// FullDirectoryInfo_s CWLM_dirInfo;
|
|
} CSA_WildcardLookupMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct XLSS_SearchMapCleanupMsg_s
|
|
{
|
|
LONG XSMM_smapID;
|
|
} XLSS_SearchMapCleanupMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct XLSS_SearchMapReestablishMsg_s
|
|
{
|
|
Zid_t XSRM_directoryZid;
|
|
XLSS_GeneralMsg_s XSRM_genMsg;
|
|
LONG XSRM_nSpaceID;
|
|
LONG XSRM_nameType;
|
|
LONG XSRM_smapOptions;
|
|
Zid_t XSRM_zid;
|
|
} XLSS_SearchMapReestablishMsg_s;
|
|
|
|
typedef struct CSA_SearchMapReestablishMsg_s
|
|
{
|
|
CSA_GeneralMsg_s CSRM_genMsg;
|
|
Zid_t CSRM_zid;
|
|
LONG CSRM_smapID;
|
|
LONG CSRM_smapOptions;
|
|
} CSA_SearchMapReestablishMsg_s;
|
|
|
|
/***************************************************************************/
|
|
typedef struct XLSS_VolNotifyMsg_s
|
|
{
|
|
LONG XVNM_volState;
|
|
LONG XVNM_reconnectState;
|
|
} XLSS_VolNotifyMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct XLSS_ReconnectNotifyMsg_s
|
|
{
|
|
LONG XRNM_reconnectState;
|
|
} XLSS_ReconnectNotifyMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct CSA_NameCacheInvalidateMsg_s
|
|
{
|
|
Zid_t CNCM_parentZid;
|
|
LONG CNCM_nameSpaceMask;
|
|
LONG CNCM_nameType;
|
|
LONG CNCM_nsFlag;
|
|
/* msg->sys.data[0].start */
|
|
// unicode_t CNCM_name[zMAX_COMPONENT_NAME];
|
|
|
|
} CSA_NameCacheInvalidateMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct CSA_AuthCacheInvalidateMsg_s
|
|
{
|
|
UserID_t CACM_trusteeID;
|
|
BOOL CACM_entireCache;
|
|
} CSA_AuthCacheInvalidateMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct CSA_VolGetAuthModelIDMsg_s
|
|
{
|
|
LONG CCGM_authModelID;
|
|
XlssMasterVolumeInfo_s CGCM_volInfo;
|
|
} CSA_VolGetAuthModelIDMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct CSA_BeastStatePurgingMsg_s
|
|
{
|
|
Zid_t CBPM_zid;
|
|
} CSA_BeastStatePurgingMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct XLSS_AccessLeaseOpenMsg_s
|
|
{
|
|
XLSS_GeneralMsg_s XALM_genMsg;
|
|
LONG XALM_fileNameUniquifier;
|
|
Zid_t XALM_fileParentZid;
|
|
Zid_t XALM_fileZid;
|
|
Zid_t XALM_dataStreamZid;
|
|
LONG XALM_nSpaceID;
|
|
LONG XALM_nameType;
|
|
LONG XALM_grantedRights;
|
|
LONG XALM_parseFlags;
|
|
} XLSS_AccessLeaseOpenMsg_s;
|
|
|
|
typedef struct CSA_AccessLeaseOpenMsg_s
|
|
{
|
|
CSA_GeneralMsg_s CALM_genMsg;
|
|
Key_t CALM_masterFHKey;
|
|
} CSA_AccessLeaseOpenMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
#define CRO_MAX_CLOSES 10
|
|
|
|
typedef struct XLSS_AccessLeaseCloseMsg_s
|
|
{
|
|
LONG XALCM_masterKeyCount;
|
|
Key_t XALCM_masterFHKey[CRO_MAX_CLOSES];
|
|
} XLSS_AccessLeaseCloseMsg_s;
|
|
|
|
typedef struct CSA_AccessLeaseCloseMsg_s
|
|
{
|
|
LONG CALCM_masterKeyCount;
|
|
LONG CALCM_status[CRO_MAX_CLOSES]; /* Status of each close */
|
|
} CSA_AccessLeaseCloseMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct XLSS_AccessLeaseValidateMsg_s
|
|
{
|
|
LONG XALVM_InUse; /* TRUE if CALVM_masterFHKey still in use.
|
|
* If FALSE then slave requires that Master
|
|
* closes the file on the Master side.
|
|
*/
|
|
} XLSS_AccessLeaseValidateMsg_s;
|
|
|
|
typedef struct CSA_AccessLeaseValidateMsg_s
|
|
{
|
|
Zid_t CALVM_zid;
|
|
Key_t CALVM_masterFHKey;
|
|
} CSA_AccessLeaseValidateMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct CSA_SendVolumeStatsMsg_s
|
|
{
|
|
XlssMasterVolumeInfo_s CVSM_volInfo;
|
|
} CSA_SendVolumeStatsMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef enum CSAops_e
|
|
{
|
|
CSA_VOL_NOTIFY, /* 0 CSA_VolNotifyMsg */
|
|
CSA_VOL_GET_AUTH_ID, /* 1 CSA_VolGetAuthModelIDMsg */
|
|
|
|
CSA_MSG_NUM_METHODS /* 2 Must be last */
|
|
} CSAops_e;
|
|
|
|
typedef enum CSAVops_e
|
|
{
|
|
CSA_GET_BEAST, /* 0 CSA_VOL_GetBeastFromVolumeMsg */
|
|
CSA_WILD_LOOKUP, /* 1 CSA_VOL_WildcardLookupMsg */
|
|
CSA_LOOKUP_NAME, /* 2 CSA_VOL_LookupByNameInDirectoryMsg */
|
|
CSA_GET_STORAGE_INFO, /* 3 CSA_VOL_GetStorageInfoMsg */
|
|
CSA_IS_BLOCK_IN_BEAST, /* 4 CSA_VOL_IsBlockInBeastMsg */
|
|
CSA_GET_FILE_BLK, /* 5 CSA_VOL_GetFileBlkMsg */
|
|
CSA_ASYNC_READ_BLK, /* 6 CSA_VOL_AsyncReadFileBlkMsg */
|
|
CSA_GET_EXTENT_LIST, /* 7 CSA_VOL_GetExtentListMsg */
|
|
CSA_IS_DIR_EMPTY, /* 8 CSA_VOL_IsDirectoryEmptyMsg */
|
|
CSA_GET_PHY_EXTENT, /* 9 CSA_VOL_GetPhysicalExtentMsg */
|
|
CSA_DIO_READ, /* 10 CSA_VOL_DioReadUnitsMsg */
|
|
CSA_SMAP_CLEANUP, /* 11 CSA_SearchMapCleanupMsg */
|
|
// CSA_BEAST_LEASE_BREAK, /* 12 CSA_BeastLeaseBreakMsg */
|
|
CSA_BEAST_LEASE_TOSS, /* 13 CSA_BeastLeaseTossMsg */
|
|
CSA_RECONNECT_NOTIFY, /* 14 CSA_ReconnectNotifyMsg */
|
|
CSA_BEAST_LEASE_RECREATE,/* 15 CSA_BeastLeaseRecreateMsg */
|
|
CSA_SMAP_REESTABLISH, /* 16 CSA_SearchMapReestablishMsg */
|
|
CSA_SMAP_CLEANUP_ALL, /* 17 CSA_SearchMapCleanupAllMsg */
|
|
|
|
CSA_ACCESS_LEASE_OPEN, /* 18 CSA_AccessLeaseOpenMsg */
|
|
CSA_ACCESS_LEASE_CLOSE, /* 19 CSA_AccessLeaseCloseMsg */
|
|
// CSA_ACCESS_LEASE_VALIDATE, /* 20 CSA_AccessLeaseValidateMsg */
|
|
CSA_ACCESS_LEASE_CLEANUP_ALL, /* 21 CSA_AccessLeaseCleanupAllMsg */
|
|
|
|
CSA_VOL_NUM_METHODS /* 22 Must be last */
|
|
} CSAVops_e;
|
|
|
|
typedef enum XLSSVops_e
|
|
{
|
|
XLSS_VOL_KEY, /* 0 XLSS_VolumeKeyMsg */
|
|
XLSS_NAME_CACHE_CLEANUP, /* 1 XLSS_VOL_NameCacheCleanupMsg */
|
|
XLSS_BEAST_LEASE_BREAK, /* 2 XLSS_BeastLeaseBreakMsg */
|
|
XLSS_AUTH_CACHE_CLEANUP, /* 3 XLSS_VOL_AuthCacheCleanupMsg */
|
|
XLSS_ALL_SLAVES_SYNCD, /* 4 XLSS_AllSlavesSyncdMsg */
|
|
XLSS_BEAST_STATE_PURGING, /* 5 XLSS_BeastStatePurgingMsg */
|
|
XLSS_ACCESS_LEASE_VALIDATE, /* 6 XLSS_AccessLeaseValidateMsg */
|
|
XLSS_SEND_VOLUME_STATS, /* 7 XLSS_SendVolumeStatsMsg */
|
|
|
|
XLSS_NUM_METHODS /* 8 Must be last */
|
|
} XLSSVops_e;
|
|
|
|
|
|
typedef struct xMsg_s
|
|
{
|
|
mSystemMsg_s sys;
|
|
union xBody_u
|
|
{
|
|
mBody_u std;
|
|
|
|
struct getStorageInfo
|
|
{
|
|
XLSS_GetStorageInfoMsg_s xlssPacket;
|
|
CSA_GetStorageInfoMsg_s csaPacket;
|
|
} getStorageInfo;
|
|
|
|
struct lookupName
|
|
{
|
|
XLSS_LookupByNameMsg_s xlssPacket;
|
|
CSA_LookupByNameMsg_s csaPacket;
|
|
} lookupName;
|
|
|
|
struct getBeast
|
|
{
|
|
XLSS_GetBeastMsg_s xlssPacket;
|
|
CSA_GetBeastMsg_s csaPacket;
|
|
} getBeast;
|
|
|
|
struct isBlockInBeast
|
|
{
|
|
XLSS_IsBlockInBeastMsg_s xlssPacket;
|
|
CSA_IsBlockInBeastMsg_s csaPacket;
|
|
} isBlockInBeast;
|
|
|
|
struct getFileBlk
|
|
{
|
|
XLSS_GetFileBlkMsg_s xlssPacket;
|
|
CSA_GetFileBlkMsg_s csaPacket;
|
|
} getFileBlk;
|
|
|
|
struct asyncReadBlk
|
|
{
|
|
XLSS_AsyncReadMsg_s xlssPacket;
|
|
CSA_AsyncReadMsg_s csaPacket;
|
|
} asyncReadBlk;
|
|
|
|
struct getExtentList
|
|
{
|
|
XLSS_GetExtentListMsg_s xlssPacket;
|
|
CSA_GetExtentListMsg_s csaPacket;
|
|
} getExtentList;
|
|
|
|
struct isDirEmpty
|
|
{
|
|
XLSS_IsDirectoryEmptyMsg_s xlssPacket;
|
|
CSA_IsDirectoryEmptyMsg_s csaPacket;
|
|
} isDirEmpty;
|
|
|
|
struct getPhyExtent
|
|
{
|
|
XLSS_GetPhysicalExtentMsg_s xlssPacket;
|
|
CSA_GetPhysicalExtentMsg_s csaPacket;
|
|
} getPhyExtent;
|
|
|
|
struct dioRead
|
|
{
|
|
XLSS_DioReadUnitsMsg_s xlssPacket;
|
|
CSA_DioReadUnitsMsg_s csaPacket;
|
|
} dioRead;
|
|
|
|
struct wildLookup
|
|
{
|
|
XLSS_WildcardLookupMsg_s xlssPacket;
|
|
CSA_WildcardLookupMsg_s csaPacket;
|
|
} wildLookup;
|
|
|
|
struct smapCleanup
|
|
{
|
|
XLSS_SearchMapCleanupMsg_s xlssPacket;
|
|
} smapCleanup;
|
|
|
|
struct reestablishSmap
|
|
{
|
|
XLSS_SearchMapReestablishMsg_s xlssPacket;
|
|
CSA_SearchMapReestablishMsg_s csaPacket;
|
|
} reestablishSmap;
|
|
|
|
struct volNotify
|
|
{
|
|
XLSS_VolNotifyMsg_s xlssPacket;
|
|
} volNotify;
|
|
|
|
struct reconNotify
|
|
{
|
|
XLSS_ReconnectNotifyMsg_s xlssPacket;
|
|
} reconNotify;
|
|
|
|
struct nameCacheInvalidate
|
|
{
|
|
CSA_NameCacheInvalidateMsg_s csaPacket;
|
|
} nameCacheInvalidate;
|
|
|
|
struct beastLeaseBreakRequest
|
|
{
|
|
CSA_BeastLeaseBreakMsg_s csaPacket;
|
|
} beastLeaseBreakRequest;
|
|
|
|
// struct beastLeaseBreakReply
|
|
// {
|
|
// XLSS_BeastLeaseBreakMsg_s xlssPacket;
|
|
// } beastLeaseBreakReply;
|
|
|
|
struct beastLeaseToss
|
|
{
|
|
XLSS_BeastLeaseTossMsg_s xlssPacket;
|
|
} beastLeaseToss;
|
|
|
|
struct getAuthID
|
|
{
|
|
CSA_VolGetAuthModelIDMsg_s csaPacket;
|
|
CSA_SendVolumeStatsMsg_s csaPacket2;
|
|
} getAuthID;
|
|
|
|
struct authCacheInvalidate
|
|
{
|
|
CSA_AuthCacheInvalidateMsg_s csaPacket;
|
|
} authCacheInvalidate;
|
|
|
|
struct beastStatePurging
|
|
{
|
|
CSA_BeastStatePurgingMsg_s csaPacket;
|
|
} beastStatePurging;
|
|
|
|
struct accessLeaseOpen
|
|
{
|
|
XLSS_AccessLeaseOpenMsg_s xlssPacket;
|
|
CSA_AccessLeaseOpenMsg_s csaPacket;
|
|
} accessLeaseOpen;
|
|
|
|
struct accessLeaseClose
|
|
{
|
|
XLSS_AccessLeaseCloseMsg_s xlssPacket;
|
|
CSA_AccessLeaseCloseMsg_s csaPacket;
|
|
} accessLeaseClose;
|
|
|
|
struct accessLeaseValidate
|
|
{
|
|
CSA_AccessLeaseValidateMsg_s csaPacket;
|
|
XLSS_AccessLeaseValidateMsg_s xlssPacket;
|
|
} accessLeaseValidate;
|
|
|
|
struct sendVolStats
|
|
{
|
|
CSA_SendVolumeStatsMsg_s csaPacket;
|
|
} sendVolStats;
|
|
|
|
} body;
|
|
} xMsg_s;
|
|
|
|
/***************************************************************************/
|
|
|
|
extern void CSA_VOL_GetStorageInfoMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void CSA_VOL_GetBeastFromVolumeMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void CSA_VOL_LookupByNameInDirectoryMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void CSA_VOL_IsBlockInBeastMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void CSA_VOL_GetFileBlkMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void CSA_VOL_AsyncReadFileBlkMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void CSA_VOL_GetExtentListMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void CSA_VOL_IsDirectoryEmptyMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void CSA_VOL_GetPhysicalExtentMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void CSA_VOL_DioReadUnitsMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void CSA_VOL_WildcardLookupMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void CSA_SearchMapCleanupMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void CSA_VolNotifyMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void CSA_ReconnectNotifyMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void CSA_VolGetAuthModelIDMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void CSA_SearchMapCleanupAllMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void CSA_SearchMapReestablishMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void CSA_AccessLeaseOpenMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void CSA_AccessLeaseCloseMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void CSA_AccessLeaseCleanupAllMsg(
|
|
xMsg_s *msg);
|
|
|
|
/***************************************************************************/
|
|
|
|
extern void XLSS_VOL_NameCacheCleanupMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void XLSS_VOL_AuthCacheCleanupMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void XLSS_VolumeKeyMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void XLSS_AllSlavesSyncdMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void XLSS_BeastStatePurgingMsg(
|
|
xMsg_s *msg);
|
|
|
|
STATUS XLSS_AccessLeaseValidateMsg(
|
|
xMsg_s *msg);
|
|
|
|
extern void XLSS_SendVolumeStatsMsg(
|
|
xMsg_s *msg);
|
|
|
|
/***************************************************************************/
|
|
STATUS XLSS_BeastLeaseBreakMsg(
|
|
xMsg_s *msg);
|
|
|
|
//STATUS CSA_BeastLeaseBreakMsg(
|
|
// xMsg_s *msg);
|
|
|
|
STATUS CSA_BeastLeaseTossMsg(
|
|
xMsg_s *msg);
|
|
|
|
STATUS CSA_BeastLeaseRecreateMsg(
|
|
xMsg_s *msg);
|
|
|
|
/***************************************************************************/
|
|
|
|
typedef struct CROAccessLeaseList_s
|
|
{
|
|
DQhead_t CALL_accessLeaseHead;
|
|
Latch_s CALL_latch;
|
|
} CROAccessLeaseList_s;
|
|
|
|
|
|
typedef struct CROAccessLease_s
|
|
{
|
|
DQlink_t CAL_aLLink;
|
|
Key_t CAL_masterFHKey;
|
|
NINT CAL_fhCount;
|
|
NINT CAL_grantedRights;
|
|
LONG CAL_flags;
|
|
#define CAL_FLAG_CLOSE_IN_PROGRESS 0x0001
|
|
#define CAL_FLAG_AL_RECREATED 0x0002
|
|
} CROAccessLease_s;
|
|
|
|
BOOL CRO_ProcessErrorAndRequestRetry( GeneralMsg_s *genMsg, NINT *count, Volume_s *vol );
|
|
STATUS CRO_AccessLeaseSync( GeneralMsg_s *genMsg, Volume_s *volume, Key_t key );
|
|
STATUS CRO_AccessLeaseToss( RootBeast_s *rootBeast, CROAccessLeaseList_s *alList);
|
|
BOOL CRO_AccessLeaseValidate( NamedBeast_s *beast, Key_t masterFHKey );
|
|
|
|
/***************************************************************************/
|
|
|
|
/****************************************************************************
|
|
* Fill in the VolumeInfo received from the master in the slaves in memory
|
|
* copy of the persistent and logged persistent volume information.
|
|
***************************************************************************/
|
|
|
|
#define XLSSVOL_FillMasterVolInfo(_vol, _volInfo) \
|
|
{ \
|
|
(_vol)->VOLnumFiles = (_volInfo)->XMVI_numFiles; \
|
|
(_vol)->VOLnumObjects = (_volInfo)->XMVI_numObjects; \
|
|
(_vol)->VOLtotalBlocks = (_volInfo)->XMVI_totalBlocks; \
|
|
(_vol)->VOLinUseBlocks = (_volInfo)->XMVI_inUseBlocks; \
|
|
(_vol)->VOLpurgeableBlocks = (_volInfo)->XMVI_purgeableBlocks; \
|
|
(_vol)->VOLnumDeletedFiles = (_volInfo)->XMVI_numDeletedFiles; \
|
|
if ((_volInfo)->XMVI_enabledAttributes & zATTR_SALVAGE) \
|
|
{ \
|
|
(_vol)->VOLenabledAttributes |= zATTR_SALVAGE; \
|
|
} \
|
|
else \
|
|
{ \
|
|
(_vol)->VOLenabledAttributes &= ~zATTR_SALVAGE; \
|
|
} \
|
|
};
|
|
|
|
|
|
#define CSAVOL_FillMasterVolInfo(_vol, _volInfo) \
|
|
{ \
|
|
(_volInfo)->XMVI_numFiles = (_vol)->VOLnumFiles; \
|
|
(_volInfo)->XMVI_numObjects = (_vol)->VOLnumObjects; \
|
|
(_volInfo)->XMVI_totalBlocks = (_vol)->VOLtotalBlocks; \
|
|
(_volInfo)->XMVI_inUseBlocks = (_vol)->VOLinUseBlocks; \
|
|
(_volInfo)->XMVI_purgeableBlocks = (_vol)->VOLpurgeableBlocks; \
|
|
(_volInfo)->XMVI_numDeletedFiles = (_vol)->VOLnumDeletedFiles; \
|
|
(_volInfo)->XMVI_enabledAttributes= (_vol)->VOLenabledAttributes; \
|
|
if (((_vol)->VOLtotalBlocks << (_vol)->VOLblockShift) == zLV_NO_QUOTA_SIZE)\
|
|
{ \
|
|
if ((_vol)->v_pool != NULL) \
|
|
{ \
|
|
(_volInfo)->XMVI_totalBlocks = (_vol)->v_pool->POOLtotalBlocks; \
|
|
} \
|
|
} \
|
|
};
|
|
|
|
/***************************************************************************/
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|