Files
mars-nwe/include/nwfs/adminVolume.h

237 lines
7.1 KiB
C

/****************************************************************************
|
| (C) Copyright 1995-1998 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 Advance File Services (NSS) module
|
|---------------------------------------------------------------------------
|
| $Author: taysom $
| $Date: 2004-12-31 01:10:58 +0530 (Fri, 31 Dec 2004) $
|
| $RCSfile$
| $Revision: 465 $
|
|---------------------------------------------------------------------------
| This module is used to:
| Support routines for processing legacy operations by NCPs and NLMs
+-------------------------------------------------------------------------*/
#ifndef _ADMINVOLUME_H_
#define _ADMINVOLUME_H_
#include <xUnicode.h>
#ifndef _QUE_H_
#include <que.h>
#endif
#ifndef _VOLUME_H_
#include "volume.h"
#endif
#ifndef _XADMINVOLUME_H_
#include "xAdminVolume.h"
#endif
/* Pre-define struct(s) so Linux compiler doesn't complain */
struct PCLSwitchDef_s;
#define AVOL_BLOCK_SHIFT 12 /* has 4K blocks */
#define AVOL_DEFAULT_NUM_BLOCKS 1024 /* has 1meg worth of blocks */
#define AVOL_MAX_BEAST_SIZE 4096 /* the biggest beast allowed */
#define AVOL_REALLOC_AMOUNT 8 /* number of block entries to be added on a realloc */
typedef enum adminStorageState_e
{
INIT_STATE = 0,
PERSIST_DATA = 1,
} adminStorageState_e;
typedef struct AdminVolStorageInfo_s
{
StorageInfo_s comnInfo;
adminStorageState_e state;
NINT numBlocks;
NINT numEntriesAlloced;
union
{
BYTE *memBlocks[1];
Blknum_t diskBlocks[1];
} u;
} AdminVolStorageInfo_s;
/****************************************************************************
* ADMIN VOLUME Beast
*
* All of the definitions specific to the admin volume
*****************************************************************************/
typedef struct AdminVolume_s
{
Volume_s vol; /* derived from a volume*/
Zid_t nextZID; /* next ZID to allocate*/
} AdminVolume_s;
#define AVOLroot vol.avfile.file.auth.named.root
#define AVOLnamed vol.avfile.file.auth.named
#define AVOLauth vol.avfile.file.auth
#define AVOLfile vol.avfile.file
#define AVOLavfile vol.avfile
#define AVOLvol vol
#define AVOLzid AVOLroot.zid
#define AVOLbeastClass AVOLroot.beastClass
#define AVOLbeastLatch AVOLroot.mycache.agent.latch
#define AVOLuseCount AVOLroot.useCount
#define AVOLcomnBeastOps AVOLbeastClass->comnOps
#define AVOLcomnVolOps AVOLbeastClass->comnVolOps
#define AVOLfirstParentZid AVOLnamed.firstParent.p.zid
#define AVOLrootdir AVOLvol.rootdir
#define AVOLbeastList AVOLvol.beastList
#define AVOLauthModel AVOLvol.authModel
#define AVOLauthModelIndex AVOLvol.authModelIndex
#define AVOLstate AVOLvol.state
#define AVOLagent AVOLvol.agent
#define AVOLstorageIndex AVOLvol.storageIndex
#define AVOLmaxBeastSize AVOLvol.maxBeastSize
#define AVOLsupportedAttributes AVOLvol.supportedAttributes
#define AVOLmaximumFileSize AVOLvol.maximumFileSize
#define AVOLvolumeID AVOLvol.VOLvolumeID
#define AVOLnameSpaceMask AVOLvol.p.nameSpaceMask
#define AVOLblockSize AVOLvol.p.blockSize
#define AVOLblockShift AVOLvol.p.blockShift
#define AVOLenabledAttributes AVOLvol.p.enabledAttributes
#define AVOLnextZid AVOLvol.logged.nextZid
#define AVOLtotalBlocks AVOLvol.logged.totalBlocks
#define AVOLinUseBlocks AVOLvol.logged.inUseBlocks
#define AVOLnumFiles AVOLvol.logged.numFiles
#define AVOLnumObjects AVOLvol.logged.numObjects
/****************************************************************************
* Globals
*****************************************************************************/
/*---------------------------------------------------------------------------
* Defines the admin volume for the system
*---------------------------------------------------------------------------*/
extern AdminVolume_s AdminVolume;
extern Volume_s *PersistAdminVolume;
extern Key_t SwapRootKey;
extern Key_t SwapKey;
extern BOOL AdminVolumeIsUsable;
/*---------------------------------------------------------------------------
* Well Known ZIDs for the Admin Volume's first level directories
*---------------------------------------------------------------------------*/
//#define ADMVOL_STORAGE_POOL_ZID (zINVALID_ZID+3) /* Directory for all physical storage */
STATUS ADMINVOL_InitPersistentStorage(
struct GeneralMsg_s *genMsg);
File_s *COMN_AVOL_ResolveLink(
struct GeneralMsg_s *genMsg,
struct NamedBeast_s *beast);
void AVOL_PolicySetLoadTimeActivateVolume(
struct PCLSwitchDef_s *switchDef,
NINT index,
void *userParm);
void AVOL_PolicySetLoadTimeDeactivateVolume(
struct PCLSwitchDef_s *switchDef,
NINT index,
void *userParm);
void AVOL_PolicySetLoadTimeVerifyVolume(
struct PCLSwitchDef_s *switchDef,
NINT index,
void *userParm);
NINT AVOL_PolicyObtainLoadTimeVolumeState(
Volume_s *volume );
//NINT AVOL_PolicyObtainLoadTimeVerify(
// Volume_s *volume );
void AVOL_PolicySetLoadTimeActivatePool(
struct PCLSwitchDef_s *switchDef,
NINT index,
void *userParm);
void AVOL_PolicySetLoadTimeDeactivatePool(
struct PCLSwitchDef_s *switchDef,
NINT index,
void *userParm);
void AVOL_PolicySetLoadTimeMaintenancePool(
struct PCLSwitchDef_s *switchDef,
NINT index,
void *userParm);
void AVOL_PolicyDisplayLoadTimePool(
struct PCLSwitchDef_s *switchDef,
NINT index,
void *userParm);
void AVOL_PolicyDisplayLoadTimeVolume(
struct PCLSwitchDef_s *switchDef,
NINT index,
void *userParm);
void AVOL_PolicySetLoadTimeVerifyPool(
struct PCLSwitchDef_s *switchDef,
NINT index,
void *userParm);
NINT AVOL_PolicyObtainLoadTimePoolState(
Pool_s *volume,
BOOL verbose );
NINT AVOL_PolicyObtainLoadTimeVerifyPool(
Pool_s *volume );
void AVOL_PolicyShutdown();
void AVOL_PolicyStartup();
extern unicode_t *AVOL_PolicyLoadTimeDeactivePool;
extern unicode_t *AVOL_PolicyLoadTimeMaintenancePool;
extern unicode_t *AVOL_PolicyLoadTimeVerifyPool;
extern unicode_t *AVOL_PolicyLoadTimeActivePool;
extern unicode_t *AVOL_PolicyLoadTimeDeactivePoolPolicyDefault;
extern unicode_t *AVOL_PolicyLoadTimeMaintenancePoolPolicyDefault;
extern unicode_t *AVOL_PolicyLoadTimeVerifyPoolPolicyDefault;
extern unicode_t *AVOL_PolicyLoadTimeActivePoolPolicyDefault;
extern unicode_t *AVOL_PolicyLoadTimeDeactiveVolume;
extern unicode_t *AVOL_PolicyLoadTimeActiveVolume;
extern unicode_t *AVOL_PolicyLoadTimeDeactiveVolumePolicyDefault;
extern unicode_t *AVOL_PolicyLoadTimeActiveVolumePolicyDefault;
#endif /* _ADMINVOLUME_H_ */