2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 /* file.h - include file for the File Server */
14 /************************************************************************/
16 * Revision 2.2 90/08/29 15:12:11
19 * Revision 2.1 90/08/07 19:46:16
20 * Start with clean version to sync test and dev trees.
23 #include <afs/afssyscalls.h>
24 #include <afs/afsutil.h>
25 #include "fs_stats.h" /*Defs for xstat-based statistics */
27 #define AFS_HARDDEADTIME 120
29 typedef struct DirHandle {
30 /* device+inode+vid are low level disk addressing + validity check */
31 /* vid+vnode+unique+cacheCheck are to guarantee validity of cached copy */
32 /* ***NOTE*** size of this stucture must not exceed size in buffer
33 * package (dir/buffer.c. Also, dir/buffer uses the first int as a
34 * hash into the page hash table.
35 * ***NOTE*** The volume, device and inode numbers used to compare
36 * fids are copied out of the handle to allow the handle to be reused
37 * while pages for the old fid are still in the buffer cache.
43 afs_int32 dirh_cacheCheck;
45 IHandle_t *dirh_handle;
55 int DeleteAllCallBacks;
56 int nFEs, nCBs, nblks;
59 int GSS1, GSS2, GSS3, GSS4, GSS5;
62 #define MAXCNTRS (AFS_HIGHEST_OPCODE+1)
65 #define CONSOLENAME "opcons"
66 #define NEWCONNECT "NEWCONNECT"
68 #define FETCHDATAOP 30
76 #define STOREDATAOP 40
84 /* N.B.: the biggest "opcode" here must not be as big as VICELOWEST_OPCODE */
92 #define BIGTIME (0x7FFFFFFF) /* Should be max u_int, rather than max int */
94 struct AFSCallStatistics {
95 /* References to AFS interface calls */
98 afs_uint32 FetchStatus;
101 afs_uint32 StoreStatus;
102 afs_uint32 RemoveFile;
103 afs_uint32 CreateFile;
108 afs_uint32 RemoveDir;
110 afs_uint32 ExtendLock;
111 afs_uint32 ReleaseLock;
112 afs_uint32 GetStatistics;
113 afs_uint32 GiveUpCallBacks;
114 afs_uint32 GetVolumeInfo;
115 afs_uint32 GetVolumeStatus;
116 afs_uint32 SetVolumeStatus;
117 afs_uint32 GetRootVolume;
118 afs_uint32 CheckToken;
120 afs_uint32 GetCapabilities;
122 /* General Fetch/Store Stats */
123 afs_uint32 TotalCalls;
124 afs_uint32 TotalFetchedBytes;
125 afs_uint32 AccumFetchTime;
126 afs_uint32 FetchSize1;
127 afs_uint32 FetchSize2;
128 afs_uint32 FetchSize3;
129 afs_uint32 FetchSize4;
130 afs_uint32 FetchSize5;
131 afs_uint32 TotalStoredBytes;
132 afs_uint32 AccumStoreTime;
133 afs_uint32 StoreSize1;
134 afs_uint32 StoreSize2;
135 afs_uint32 StoreSize3;
136 afs_uint32 StoreSize4;
137 afs_uint32 StoreSize5;
141 afs_int32 BlocksAvailable;
142 afs_int32 TotalBlocks;
146 #define AFS_MSTATSPARES 8
147 #define AFS_MSTATDISKS 10
148 struct AFSStatistics {
149 afs_uint32 CurrentMsgNumber;
150 afs_uint32 OldestMsgNumber;
151 afs_uint32 CurrentTime;
153 afs_uint32 StartTime;
154 afs_int32 CurrentConnections;
155 afs_uint32 TotalAFSCalls;
156 afs_uint32 TotalFetchs;
157 afs_uint32 FetchDatas;
158 afs_uint32 FetchedBytes;
159 afs_int32 FetchDataRate;
160 afs_uint32 TotalStores;
161 afs_uint32 StoreDatas;
162 afs_uint32 StoredBytes;
163 afs_int32 StoreDataRate;
164 afs_uint32 TotalRPCBytesSent;
165 afs_uint32 TotalRPCBytesReceived;
166 afs_uint32 TotalRPCPacketsSent;
167 afs_uint32 TotalRPCPacketsReceived;
168 afs_uint32 TotalRPCPacketsLost;
169 afs_uint32 TotalRPCBogusPackets;
177 afs_int32 EtherNetTotalErrors;
178 afs_int32 EtherNetTotalWrites;
179 afs_int32 EtherNetTotalInterupts;
180 afs_int32 EtherNetGoodReads;
181 afs_int32 EtherNetTotalBytesWritten;
182 afs_int32 EtherNetTotalBytesRead;
183 afs_int32 ProcessSize;
184 afs_int32 WorkStations;
185 afs_int32 ActiveWorkStations;
186 afs_int32 Spares[AFS_MSTATSPARES];
187 struct AFSDisk Disks[AFS_MSTATDISKS];
190 extern int busyonrst;
192 #define RESTART_ORDINARY 1
193 #define RESTART_FAST 2
194 #define RESTART_SAFE 3
199 #define MAX_FILESERVER_THREAD 128 /* max number of threads in fileserver, subject to system limits */
201 #define FILESERVER_HELPER_THREADS 7 /* Listner, IOMGR, FiveMinute,
202 * HostCheck, Signal, min 2 for RXSTATS */
203 #ifdef AFS_PTHREAD_ENV
206 extern pthread_mutex_t fileproc_glock_mutex;
208 assert(pthread_mutex_lock(&fileproc_glock_mutex) == 0)
210 assert(pthread_mutex_unlock(&fileproc_glock_mutex) == 0)
211 extern pthread_mutex_t fsync_glock_mutex;
213 assert(pthread_mutex_lock(&fsync_glock_mutex) == 0)
214 #define FSYNC_UNLOCK \
215 assert(pthread_mutex_unlock(&fsync_glock_mutex) == 0)
216 #else /* AFS_PTHREAD_ENV */
221 #endif /* AFS_PTHREAD_ENV */