69#define ThisHostAddr ((unsigned long)(HostAddress[ThisServerId]))
70#define VolToHostAddr(volnum) ((unsigned long)(HostAddress[(volnum) >> 24]))
71#define VolToServerId(volnum) ((uint8_t)((volnum) >> 24))
73#define ISDIR(fid) ((fid).Vnode & 1)
87#define VSLEEP(seconds) \
89 struct timeval delay; \
90 delay.tv_sec = seconds; \
92 IOMGR_Select(0, 0, 0, 0, &delay); \
95#define STREQ(a, b) (strcmp((a), (b)) == 0)
96#define STRNEQ(a, b, n) (strncmp((a), (b), (n)) == 0)
98#define SetAccessList(vptr, ACL, ACLSize) \
100 CODA_ASSERT((vptr)->disk.type == vDirectory); \
101 (ACL) = VVnodeACL((vptr)); \
102 (ACLSize) = VAclSize((vptr)); \
105#define MAXHOSTTABLEENTRIES 1000
106#define MAXNAMELENGTH 64
107#define MAXHOSTLENGTH 32
110#define EMPTYFILEBLOCKS 1
111#define EMPTYDIRBLOCKS 2
112#define EMPTYSYMLINKBLOCKS 1
139#define NEWCONNECT "NEWCONNECT"
144#define MAXCNTRS (srvOPARRAYSIZE + 17)
147#define DISCONNECT ViceDisconnectFS_OP
148#define GETATTRPLUSSHA ViceGetAttrPlusSHA_OP
149#define GETACL ViceGetACL_OP
150#define FETCH ViceFetch_OP
151#define SETACL ViceSetACL_OP
152#define REMOVECALLBACK ViceRemoveCallBack_OP
153#define SETLOCK ViceSetLock_OP
154#define RELEASELOCK ViceReleaseLock_OP
155#define GETROOTVOLUME ViceGetRootVolume_OP
156#define GETVOLUMESTAT ViceGetVolumeStatus_OP
157#define SETVOLUMESTAT ViceSetVolumeStatus_OP
158#define GETTIME ViceGetTime_OP
159#define GETSTATISTICS ViceGetStatistics_OP
160#define GETVOLUMEINFO ViceGetVolumeInfo_OP
161#define RESOLVE ViceResolve_OP
162#define REPAIR ViceRepair_OP
163#define SETVV ViceSetVV_OP
164#define REINTEGRATE ViceReintegrate_OP
165#define ALLOCFIDS ViceAllocFids_OP
166#define VALIDATEATTRSPLUSSHA ViceValidateAttrsPlusSHA_OP
167#define NEWCONNECTFS ViceNewConnectFS_OP
168#define GETVOLVS ViceGetVolVS_OP
169#define VALIDATEVOLS ViceValidateVols_OP
171#define FETCHDATAOP (srvOPARRAYSIZE + 1)
172#define FETCHDATA (srvOPARRAYSIZE + 2)
173#define FETCHD1 (srvOPARRAYSIZE + 3)
174#define FETCHD2 (srvOPARRAYSIZE + 4)
175#define FETCHD3 (srvOPARRAYSIZE + 5)
176#define FETCHD4 (srvOPARRAYSIZE + 6)
177#define FETCHD5 (srvOPARRAYSIZE + 7)
178#define FETCHTIME (srvOPARRAYSIZE + 8)
179#define STOREDATAOP (srvOPARRAYSIZE + 9)
180#define STOREDATA (srvOPARRAYSIZE + 10)
181#define STORED1 (srvOPARRAYSIZE + 11)
182#define STORED2 (srvOPARRAYSIZE + 12)
183#define STORED3 (srvOPARRAYSIZE + 13)
184#define STORED4 (srvOPARRAYSIZE + 14)
185#define STORED5 (srvOPARRAYSIZE + 15)
186#define STORETIME (srvOPARRAYSIZE + 16)
188#define SIZE2 SIZE1 * 8
189#define SIZE3 SIZE2 * 8
190#define SIZE4 SIZE3 * 8
193#define SubTimes(end, start) \
194 ((end.tv_usec > start.tv_usec) ? \
195 (((float)(end.tv_sec - start.tv_sec) * 1000) + \
196 (float)((end.tv_usec - start.tv_usec) / 1000)) : \
197 ((float)((end.tv_sec - start.tv_sec - 1) * 1000) + \
198 (float)((end.tv_usec + 1000000 - start.tv_usec) / 1000)))
202#define time_value_sub(t1, t2, t3) \
204 if ((t1).microseconds < (t2).microseconds) { \
205 (t1).microseconds += 1000000; \
208 (t3).microseconds = (t1).microseconds - (t2).microseconds; \
209 (t3).seconds = (t1).seconds - (t2).seconds; \
212#define START_TIMING(id) \
213 struct timeval start##id, end##id; \
214 if (SrvDebugLevel > 1) \
215 gettimeofday(&start##id, 0);
217#define END_TIMING(id) \
218 if (SrvDebugLevel > 1) \
219 gettimeofday(&end##id, 0); \
220 LogMsg(2, SrvDebugLevel, stdout, "%s: start:(%#x.%x) end:(%#x.%x)\n", #id, \
221 start##id.tv_sec, start##id.tv_usec, end##id.tv_sec, \
223 LogMsg(2, SrvDebugLevel, stdout, "%s: elapsed = %7.1f", #id, \
224 (float)SubTimes(end##id, start##id));
226#define START_TIMING(id)
227#define END_TIMING(id)
234extern ViceVersionVector
NullVV;
238 bool isReplicated =
true);
267thread_array_t thread_list;
271void Die(
const char *);
unsigned char uint8_t
Definition: coda.h:101
#define EXCLUDES_TRANSACTION
Definition: coda_tsa.h:108
stdout
Definition: volusage.py:12
int32_t RPC2_Integer
Definition: rpc2.h:297
RPC2_Integer RPC2_Handle
Definition: rpc2.h:345
struct HostTable HostTable
int AddChild(Volume **, dlist *, ViceFid *, char *, int=0) EXCLUDES_TRANSACTION
Definition: codaproc2.cc:2054
int AnyUserId
Definition: srv.h:253
int AllowResolution
Definition: dummy.cc:35
void DeleteCallBack(HostTable *, ViceFid *)
Definition: vicecb.cc:492
int InitCallBack()
Definition: vicecb.cc:264
int FEBlocks
Definition: vicecb.cc:87
void GetMyVS(Volume *, RPC2_CountedBS *, RPC2_Integer *, int voltype)
Definition: codaproc.cc:2520
int SystemId
Definition: srv.cc:126
unsigned int etherGoodReads
Definition: srvproc2.cc:101
const ViceFid NullFid
Definition: venusutil.cc:85
int Authenticate
Definition: srv.cc:136
int CBEBlocks
Definition: vicecb.cc:85
#define MAXNAMELENGTH
Definition: srv.h:106
void SetVSStatus(ClientEntry *, Volume *, RPC2_Integer *, CallBackStatus *, int voltype)
Definition: codaproc.cc:2557
int probingon
Definition: srv.cc:134
unsigned StartTime
Definition: srv.cc:127
int SystemUser(ClientEntry *)
Definition: srvproc.cc:982
void ViceUpdateDB()
Definition: srv.cc:975
unsigned int etherBytesRead
Definition: srvproc2.cc:102
void SetStatus(Vnode *, ViceStatus *, Rights, Rights)
Definition: srvproc.cc:696
const int MaxVols
Definition: srv.cc:131
void VPrintCacheStats(FILE *=stdout)
Definition: volume.cc:1880
int AdjustDiskUsage(Volume *, int)
Definition: srvproc.cc:987
int Counters[]
Definition: srv.cc:129
void SwapMalloc()
Definition: srv.cc:1246
void AddToCopPendingTable(ViceStoreId *, ViceFid *)
Definition: coppend.cc:50
int CurrentConnections
Definition: srv.cc:128
void ChangeDiskUsage(Volume *, int)
Definition: srvproc.cc:1026
void SwapLog(int ign)
Definition: srv.cc:1304
void Die(const char *)
Definition: dummy.cc:53
long rvm_no_yield
Definition: rvm_logrecovr.c:46
void CodaDeleteCallBack(HostTable *, ViceFid *, VolumeId)
Definition: vicecb.cc:623
unsigned int etherRetries
Definition: srvproc2.cc:99
int VCheckVLDB()
Definition: vldb.cc:74
CallBackStatus AddCallBack(HostTable *, ViceFid *)
Definition: vicecb.cc:276
int SrvDebugLevel
Definition: util.c:70
unsigned int etherBytesWritten
Definition: srvproc2.cc:103
void PrintCallBacks(ViceFid *, FILE *)
Definition: vicecb.cc:817
int GetVolObj(VolumeId, Volume **, int, int=0, unsigned=0)
Definition: volume.cc:1933
void PutVolObj(Volume **, int, int=0)
Definition: volume.cc:1991
void BreakCallBack(HostTable *, ViceFid *)
Definition: vicecb.cc:343
void DeleteFile(ViceFid *)
Definition: vicecb.cc:553
int GetRights(PRS_InternalCPS *, AL_AccessList *, int, Rights *, Rights *)
Definition: srvproc.cc:731
char * ViceErrorMsg(int)
Definition: ViceErrorMsg.c:66
struct ClientEntry ClientEntry
int GetSubTree(ViceFid *, Volume *, dlist *)
Definition: codaproc.cc:1799
int LookupChild(Volume *, Vnode *, char *, ViceFid *)
Definition: codaproc2.cc:2106
int pollandyield
Definition: srv.cc:142
int AllowSHA
Definition: srv.cc:138
ViceVersionVector NullVV
Definition: dummy.cc:41
void ViceTerminate()
Definition: srv.cc:1347
uint8_t ThisServerId
Definition: volume.cc:102
int CBEs
Definition: vicecb.cc:84
void VAdjustDiskUsage(Error *, Volume *, int)
void NewCOP1Update(Volume *, Vnode *, ViceStoreId *, RPC2_Integer *=NULL, bool isReplicated=true)
Definition: codaproc.cc:2309
bit32 HostAddress[] WARN_SINGLE_HOMING
void InitVolUtil(int stacksize) EXCLUDES_TRANSACTION
Definition: volutil.cc:76
int GetEtherStats()
Definition: srvproc2.cc:827
void PollAndYield()
Definition: dummy.cc:43
void COP2Update(Volume *, Vnode *, ViceVersionVector *)
int FEs
Definition: vicecb.cc:86
int GetFsObj(ViceFid *, Volume **, Vnode **, int, int, int, int, int) EXCLUDES_TRANSACTION
Definition: dummy.cc:60
void CodaBreakCallBack(HostTable *, ViceFid *, VolumeId)
Definition: vicecb.cc:602
const char * CodaSrvIp
Definition: dummy.cc:39
long InternalCOP2(RPC2_Handle, ViceStoreId *, ViceVersionVector *) EXCLUDES_TRANSACTION
Definition: codaproc.cc:2146
CallBackStatus CodaAddCallBack(HostTable *, ViceFid *, VolumeId)
Definition: vicecb.cc:583
void DeleteVenus(HostTable *)
Definition: vicecb.cc:536
void PrintCallBackState(FILE *)
Definition: vicecb.cc:648
int CheckDiskUsage(Volume *, int)
Definition: srvproc.cc:1005
void PrintCounters(FILE *fp=stdout)
Definition: srv.cc:1003
unsigned int etherWrites
Definition: srvproc2.cc:98
unsigned int etherInterupts
Definition: srvproc2.cc:100
struct dllist_head Clients
Definition: srv.h:126
RPC2_Integer EndTimestamp
Definition: srv.h:136
time_t LastCall
Definition: srv.h:131
RPC2_Integer Id
Definition: srv.h:128
PRS_InternalCPS * CPS
Definition: srv.h:127
RPC2_Integer LastOp
Definition: srv.h:133
HostTable * VenusId
Definition: srv.h:132
RPC2_Handle RPCid
Definition: srv.h:125
int SEType
Definition: srv.h:130
int DoUnbind
Definition: srv.h:134
char UserName[MAXNAMELENGTH]
Definition: srv.h:135
RPC2_Integer SecurityLevel
Definition: srv.h:129
time_t ActiveCall
Definition: srv.h:120
struct dllist_head Clients
Definition: srv.h:116
time_t LastCall
Definition: srv.h:119
unsigned int port
Definition: srv.h:118
struct in_addr host
Definition: srv.h:117
RPC2_Handle id
Definition: srv.h:115
struct Lock lock
Definition: srv.h:121
uint32_t bit32
Definition: voltypes.h:56
#define NULL
Definition: voltypes.h:44
bit32 Error
Definition: voltypes.h:62
bit32 HostAddress[N_SERVERIDS]
Definition: volume.cc:103