139 lines
4.2 KiB
C
139 lines
4.2 KiB
C
/****************************************************************************
|
|
|
|
|
| (C) Copyright 2001 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
|
|
|
|
|
|***************************************************************************
|
|
|
|
|
| Novell Storage Services (NSS) module
|
|
|
|
|
|---------------------------------------------------------------------------
|
|
|
|
|
| $Author: randys $
|
|
| $Date: 2006-11-16 04:42:23 +0530 (Thu, 16 Nov 2006) $
|
|
|
|
|
| $RCSfile$
|
|
| $Revision: 1657 $
|
|
|
|
|
|---------------------------------------------------------------------------
|
|
| This module is used to:
|
|
+-------------------------------------------------------------------------*/
|
|
#ifndef _OBJECTIDSTORE_H_
|
|
#define _OBJECTIDSTORE_H_
|
|
|
|
/****************************************************************************
|
|
* Main object ID caching structure
|
|
*****************************************************************************/
|
|
typedef struct ObjectIDCacheCtrl_s
|
|
{
|
|
QUAD gets; /* number of times we did gets on the cache */
|
|
QUAD hits; /* number of cache hits */
|
|
Latch_s latch; /* latch to control changes in this structure */
|
|
NINT numHashEntries; /* number of entries in the has table */
|
|
DQhead_t (*hash)[]; /* pointer to hash array */
|
|
DQhead_t LRUqueue; /* head of the Least Recently Used queue */
|
|
DQhead_t unusedQueue; /* head of the unused cache packets queue */
|
|
NINT maxEntries; /* max allowed entries in the cache */
|
|
NINT numEntries; /* number of entries in the cache */
|
|
NINT numUnusedEntries; /* number of unused cache entries */
|
|
NINT numAdded; /* incremented each time an entry is added */
|
|
NINT numRemoved; /* number of entries removed (not victom selected) */
|
|
NINT numVictimSelected; /* number of entries that have been victim selected */
|
|
NINT unusedEntryHit; /* number of time we found an unused entry when adding */
|
|
NINT dupAdds; /* number of times same add occured while adding */
|
|
} ObjectIDCacheCtrl_s;
|
|
|
|
extern ObjectIDCacheCtrl_s ObjectIDCache;
|
|
|
|
#define DEFAULT_OID_CACHE_SIZE 4096
|
|
|
|
typedef struct ObjectIDCacheNode_s
|
|
{
|
|
DQlink_t hashLink; /* hash list link field */
|
|
DQlink_t LRUlink; /* LRU link field */
|
|
Zid_t volume; /* volume for the entry */
|
|
UserID_t objectID; /* the ID for the object */
|
|
} ObjectIDCacheNode_s;
|
|
|
|
/****************************************************************************
|
|
* Event queue structures
|
|
*****************************************************************************/
|
|
typedef struct EventEntry_s
|
|
{
|
|
SQlink_t next;
|
|
NINT type;
|
|
union {
|
|
struct
|
|
{
|
|
unicode_t *oldName;
|
|
unicode_t *newName;
|
|
} ren;
|
|
struct
|
|
{
|
|
// NDSid_t ndsID;
|
|
unicode_t *name;
|
|
} del;
|
|
} u;
|
|
} EventEntry_s;
|
|
|
|
#define NDS_RENAME 0
|
|
#define NDS_DELETE 1
|
|
|
|
/****************************************************************************
|
|
*
|
|
* Function Prototypes
|
|
*
|
|
****************************************************************************/
|
|
STATUS OID_Startup(void);
|
|
|
|
void OID_Shutdown(void);
|
|
|
|
STATUS OID_AddEntryIfNotThere(
|
|
struct GeneralMsg_s *genMsg,
|
|
struct Volume_s *vol,
|
|
UserID_t *objectID);
|
|
|
|
void OID_SaveObjectID(
|
|
struct Volume_s *vol,
|
|
UserID_t *objectID);
|
|
|
|
STATUS OID_GetObjectName(
|
|
struct GeneralMsg_s *genMsg,
|
|
struct Volume_s *vol,
|
|
UserID_t *objectID,
|
|
unicode_t *name);
|
|
|
|
void OID_InitObjectIDStoreByName(
|
|
struct GeneralMsg_s *genMsg,
|
|
unicode_t *name,
|
|
BOOL reset,
|
|
BOOL scan);
|
|
|
|
STATUS OID_InitObjectInfo(
|
|
struct GeneralMsg_s *genMsg,
|
|
struct Volume_s *vol);
|
|
|
|
void OID_InvalidateObjectIDCache(
|
|
Volume_s *volume);
|
|
|
|
void OID_ExportVolGUIDsToLinux(
|
|
struct GeneralMsg_s *genMsg,
|
|
struct Volume_s *volume);
|
|
|
|
#endif
|