afs: more cache truncation stats
[openafs.git] / src / afs / afs.h
index db16a4a..3492627 100644 (file)
@@ -46,14 +46,19 @@ extern enum afs_shutdown_state afs_shuttingdown;
  * Macros to uniquely identify the AFS vfs struct
  */
 #define        AFS_VFSMAGIC            0x1234
-#if defined(AFS_SUN5_ENV) || defined(AFS_HPUX90_ENV) || defined(AFS_LINUX20_ENV)
-#define        AFS_VFSFSID             99
-#else
-#if defined(AFS_SGI_ENV)
-#define AFS_VFSFSID            afs_fstype
+
+#if defined(UKERNEL)
+# if defined(AFS_USR_AIX_ENV) || defined(AFS_USR_SGI_ENV)
+#  define AFS_VFSFSID          AFS_MOUNT_AFS
+# else
+#  define AFS_VFSFSID          99
+# endif
+#elif defined(AFS_SUN5_ENV) || defined(AFS_HPUX90_ENV) || defined(AFS_LINUX20_ENV)
+# define AFS_VFSFSID           99
+#elif defined(AFS_SGI_ENV)
+# define AFS_VFSFSID           afs_fstype
 #else
-#define        AFS_VFSFSID             AFS_MOUNT_AFS
-#endif
+# define AFS_VFSFSID           AFS_MOUNT_AFS
 #endif
 /* use this value for reporting total space, free space, etc.
  * fake a high number to satisfy programs that use the statfs call to make sure
@@ -104,6 +109,8 @@ extern enum afs_shutdown_state afs_shuttingdown;
 
 #define AFS_MAXCBRSCALL        32      /* max to return in a given call (must be <= AFSCBMAX) */
 #define        VCACHE_FREE     5
+#define VCACHE_DYNAMIC_STRESSED 10000
+#define VCACHE_STRESS_LOGINTERVAL (60*60*4) /* 4 hours */
 #define        AFS_NRXPACKETS  80
 #define        AFS_RXDEADTIME  50
 #define AFS_HARDDEADTIME       120
@@ -148,6 +155,7 @@ struct sysname_info {
 #define        BOP_MOVE        5        /* ptr1 afs_uspc_param ptr2 sname ptr3 dname */
 #endif
 #define BOP_PARTIAL_STORE 6     /* parm1 is chunk to store */
+#define BOP_INVALIDATE_SEGMENTS 7 /* no parms: just uses the 'bp->vc' vcache */
 
 #define        B_DONTWAIT      1       /* On failure return; don't wait */
 
@@ -1329,7 +1337,7 @@ struct afs_FetchOutput {
        avc->f.states |= CCore; /* causes close to be called later */ \
                                                                       \
        /* The cred and vnode holds will be released in afs_FlushActiveVcaches */  \
-       AFS_FAST_HOLD(avc);     /* So it won't disappear */           \
+       osi_Assert(osi_vnhold(avc) == 0);       /* So it won't disappear */        \
        CRKEEP(avc, acred); /* Should use a better place for the creds */ \
     }                                                                         \
     else {                                                                    \
@@ -1341,7 +1349,6 @@ struct afs_FetchOutput {
 
 #define        AFS_ZEROS   64          /* zero buffer */
 
-/*#define afs_DirtyPages(avc)  (((avc)->f.states & CDirty) || osi_VMDirty_p((avc)))*/
 #define        afs_DirtyPages(avc)     ((avc)->f.states & CDirty)
 
 #define afs_InReadDir(avc) (((avc)->f.states & CReadDir) && (avc)->readdir_pid == MyPidxx2Pid(MyPidxx))
@@ -1353,6 +1360,7 @@ extern afs_int32 *afs_dcnextTbl;  /*Dcache hash table links */
 extern afs_int32 afs_cacheFiles;       /*Size of afs_indexTable */
 extern afs_int32 afs_cacheBlocks;      /*1K blocks in cache */
 extern afs_int32 afs_cacheStats;       /*Stat entries in cache */
+extern afs_uint32 afs_WaitForCacheDrainCount;
 extern struct vcache *afs_vhashT[VCSIZE];      /*Stat cache hash table */
 extern struct afs_q afs_vhashTV[VCSIZE]; /* cache hash table on volume */
 extern afs_int32 afs_initState;        /*Initialization state */