Coda Distributed File System
Classes | Macros | Typedefs | Functions | Variables
srv.h File Reference
#include <sys/file.h>
#include <stdio.h>
#include <errno.h>
#include <lwp/lwp.h>
#include <lwp/lock.h>
#include <rpc2/rpc2.h>
#include <rpc2/errors.h>
#include <prs.h>
#include <voltypes.h>
#include <inconsist.h>
#include <vice.h>
#include <cvnode.h>
#include <auth2.h>
#include <deprecations.h>
Include dependency graph for srv.h:

Go to the source code of this file.

Classes

struct  HostTable
 
struct  ClientEntry
 

Macros

#define ThisHostAddr   ((unsigned long)(HostAddress[ThisServerId]))
 
#define VolToHostAddr(volnum)   ((unsigned long)(HostAddress[(volnum) >> 24]))
 
#define VolToServerId(volnum)   ((uint8_t)((volnum) >> 24))
 
#define ISDIR(fid)   ((fid).Vnode & 1)
 
#define VSLEEP(seconds)
 
#define STREQ(a, b)   (strcmp((a), (b)) == 0)
 
#define STRNEQ(a, b, n)   (strncmp((a), (b), (n)) == 0)
 
#define SetAccessList(vptr, ACL, ACLSize)
 
#define MAXHOSTTABLEENTRIES   1000
 
#define MAXNAMELENGTH   64
 
#define MAXHOSTLENGTH   32
 
#define EMPTYFILEBLOCKS   1
 
#define EMPTYDIRBLOCKS   2
 
#define EMPTYSYMLINKBLOCKS   1
 
#define NEWCONNECT   "NEWCONNECT"
 
#define MAXMSG   100
 
#define MAXMSGLN   128
 
#define MAXCNTRS   (srvOPARRAYSIZE + 17)
 
#define TOTAL   0
 
#define DISCONNECT   ViceDisconnectFS_OP
 
#define GETATTRPLUSSHA   ViceGetAttrPlusSHA_OP
 
#define GETACL   ViceGetACL_OP
 
#define FETCH   ViceFetch_OP
 
#define SETACL   ViceSetACL_OP
 
#define REMOVECALLBACK   ViceRemoveCallBack_OP
 
#define SETLOCK   ViceSetLock_OP
 
#define RELEASELOCK   ViceReleaseLock_OP
 
#define GETROOTVOLUME   ViceGetRootVolume_OP
 
#define GETVOLUMESTAT   ViceGetVolumeStatus_OP
 
#define SETVOLUMESTAT   ViceSetVolumeStatus_OP
 
#define GETTIME   ViceGetTime_OP
 
#define GETSTATISTICS   ViceGetStatistics_OP
 
#define GETVOLUMEINFO   ViceGetVolumeInfo_OP
 
#define RESOLVE   ViceResolve_OP
 
#define REPAIR   ViceRepair_OP
 
#define SETVV   ViceSetVV_OP
 
#define REINTEGRATE   ViceReintegrate_OP
 
#define ALLOCFIDS   ViceAllocFids_OP
 
#define VALIDATEATTRSPLUSSHA   ViceValidateAttrsPlusSHA_OP
 
#define NEWCONNECTFS   ViceNewConnectFS_OP
 
#define GETVOLVS   ViceGetVolVS_OP
 
#define VALIDATEVOLS   ViceValidateVols_OP
 
#define FETCHDATAOP   (srvOPARRAYSIZE + 1)
 
#define FETCHDATA   (srvOPARRAYSIZE + 2)
 
#define FETCHD1   (srvOPARRAYSIZE + 3)
 
#define FETCHD2   (srvOPARRAYSIZE + 4)
 
#define FETCHD3   (srvOPARRAYSIZE + 5)
 
#define FETCHD4   (srvOPARRAYSIZE + 6)
 
#define FETCHD5   (srvOPARRAYSIZE + 7)
 
#define FETCHTIME   (srvOPARRAYSIZE + 8)
 
#define STOREDATAOP   (srvOPARRAYSIZE + 9)
 
#define STOREDATA   (srvOPARRAYSIZE + 10)
 
#define STORED1   (srvOPARRAYSIZE + 11)
 
#define STORED2   (srvOPARRAYSIZE + 12)
 
#define STORED3   (srvOPARRAYSIZE + 13)
 
#define STORED4   (srvOPARRAYSIZE + 14)
 
#define STORED5   (srvOPARRAYSIZE + 15)
 
#define STORETIME   (srvOPARRAYSIZE + 16)
 
#define SIZE1   1024
 
#define SIZE2   SIZE1 * 8
 
#define SIZE3   SIZE2 * 8
 
#define SIZE4   SIZE3 * 8
 
#define SubTimes(end, start)
 
#define time_value_sub(t1, t2, t3)
 
#define START_TIMING(id)
 
#define END_TIMING(id)
 

Typedefs

typedef struct HostTable HostTable
 
typedef struct ClientEntry ClientEntry
 

Functions

void VAdjustDiskUsage (Error *, Volume *, int)
 
int VCheckVLDB ()
 
void VPrintCacheStats (FILE *=stdout)
 
void ViceUpdateDB ()
 
void SwapLog (int ign)
 
void SwapMalloc ()
 
void ViceTerminate ()
 
char * ViceErrorMsg (int)
 
long InternalCOP2 (RPC2_Handle, ViceStoreId *, ViceVersionVector *) EXCLUDES_TRANSACTION
 
void NewCOP1Update (Volume *, Vnode *, ViceStoreId *, RPC2_Integer *=NULL, bool isReplicated=true)
 
void COP2Update (Volume *, Vnode *, ViceVersionVector *)
 
void PollAndYield ()
 
int GetSubTree (ViceFid *, Volume *, dlist *)
 
void GetMyVS (Volume *, RPC2_CountedBS *, RPC2_Integer *, int voltype)
 
void SetVSStatus (ClientEntry *, Volume *, RPC2_Integer *, CallBackStatus *, int voltype)
 
int LookupChild (Volume *, Vnode *, char *, ViceFid *)
 
int AddChild (Volume **, dlist *, ViceFid *, char *, int=0) EXCLUDES_TRANSACTION
 
void Die (const char *)
 
void SetStatus (Vnode *, ViceStatus *, Rights, Rights)
 
int GetRights (PRS_InternalCPS *, AL_AccessList *, int, Rights *, Rights *)
 
int GetFsObj (ViceFid *, Volume **, Vnode **, int, int, int, int, int) EXCLUDES_TRANSACTION
 
int SystemUser (ClientEntry *)
 
int AdjustDiskUsage (Volume *, int)
 
void ChangeDiskUsage (Volume *, int)
 
int GetVolObj (VolumeId, Volume **, int, int=0, unsigned=0)
 
void PutVolObj (Volume **, int, int=0)
 
int CheckDiskUsage (Volume *, int)
 
void PrintCounters (FILE *fp=stdout)
 
int GetEtherStats ()
 
int InitCallBack ()
 
CallBackStatus AddCallBack (HostTable *, ViceFid *)
 
void BreakCallBack (HostTable *, ViceFid *)
 
void DeleteCallBack (HostTable *, ViceFid *)
 
void DeleteVenus (HostTable *)
 
void DeleteFile (ViceFid *)
 
void PrintCallBackState (FILE *)
 
void PrintCallBacks (ViceFid *, FILE *)
 
CallBackStatus CodaAddCallBack (HostTable *, ViceFid *, VolumeId)
 
void CodaBreakCallBack (HostTable *, ViceFid *, VolumeId)
 
void CodaDeleteCallBack (HostTable *, ViceFid *, VolumeId)
 
void AddToCopPendingTable (ViceStoreId *, ViceFid *)
 
void InitVolUtil (int stacksize) EXCLUDES_TRANSACTION
 

Variables

bit32 HostAddress[] WARN_SINGLE_HOMING
 
uint8_t ThisServerId
 
long rvm_no_yield
 
ViceVersionVector NullVV
 
int SystemId
 
int AnyUserId
 
int SrvDebugLevel
 
unsigned StartTime
 
int CurrentConnections
 
int Authenticate
 
int Counters []
 
const ViceFid NullFid
 
const int MaxVols
 
int pollandyield
 
int probingon
 
const char * CodaSrvIp
 
int supported
 
unsigned int etherWrites
 
unsigned int etherRetries
 
unsigned int etherInterupts
 
unsigned int etherGoodReads
 
unsigned int etherBytesRead
 
unsigned int etherBytesWritten
 
int CBEs
 
int CBEBlocks
 
int FEs
 
int FEBlocks
 
int AllowResolution
 
int AllowSHA
 

Macro Definition Documentation

◆ ALLOCFIDS

#define ALLOCFIDS   ViceAllocFids_OP

◆ DISCONNECT

#define DISCONNECT   ViceDisconnectFS_OP

◆ EMPTYDIRBLOCKS

#define EMPTYDIRBLOCKS   2

◆ EMPTYFILEBLOCKS

#define EMPTYFILEBLOCKS   1

◆ EMPTYSYMLINKBLOCKS

#define EMPTYSYMLINKBLOCKS   1

◆ END_TIMING

#define END_TIMING (   id)

◆ FETCH

#define FETCH   ViceFetch_OP

◆ FETCHD1

#define FETCHD1   (srvOPARRAYSIZE + 3)

◆ FETCHD2

#define FETCHD2   (srvOPARRAYSIZE + 4)

◆ FETCHD3

#define FETCHD3   (srvOPARRAYSIZE + 5)

◆ FETCHD4

#define FETCHD4   (srvOPARRAYSIZE + 6)

◆ FETCHD5

#define FETCHD5   (srvOPARRAYSIZE + 7)

◆ FETCHDATA

#define FETCHDATA   (srvOPARRAYSIZE + 2)

◆ FETCHDATAOP

#define FETCHDATAOP   (srvOPARRAYSIZE + 1)

◆ FETCHTIME

#define FETCHTIME   (srvOPARRAYSIZE + 8)

◆ GETACL

#define GETACL   ViceGetACL_OP

◆ GETATTRPLUSSHA

#define GETATTRPLUSSHA   ViceGetAttrPlusSHA_OP

◆ GETROOTVOLUME

#define GETROOTVOLUME   ViceGetRootVolume_OP

◆ GETSTATISTICS

#define GETSTATISTICS   ViceGetStatistics_OP

◆ GETTIME

#define GETTIME   ViceGetTime_OP

◆ GETVOLUMEINFO

#define GETVOLUMEINFO   ViceGetVolumeInfo_OP

◆ GETVOLUMESTAT

#define GETVOLUMESTAT   ViceGetVolumeStatus_OP

◆ GETVOLVS

#define GETVOLVS   ViceGetVolVS_OP

◆ ISDIR

#define ISDIR (   fid)    ((fid).Vnode & 1)

◆ MAXCNTRS

#define MAXCNTRS   (srvOPARRAYSIZE + 17)

◆ MAXHOSTLENGTH

#define MAXHOSTLENGTH   32

◆ MAXHOSTTABLEENTRIES

#define MAXHOSTTABLEENTRIES   1000

◆ MAXMSG

#define MAXMSG   100

◆ MAXMSGLN

#define MAXMSGLN   128

◆ MAXNAMELENGTH

#define MAXNAMELENGTH   64

◆ NEWCONNECT

#define NEWCONNECT   "NEWCONNECT"

◆ NEWCONNECTFS

#define NEWCONNECTFS   ViceNewConnectFS_OP

◆ REINTEGRATE

#define REINTEGRATE   ViceReintegrate_OP

◆ RELEASELOCK

#define RELEASELOCK   ViceReleaseLock_OP

◆ REMOVECALLBACK

#define REMOVECALLBACK   ViceRemoveCallBack_OP

◆ REPAIR

#define REPAIR   ViceRepair_OP

◆ RESOLVE

#define RESOLVE   ViceResolve_OP

◆ SetAccessList

#define SetAccessList (   vptr,
  ACL,
  ACLSize 
)
Value:
{ \
CODA_ASSERT((vptr)->disk.type == vDirectory); \
(ACL) = VVnodeACL((vptr)); \
(ACLSize) = VAclSize((vptr)); \
}
#define vDirectory
Definition: cvnode.h:60
#define VVnodeACL(vnp)
Definition: cvnode.h:192
#define VAclSize(vnp)
Definition: cvnode.h:194

◆ SETACL

#define SETACL   ViceSetACL_OP

◆ SETLOCK

#define SETLOCK   ViceSetLock_OP

◆ SETVOLUMESTAT

#define SETVOLUMESTAT   ViceSetVolumeStatus_OP

◆ SETVV

#define SETVV   ViceSetVV_OP

◆ SIZE1

#define SIZE1   1024

◆ SIZE2

#define SIZE2   SIZE1 * 8

◆ SIZE3

#define SIZE3   SIZE2 * 8

◆ SIZE4

#define SIZE4   SIZE3 * 8

◆ START_TIMING

#define START_TIMING (   id)

◆ STORED1

#define STORED1   (srvOPARRAYSIZE + 11)

◆ STORED2

#define STORED2   (srvOPARRAYSIZE + 12)

◆ STORED3

#define STORED3   (srvOPARRAYSIZE + 13)

◆ STORED4

#define STORED4   (srvOPARRAYSIZE + 14)

◆ STORED5

#define STORED5   (srvOPARRAYSIZE + 15)

◆ STOREDATA

#define STOREDATA   (srvOPARRAYSIZE + 10)

◆ STOREDATAOP

#define STOREDATAOP   (srvOPARRAYSIZE + 9)

◆ STORETIME

#define STORETIME   (srvOPARRAYSIZE + 16)

◆ STREQ

#define STREQ (   a,
 
)    (strcmp((a), (b)) == 0)

◆ STRNEQ

#define STRNEQ (   a,
  b,
 
)    (strncmp((a), (b), (n)) == 0)

◆ SubTimes

#define SubTimes (   end,
  start 
)
Value:
((end.tv_usec > start.tv_usec) ? \
(((float)(end.tv_sec - start.tv_sec) * 1000) + \
(float)((end.tv_usec - start.tv_usec) / 1000)) : \
((float)((end.tv_sec - start.tv_sec - 1) * 1000) + \
(float)((end.tv_usec + 1000000 - start.tv_usec) / 1000)))

◆ ThisHostAddr

#define ThisHostAddr   ((unsigned long)(HostAddress[ThisServerId]))

◆ time_value_sub

#define time_value_sub (   t1,
  t2,
  t3 
)
Value:
{ \
if ((t1).microseconds < (t2).microseconds) { \
(t1).microseconds += 1000000; \
(t1).seconds -= 1; \
} \
(t3).microseconds = (t1).microseconds - (t2).microseconds; \
(t3).seconds = (t1).seconds - (t2).seconds; \
}
rvm_tid_t * t1
Definition: testrvm.c:42
rvm_tid_t * t3
Definition: testrvm.c:42
rvm_tid_t * t2
Definition: testrvm.c:42

◆ TOTAL

#define TOTAL   0

◆ VALIDATEATTRSPLUSSHA

#define VALIDATEATTRSPLUSSHA   ViceValidateAttrsPlusSHA_OP

◆ VALIDATEVOLS

#define VALIDATEVOLS   ViceValidateVols_OP

◆ VolToHostAddr

#define VolToHostAddr (   volnum)    ((unsigned long)(HostAddress[(volnum) >> 24]))

◆ VolToServerId

#define VolToServerId (   volnum)    ((uint8_t)((volnum) >> 24))

◆ VSLEEP

#define VSLEEP (   seconds)
Value:
{ \
struct timeval delay; \
delay.tv_sec = seconds; \
delay.tv_usec = 0; \
IOMGR_Select(0, 0, 0, 0, &delay); \
}

Typedef Documentation

◆ ClientEntry

typedef struct ClientEntry ClientEntry

◆ HostTable

typedef struct HostTable HostTable

Function Documentation

◆ AddCallBack()

CallBackStatus AddCallBack ( HostTable client,
ViceFid *  afid 
)

◆ AddChild()

int AddChild ( Volume **  volptr,
dlist vlist,
ViceFid *  Did,
char *  Name,
int  IgnoreInc = 0 
)

◆ AddToCopPendingTable()

void AddToCopPendingTable ( ViceStoreId *  stid,
ViceFid *  fids 
)

◆ AdjustDiskUsage()

int AdjustDiskUsage ( Volume volptr,
int  length 
)

◆ BreakCallBack()

void BreakCallBack ( HostTable client,
ViceFid *  afid 
)

◆ ChangeDiskUsage()

void ChangeDiskUsage ( Volume volptr,
int  length 
)

◆ CheckDiskUsage()

int CheckDiskUsage ( Volume volptr,
int  length 
)

◆ CodaAddCallBack()

CallBackStatus CodaAddCallBack ( HostTable VenusId,
ViceFid *  Fid,
VolumeId  VSGVolnum 
)

◆ CodaBreakCallBack()

void CodaBreakCallBack ( HostTable VenusId,
ViceFid *  Fid,
VolumeId  VSGVolnum 
)

◆ CodaDeleteCallBack()

void CodaDeleteCallBack ( HostTable VenusId,
ViceFid *  Fid,
VolumeId  VSGVolnum 
)

◆ COP2Update()

void COP2Update ( Volume ,
Vnode ,
ViceVersionVector *   
)

◆ DeleteCallBack()

void DeleteCallBack ( HostTable client,
ViceFid *  afid 
)

◆ DeleteFile()

void DeleteFile ( ViceFid *  afid)

◆ DeleteVenus()

void DeleteVenus ( HostTable client)

◆ Die()

void Die ( const char *  msg)

◆ GetEtherStats()

int GetEtherStats ( )

◆ GetFsObj()

int GetFsObj ( ViceFid *  fid,
Volume **  volptr,
Vnode **  vptr,
int  lock,
int  VolumeLock,
int  ignoreIncon,
int  ignoreBQ,
int  getdirhandle 
)

◆ GetMyVS()

void GetMyVS ( Volume volptr,
RPC2_CountedBS VSList,
RPC2_Integer MyVS,
int  voltype 
)

◆ GetRights()

int GetRights ( PRS_InternalCPS CPS,
AL_AccessList ACL,
int  ACLSize,
Rights *  rights,
Rights *  anyrights 
)

◆ GetSubTree()

int GetSubTree ( ViceFid *  fid,
Volume volptr,
dlist vlist 
)

◆ GetVolObj()

int GetVolObj ( VolumeId  Vid,
Volume **  volptr,
int  LockLevel,
int  Enque = 0,
unsigned  LockerAddress = 0 
)

◆ InitCallBack()

int InitCallBack ( )

◆ InitVolUtil()

void InitVolUtil ( int  stacksize)

◆ InternalCOP2()

long InternalCOP2 ( RPC2_Handle  cid,
ViceStoreId *  StoreId,
ViceVersionVector *  UpdateSet 
)

◆ LookupChild()

int LookupChild ( Volume volptr,
Vnode vptr,
char *  Name,
ViceFid *  Fid 
)

◆ NewCOP1Update()

void NewCOP1Update ( Volume volptr,
Vnode vptr,
ViceStoreId *  StoreId,
RPC2_Integer vsptr = NULL,
bool  isReplicated = true 
)

◆ PollAndYield()

void PollAndYield ( )

◆ PrintCallBacks()

void PrintCallBacks ( ViceFid *  fid,
FILE *  fp 
)

◆ PrintCallBackState()

void PrintCallBackState ( FILE *  fp)

◆ PrintCounters()

void PrintCounters ( FILE *  fp = stdout)

◆ PutVolObj()

void PutVolObj ( Volume **  volptr,
int  LockLevel,
int  Dequeue = 0 
)

◆ SetStatus()

void SetStatus ( Vnode vptr,
ViceStatus *  status,
Rights  rights,
Rights  anyrights 
)

◆ SetVSStatus()

void SetVSStatus ( ClientEntry client,
Volume volptr,
RPC2_Integer NewVS,
CallBackStatus *  VCBStatus,
int  voltype 
)

◆ SwapLog()

void SwapLog ( int  ign)

◆ SwapMalloc()

void SwapMalloc ( )

◆ SystemUser()

int SystemUser ( ClientEntry client)

◆ VAdjustDiskUsage()

void VAdjustDiskUsage ( Error ,
Volume ,
int   
)

◆ VCheckVLDB()

int VCheckVLDB ( )

◆ ViceErrorMsg()

char * ViceErrorMsg ( int  errorCode)

◆ ViceTerminate()

void ViceTerminate ( )

◆ ViceUpdateDB()

void ViceUpdateDB ( )

◆ VPrintCacheStats()

void VPrintCacheStats ( FILE *  fp = stdout)

Variable Documentation

◆ AllowResolution

int AllowResolution
extern

◆ AllowSHA

int AllowSHA
extern

◆ AnyUserId

int AnyUserId

◆ Authenticate

int Authenticate
extern

◆ CBEBlocks

int CBEBlocks
extern

◆ CBEs

int CBEs
extern

◆ CodaSrvIp

const char* CodaSrvIp
extern

◆ Counters

int Counters[]
extern

◆ CurrentConnections

int CurrentConnections
extern

◆ etherBytesRead

unsigned int etherBytesRead
extern

◆ etherBytesWritten

unsigned int etherBytesWritten
extern

◆ etherGoodReads

unsigned int etherGoodReads
extern

◆ etherInterupts

unsigned int etherInterupts
extern

◆ etherRetries

unsigned int etherRetries
extern

◆ etherWrites

unsigned int etherWrites
extern

◆ FEBlocks

int FEBlocks
extern

◆ FEs

int FEs
extern

◆ MaxVols

const int MaxVols
extern

◆ NullFid

const ViceFid NullFid
extern

◆ NullVV

ViceVersionVector NullVV
extern

◆ pollandyield

int pollandyield
extern

◆ probingon

int probingon
extern

◆ rvm_no_yield

long rvm_no_yield
extern

◆ SrvDebugLevel

int SrvDebugLevel
extern

◆ StartTime

unsigned StartTime
extern

◆ supported

int supported
extern

◆ SystemId

int SystemId
extern

◆ ThisServerId

uint8_t ThisServerId
extern

◆ WARN_SINGLE_HOMING

bit32 HostAddress [] WARN_SINGLE_HOMING
extern