afs: remove dead ICL (fstrace) code
[openafs.git] / src / afs / afs_prototypes.h
index 11d49fc..9274d15 100644 (file)
@@ -26,19 +26,11 @@ extern void afs_FreeAllAxs(struct axscache **headp);
 extern void shutdown_xscache(void);
 
 /* afs_buffer.c */
-extern void DInit(int abuffers);
-extern void *DRead(struct dcache * fid, int page);
-extern int DVOffset(void *ap);
-extern void DZap(struct dcache * fid);
-extern void DFlush(void);
-extern void DFlushDCache(struct dcache *);
-extern void *DNew(struct dcache * fid, int page);
 extern void shutdown_bufferpackage(void);
 
 /* afs_call.c */
 extern int afs_cold_shutdown;
-extern afs_int32 afs_setTime;
-extern char afs_rootVolumeName[64];
+extern char afs_rootVolumeName[MAXROOTVOLNAMELEN];
 extern void afs_shutdown(void);
 extern void afs_FlushCBs(void);
 extern int afs_CheckInit(void);
@@ -63,7 +55,7 @@ extern afs_int32 afs_evenZaps;
 extern afs_int32 afs_connectBacks;
 extern unsigned long lastCallBack_vnode;
 extern unsigned int lastCallBack_dv;
-extern osi_timeval_t lastCallBack_time;
+extern osi_timeval32_t lastCallBack_time;
 extern struct interfaceAddr afs_cb_interface;
 
 extern int afs_RXCallBackServer(void);
@@ -182,17 +174,19 @@ extern struct afs_conn *afs_Conn(struct VenusFid *afid,
 extern struct afs_conn *afs_ConnBySA(struct srvAddr *sap, unsigned short aport,
                                 afs_int32 acell, struct unixuser *tu,
                                 int force_if_down, afs_int32 create,
-                                afs_int32 locktype,
+                                afs_int32 locktype, afs_int32 replicated,
                                 struct rx_connection **rxconn);
 extern struct afs_conn *afs_ConnByMHosts(struct server *ahosts[],
                                     unsigned short aport, afs_int32 acell,
                                     struct vrequest *areq,
                                     afs_int32 locktype,
+                                    afs_int32 replicated,
                                     struct rx_connection **rxconn);
 extern struct afs_conn *afs_ConnByHost(struct server *aserver,
                                   unsigned short aport, afs_int32 acell,
                                   struct vrequest *areq, int aforce,
                                   afs_int32 locktype,
+                                  afs_int32 replicated,
                                   struct rx_connection **rxconn);
 extern void afs_PutConn(struct afs_conn *ac, struct rx_connection *rxconn,
                         afs_int32 locktype);
@@ -227,7 +221,7 @@ extern int afs_CheckRootVolume(void);
 extern void afs_BRelease(struct brequest *ab);
 extern int afs_BBusy(void);
 extern int afs_BioDaemon(afs_int32 nbiods);
-#ifdef AFS_DARWIN80_ENV
+#ifdef AFS_NEW_BKG
 extern int afs_BackgroundDaemon(struct afs_uspc_param *uspc, void *param1, void *param2);
 #else
 extern void afs_BackgroundDaemon(void);
@@ -251,15 +245,16 @@ extern unsigned char *afs_indexFlags;
 extern struct afs_cacheOps *afs_cacheType;
 extern afs_dcache_id_t cacheInode;
 extern struct osi_file *afs_cacheInodep;
-extern void afs_dcacheInit(int afiles, int ablocks, int aDentries, int achunk,
-                          int aflags);
+extern int DCHash(struct VenusFid *fid, afs_int32 chunk);
+extern int DVHash(struct VenusFid *fid);
+extern int afs_dcacheInit(int afiles, int ablocks, int aDentries, int achunk,
+                         int aflags);
 extern int afs_PutDCache(struct dcache *adc);
 extern void afs_FlushDCache(struct dcache *adc);
 extern void shutdown_dcache(void);
 extern void afs_CacheTruncateDaemon(void);
 extern afs_int32 afs_fsfragsize;
-extern struct dcache *afs_MemGetDSlot(afs_int32 aslot,
-                                     struct dcache *tmpdc);
+extern struct dcache *afs_MemGetDSlot(afs_int32 aslot, dslot_state type);
 extern struct dcache *afs_GetDCache(struct vcache *avc,
                                    afs_size_t abyte,
                                    struct vrequest *areq,
@@ -270,6 +265,7 @@ extern struct dcache *afs_FindDCache(struct vcache *avc,
 extern void afs_StoreWarn(afs_int32 acode, afs_int32 avolume,
                          afs_int32 aflags);
 extern void afs_MaybeWakeupTruncateDaemon(void);
+extern void afs_MaybeWaitForCacheDrain(void);
 extern void afs_CacheTruncateDaemon(void);
 extern void afs_AdjustSize(struct dcache *adc,
                           afs_int32 newSize);
@@ -280,9 +276,8 @@ extern void afs_TryToSmush(struct vcache *avc,
                           afs_ucred_t *acred, int sync);
 extern void updateV2DC(int lockVc, struct vcache *v, struct dcache *d,
                       int src);
-extern void afs_WriteThroughDSlots(void);
-extern struct dcache *afs_UFSGetDSlot(afs_int32 aslot,
-                                     struct dcache *tmpdc);
+extern int afs_WriteThroughDSlots(void);
+extern struct dcache *afs_UFSGetDSlot(afs_int32 aslot, dslot_state type);
 extern int afs_WriteDCache(struct dcache *adc, int atime);
 extern int afs_wakeup(struct vcache *avc);
 extern int afs_InitCacheFile(char *afile, ino_t ainode);
@@ -294,10 +289,14 @@ extern struct dcache *afs_ObtainDCacheForWriting(struct vcache *avc,
                                                 int noLock);
 extern void afs_PopulateDCache(struct vcache *avc, afs_size_t apos,
                               struct vrequest *areq);
+extern int afs_IsDCacheFresh(struct dcache *adc, struct vcache *avc);
 
 /* afs_disconnected.c */
 
 /* afs_dynroot.c */
+extern afs_rwlock_t afs_dynrootDirLock;
+extern afs_rwlock_t afs_dynSymlinkLock;
+extern int afs_IsDynrootVolume(struct volume *v);
 extern int afs_IsDynrootFid(struct VenusFid *fid);
 extern int afs_IsDynrootMountFid(struct VenusFid *fid);
 extern int afs_IsDynrootAnyFid(struct VenusFid *fid);
@@ -321,6 +320,7 @@ extern int afs_DynrootVOPRemove(struct vcache *avc, afs_ucred_t *acred,
                                char *aname);
 extern int afs_DynrootVOPSymlink(struct vcache *avc, afs_ucred_t *acred,
                                 char *aname, char *atargetName);
+extern void shutdown_dynroot(void);
 
 /* afs_error.c */
 extern void init_et_to_sys_error(void);
@@ -359,10 +359,7 @@ extern int afs_icl_CreateLogWithFlags(char *name, afs_int32 logSize,
 extern int afs_icl_CopyOut(struct afs_icl_log *logp,
                           afs_int32 * bufferp, afs_int32 * bufSizep,
                           afs_uint32 * cookiep, afs_int32 * flagsp);
-extern int afs_icl_GetLogParms(struct afs_icl_log *logp, afs_int32 * maxSizep,
-                              afs_int32 * curSizep);
 extern int afs_icl_LogHold(struct afs_icl_log *logp);
-extern int afs_icl_LogHoldNL(struct afs_icl_log *logp);
 extern int afs_icl_LogUse(struct afs_icl_log *logp);
 extern int afs_icl_LogFreeUse(struct afs_icl_log *logp);
 extern int afs_icl_LogSetSize(struct afs_icl_log *logp,
@@ -373,11 +370,6 @@ extern int afs_icl_LogReleNL(struct afs_icl_log *logp);
 extern int afs_icl_ZeroLog(struct afs_icl_log *logp);
 extern int afs_icl_LogFree(struct afs_icl_log *logp);
 extern struct afs_icl_log *afs_icl_FindLog(char *name);
-extern int
-  afs_icl_EnumerateLogs(int (*aproc)
-
-                         (char *name, char *arock, struct afs_icl_log * tp),
-                       char *arock);
 extern int afs_icl_CreateSet(char *name, struct afs_icl_log *baseLogp,
                             struct afs_icl_log *fatalLogp,
                             struct afs_icl_set **outSetpp);
@@ -386,18 +378,7 @@ extern int afs_icl_CreateSetWithFlags(char *name,
                                      struct afs_icl_log *fatalLogp,
                                      afs_uint32 flags,
                                      struct afs_icl_set **outSetpp);
-extern int afs_icl_SetEnable(struct afs_icl_set *setp, afs_int32 eventID,
-                            int setValue);
-extern int afs_icl_GetEnable(struct afs_icl_set *setp, afs_int32 eventID,
-                            int *getValuep);
 extern int afs_icl_ZeroSet(struct afs_icl_set *setp);
-extern int
-  afs_icl_EnumerateSets(int (*aproc)
-
-                         (char *name, char *arock, struct afs_icl_log * tp),
-                       char *arock);
-extern int afs_icl_AddLogToSet(struct afs_icl_set *setp,
-                              struct afs_icl_log *newlogp);
 extern int afs_icl_SetSetStat(struct afs_icl_set *setp, int op);
 extern int afs_icl_SetHold(struct afs_icl_set *setp);
 extern int afs_icl_ZapSet(struct afs_icl_set *setp);
@@ -421,8 +402,13 @@ extern int afs_icl_Event0(struct afs_icl_set *setp,
 extern void afs_icl_AppendRecord(struct afs_icl_log *logp,
                                 afs_int32 op, afs_int32 types, long p1,
                                 long p2, long p3, long p4);
+#if defined(AFS_NBSD_ENV)
+extern int Afscall_icl(long opcode, long p1, long p2, long p3, long p4,
+                      register_t *retval);
+#else
 extern int Afscall_icl(long opcode, long p1, long p2, long p3, long p4,
                       long *retval);
+#endif
 #ifdef AFS_DARWIN100_ENV
 extern int Afscall64_icl(int opcode, user_addr_t p1, user_addr_t p2,
                       user_addr_t p3, user_addr_t p4, int *retval);
@@ -443,6 +429,7 @@ extern int afs_CacheInit(afs_int32 astatSize, afs_int32 afiles,
                         afs_int32 aflags, afs_int32 ninodes,
                         afs_int32 nusers, afs_int32 dynamic_vcaches);
 extern void afs_ComputeCacheParms(void);
+extern void afs_InitFHeader(struct afs_fheader *aheader);
 extern int afs_InitCacheInfo(char *afile);
 extern int afs_InitVolumeInfo(char *afile);
 extern int afs_InitCellInfo(char *afile);
@@ -469,13 +456,6 @@ extern void afs_osi_SleepW(char *addr,
                           struct afs_lock *alock);
 extern void afs_osi_SleepS(char *addr,
                           struct afs_lock *alock);
-#ifndef AFS_NOBOZO_LOCK
-extern void afs_BozonLock(struct afs_bozoLock *alock, struct vcache *avc);
-extern void afs_BozonUnlock(struct afs_bozoLock *alock, struct vcache *avc);
-extern void afs_BozonInit(struct afs_bozoLock *alock, struct vcache *avc);
-extern int afs_CheckBozonLock(struct afs_bozoLock *alock);
-extern int afs_CheckBozonLockBlocking(struct afs_bozoLock *alock);
-#endif
 
 
 
@@ -506,7 +486,8 @@ extern int afs_CacheFetchProc(struct afs_conn *tc, struct rx_connection *rxconn,
                                 struct osi_file *fP,
                                afs_size_t abase, struct dcache *adc,
                                struct vcache *avc, afs_int32 size,
-                               struct afs_FetchOutput *tsmall);
+                               struct afs_FetchOutput *tsmall)
+                               AFS_NONNULL((5));
 
 /* afs_memcache.c */
 extern int afs_InitMemCache(int blkCount, int blkSize, int flags);
@@ -552,7 +533,8 @@ extern void afs_osi_RxkRegister(void);
 extern void afs_osi_Invisible(void);
 extern void shutdown_osi(void);
 extern void shutdown_osinet(void);
-extern int afs_osi_suser(void *credp);
+extern void shutdown_osisleep(void);
+extern int afs_osi_suser(afs_ucred_t *credp);
 extern void afs_osi_TraverseProcTable(void);
 #if defined(KERNEL) && !defined(UKERNEL)
 extern const afs_ucred_t *afs_osi_proc2cred(afs_proc_t * pr);
@@ -582,6 +564,8 @@ extern void shutdown_osinet(void);
 extern int afs_setpag(afs_ucred_t **credpp);
 #elif defined(AFS_FBSD_ENV)
 extern int afs_setpag(struct thread *td, void *args);
+#elif defined(AFS_NBSD_ENV)
+extern int afs_setpag(afs_proc_t *p, const void *args, register_t *retval);
 #elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
 extern int afs_setpag(afs_proc_t *p, void *args, int *retval);
 #else
@@ -598,14 +582,21 @@ extern int AddPag(afs_proc_t *p, afs_int32 aval, afs_ucred_t **credpp);
 extern int AddPag(afs_int32 aval, afs_ucred_t **credpp);
 #endif
 extern int afs_InitReq(struct vrequest *av, afs_ucred_t *acred);
+extern int afs_CreateReq(struct vrequest **avpp, afs_ucred_t *acred);
+extern void afs_DestroyReq(struct vrequest *av);
 extern afs_uint32 afs_get_pag_from_groups(gid_t g0a, gid_t g1a);
 extern void afs_get_groups_from_pag(afs_uint32 pag, gid_t * g0p, gid_t * g1p);
 extern afs_int32 PagInCred(afs_ucred_t *cred);
 
 /* afs_osi_uio.c */
+#if !defined(AFS_DARWIN80_ENV)
 extern int afsio_copy(struct uio *ainuio, struct uio *aoutuio,
                      struct iovec *aoutvec);
 extern int afsio_trim(struct uio *auio, afs_int32 asize);
+extern void afsio_free(struct uio *auio);
+#endif
+
+extern struct uio* afsio_partialcopy(struct uio *auio, size_t size);
 extern int afsio_skip(struct uio *auio, afs_int32 asize);
 
 /* afs_osi_vm.c */
@@ -613,39 +604,29 @@ extern int osi_Active(struct vcache *avc);
 extern void osi_FlushPages(struct vcache *avc,
                           afs_ucred_t *credp);
 extern void osi_FlushText_really(struct vcache *vp);
-extern int osi_VMDirty_p(struct vcache *avc);
 #ifndef UKERNEL
 extern void osi_ReleaseVM(struct vcache *avc, afs_ucred_t *acred);
 #endif
 
 
-/* LINUX/osi_fetchstore.c */
-#ifdef AFS_LINUX26_ENV
-extern int afs_linux_storeproc(struct storeOps *, void *, struct dcache *,
-                              int *, afs_size_t *);
-#endif
-
 /* ARCH/osi_crypto.c */
 extern int osi_readRandom(void *, afs_size_t);
 
-/* ARCH/osi_misc.c */
-extern void afs_osi_SetTime(osi_timeval_t * atv);
-
 /* LINUX/osi_misc.c */
 #ifdef AFS_LINUX20_ENV
 #ifdef AFS_LINUX24_ENV
 extern int osi_lookupname(char *aname, uio_seg_t seg, int followlink,
                          struct dentry **dpp);
 extern int osi_InitCacheInfo(char *aname);
-extern int osi_rdwr(struct osi_file *osifile, uio_t * uiop, int rw);
-extern void setup_uio(uio_t * uiop, struct iovec *iovecp, const char *buf,
+extern int osi_rdwr(struct osi_file *osifile, struct uio *uiop, int rw);
+extern void setup_uio(struct uio *uiop, struct iovec *iovecp, const char *buf,
                      afs_offs_t pos, int count, uio_flag_t flag,
                      uio_seg_t seg);
-extern int uiomove(char *dp, int length, uio_flag_t rw, uio_t * uiop);
+extern int uiomove(char *dp, int length, uio_flag_t rw, struct uio *uiop);
 extern void osi_linux_free_inode_pages(void);
 #endif
 extern void osi_linux_mask(void);
-extern void osi_linux_unmask(void);
+extern void osi_linux_unmaskrxk(void);
 extern int setpag(cred_t ** cr, afs_uint32 pagvalue, afs_uint32 * newpag,
                  int change_parent);
 #endif
@@ -680,8 +661,13 @@ extern int afs_syscall_icreate(afs_uint32, afs_uint32, afs_uint32, afs_uint32, a
 extern int afs_syscall_iopen(int, ino_t, int, rval_t *);
 extern int afs_syscall_iincdec(int, int, int, int);
 #elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_NBSD_ENV)
+extern int afs_syscall_icreate(long, long, long, long, long, long, register_t *);
+extern int afs_syscall_iopen(int dev, int inode, int usrmod, register_t *);
+#else
 extern int afs_syscall_icreate(long, long, long, long, long, long, long*);
 extern int afs_syscall_iopen(int dev, int inode, int usrmod, long *retval);
+#endif
 extern int afs_syscall_iincdec(int dev, int inode, int inode_p1, int amount);
 #else
 extern int afs_syscall_icreate(long, long, long, long, long, long);
@@ -720,8 +706,8 @@ extern int usr_setpag(afs_ucred_t **cred, afs_uint32 pagvalue,
 extern int setpag(struct thread *td, struct ucred **cred, afs_uint32 pagvalue,
                  afs_uint32 * newpag, int change_parent);
 
-#   elif defined(AFS_NBSD40_ENV)
-extern int setpag(struct proc *proc, afs_ucred_t *cred, afs_uint32 pagvalue,
+#   elif defined(AFS_NBSD_ENV)
+extern int setpag(afs_proc_t *proc, afs_ucred_t **cred, afs_uint32 pagvalue,
                  afs_uint32 * newpag, int change_parent);
 #   else
 extern int setpag(afs_proc_t *proc, struct ucred **cred, afs_uint32 pagvalue,
@@ -731,26 +717,30 @@ extern int setpag(afs_proc_t *proc, struct ucred **cred, afs_uint32 pagvalue,
 # endif /* AFS_XBSD_ENV */
 #endif /* UKERNEL */
 
-#if defined(AFS_LINUX26_ENV)
+#if defined(AFS_LINUX26_ENV) || defined(AFS_PAG_ONEGROUP_ENV)
 extern afs_int32 osi_get_group_pag(afs_ucred_t *cred);
 #endif
 
 
 
 /* ARCH/osi_vm.c */
-extern int osi_VM_FlushVCache(struct vcache *avc, int *slept);
+extern int osi_VM_FlushVCache(struct vcache *avc);
 extern void osi_VM_StoreAllSegments(struct vcache *avc);
 extern void osi_VM_TryToSmush(struct vcache *avc, afs_ucred_t *acred,
                              int sync);
 extern void osi_VM_FlushPages(struct vcache *avc, afs_ucred_t *credp);
-extern void osi_VM_Truncate(struct vcache *avc, int alen,
-                           afs_ucred_t *acred);
+#if !defined(AFS_NBSD_ENV)
+extern void osi_VM_Truncate(struct vcache *avc, int alen, afs_ucred_t *acred);
+#else
+extern void osi_VM_Truncate(struct vcache *avc, voff_t alen, afs_ucred_t *acred);
+#endif
 extern void osi_VM_TryReclaim(struct vcache *avc, int *slept);
 extern void osi_VM_NukePages(struct vnode *vp, off_t offset, off_t size);
 extern int osi_VM_Setup(struct vcache *avc, int force);
 
 #ifdef AFS_SUN5_ENV
 extern int osi_VM_GetDownD(struct vcache *avc, struct dcache *adc);
+extern int osi_VM_MultiPageConflict(struct vcache *avc, struct dcache *adc);
 extern void osi_VM_PreTruncate(struct vcache *avc, int alen,
                               afs_ucred_t *acred);
 #endif
@@ -827,7 +817,8 @@ extern int HandleIoctl(struct vcache *avc, afs_int32 acom,
 /* afs_segments.c */
 extern int afs_StoreAllSegments(struct vcache *avc,
                                struct vrequest *areq, int sync);
-extern int afs_InvalidateAllSegments(struct vcache *avc);
+extern void afs_InvalidateAllSegments(struct vcache *avc);
+extern int  afs_InvalidateAllSegments_once(struct vcache *avc);
 extern int afs_ExtendSegments(struct vcache *avc,
                              afs_size_t alen, struct vrequest *areq);
 extern int afs_TruncateAllSegments(struct vcache *avc,
@@ -841,35 +832,30 @@ extern afs_rwlock_t afs_icl_lock;
 extern struct srvAddr *afs_srvAddrs[NSERVERS];
 extern struct server *afs_servers[NSERVERS];
 extern int afs_totalServers;
-extern struct server *afs_setTimeHost;
 extern struct server *afs_FindServer(afs_int32 aserver, afs_uint16 aport,
                                     afsUUID * uuidp, afs_int32 locktype);
 extern struct server *afs_GetServer(afs_uint32 * aserver, afs_int32 nservers,
                                    afs_int32 acell, u_short aport,
                                    afs_int32 locktype, afsUUID * uuidp,
-                                   afs_int32 addr_uniquifier);
+                                   afs_int32 addr_uniquifier,
+                                   struct volume *tv);
 extern void afs_GetCapabilities(struct server *ts);
 extern void ForceAllNewConnections(void);
 extern void afs_MarkServerUpOrDown(struct srvAddr *sa, int a_isDown);
-extern afs_int32 afs_ServerDown(struct srvAddr *sa);
+extern afs_int32 afs_ServerDown(struct srvAddr *sa, int code,
+                                struct rx_connection *rxconn);
 extern void afs_CountServers(void);
 extern void afs_CheckServers(int adown, struct cell *acellp);
 extern void afs_LoopServers(int adown, struct cell *acellp, int vlalso,
-                           void (*func1) (struct rx_connection **rxconns,
-                                          int nconns, int nservers,
-                                          struct afs_conn **conns,
-                                          struct srvAddr **addrs),
-                           void (*func2) (struct rx_connection **rxconns,
-                                          int nconns, int nservers,
-                                          struct afs_conn **conns,
-                                          struct srvAddr **addrs));
+                           void (*func1) (int nconns, struct rx_connection **rxconns,
+                                          struct afs_conn **conns),
+                           void (*func2) (int nconns, struct rx_connection **rxconns,
+                                          struct afs_conn **conns));
 extern unsigned int afs_random(void);
 extern int afs_randomMod15(void);
 extern int afs_randomMod127(void);
 extern void afs_SortOneServer(struct server *asp);
 extern void afs_SortServers(struct server *aservers[], int count);
-extern void afs_FlushServer(struct server *srvp);
-extern void afs_RemoveSrvAddr(struct srvAddr *sap);
 extern void afs_ActivateServer(struct srvAddr *sap);
 #ifdef AFS_USERSPACE_IP_ADDR
 extern void afsi_SetServerIPRank(struct srvAddr *sa, afs_int32 addr,
@@ -906,10 +892,10 @@ extern struct afs_stats_CMPerf afs_stats_cmperf;
 extern struct afs_stats_CMFullPerf afs_stats_cmfullperf;
 extern afs_int32 afs_stats_XferSumBytes[AFS_STATS_NUM_FS_XFER_OPS];
 extern void afs_InitStats(void);
-extern void afs_GetCMStat(char **ptr, unsigned *size);
-#ifndef AFS_NOSTATS
-extern void afs_AddToMean(struct afs_MeanStats *oldMean, afs_int32 newValue);
-#endif
+
+/* ARCH/osi_kstat.c */
+extern void afs_kstat_init(void);
+extern void afs_kstat_shutdown(void);
 
 /* afs_syscall.c */
 #ifdef AFS_DARWIN100_ENV
@@ -921,10 +907,10 @@ extern int copyin_afs_ioctl(caddr_t cmarg, struct afs_ioctl *dst);
 #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
 #ifdef AFS_DARWIN100_ENV
 extern int afs3_syscall(afs_proc_t *p, void *args, unsigned int *retval);
-#elif defined(AFS_FBSD90_ENV) || defined(AFS_FBSD82_ENV)
-/* afs3_syscall prototype is in sys/sysproto.h */
 #elif defined(AFS_FBSD_ENV)
 extern int afs3_syscall(struct thread *p, void *args);
+#elif defined(AFS_NBSD50_ENV)
+extern int afs3_syscall(afs_proc_t *p, const void *args, register_t *retval);
 #elif defined(AFS_NBSD40_ENV)
 extern int afs3_syscall(struct lwp *p, void *args);
 #else
@@ -957,7 +943,6 @@ extern int afs_ExtractTokensForPioctl(struct tokenJar *, time_t,
 extern void uafs_Shutdown(void);
 extern void osi_ReleaseVM(struct vcache *avc, int len,
                          afs_ucred_t *credp);
-extern int osi_GetTime(struct timeval *tv);
 extern int iodone(struct usr_buf *bp);
 extern int usr_ioctl(void);
 extern int lookupname(char *fnamep, int segflg, int followlink,
@@ -985,21 +970,22 @@ extern void afs_GCPAGs_perproc_func(afs_proc_t * pproc);
 #endif /* AFS_GCPAGS */
 extern void afs_ComputePAGStats(void);
 extern void afs_PutUser(struct unixuser *au, afs_int32 locktype);
-extern void afs_GCUserData(int aforce);
+extern void afs_GCUserData(void);
 extern void afs_CheckTokenCache(void);
-extern void afs_ResetAccessCache(afs_int32 uid, int alock);
+extern void afs_ResetAccessCache(afs_int32 uid, afs_int32 cell, int alock);
 extern void afs_ResetUserConns(struct unixuser *auser);
 extern void afs_SetPrimary(struct unixuser *au, int aflag);
 extern void afs_MarkUserExpired(afs_int32 pag);
 
 /* afs_util.c */
 extern afs_int32 afs_strtoi_r(const char *str, char **endptr, afs_uint32 *ret);
-extern afs_int32 afs_calc_inum (afs_int32 volume, afs_int32 vnode);
+extern afs_int32 afs_calc_inum(afs_int32 cell, afs_int32 volume,
+                               afs_int32 vnode);
 #ifndef afs_cv2string
 extern char *afs_cv2string(char *ttp, afs_uint32 aval);
 #endif
 #ifndef afs_strcasecmp
-extern int afs_strcasecmp(char *s1, char *s2);
+extern int afs_strcasecmp(const char *s1, const char *s2);
 #endif
 #ifndef afs_strcat
 extern char *afs_strcat(char *s1, char *s2);
@@ -1015,10 +1001,10 @@ extern char *afs_strrchr(char *s, int c);
 #endif
 extern char *afs_strdup(char *s);
 extern void print_internet_address(char *preamble, struct srvAddr *sa,
-                                  char *postamble, int flag);
+                                  char *postamble, int flag, int code,
+                                  struct rx_connection *rxconn);
 extern afs_int32 afs_data_pointer_to_int32(const void *p);
 
-extern void afs_CheckLocks(void);
 extern int afs_badop(void);
 extern int afs_noop(void);
 extern afs_int32 afs_data_pointer_to_int32(const void *p);
@@ -1029,14 +1015,21 @@ extern afs_int32 afs_data_pointer_to_int32(const void *p);
 /* AIX doesn't have usable va_args support in its kernel */
 extern void afs_warn();
 extern void afs_warnuser();
+extern void afs_warnall();
 #else
 extern void afs_warn(char *fmt, ...)
        AFS_ATTRIBUTE_FORMAT(__printf__, 1, 2);
 extern void afs_warnuser(char *fmt, ...)
        AFS_ATTRIBUTE_FORMAT(__printf__, 1, 2);
+extern void afs_warnall(char *fmt, ...)
+       AFS_ATTRIBUTE_FORMAT(__printf__, 1, 2);
 #endif
+extern void afs_WarnENOSPC(void);
 
 /* afs_vcache.c */
+extern int VCHash(struct VenusFid *fid);
+extern int VCHashV(struct VenusFid *fid);
+extern int afs_VCacheStressed(void);
 extern int afs_ShakeLooseVCaches(afs_int32 anumber);
 extern afs_int32 afs_maxvcount;
 extern afs_int32 afs_vcount;
@@ -1059,6 +1052,9 @@ extern void afs_FlushReclaimedVcaches(void);
 void afs_vcacheInit(int astatSize);
 extern struct vcache *afs_FindVCache(struct VenusFid *afid, afs_int32 * retry,
                                     afs_int32 flag);
+extern void afs_BadFetchStatus(struct afs_conn *tc);
+extern int afs_CheckFetchStatus(struct afs_conn *tc,
+                                struct AFSFetchStatus *status);
 extern afs_int32 afs_FetchStatus(struct vcache *avc, struct VenusFid *afid,
                                 struct vrequest *areq,
                                 struct AFSFetchStatus *Outsp);
@@ -1067,13 +1063,12 @@ extern afs_int32 afs_FlushVCBs(afs_int32 lockit);
 extern void afs_InactiveVCache(struct vcache *avc, afs_ucred_t *acred);
 extern struct vcache *afs_LookupVCache(struct VenusFid *afid,
                                       struct vrequest *areq,
-                                      afs_int32 * cached, struct vcache *adp,
+                                      struct vcache *adp,
                                       char *aname);
 extern void afs_FlushAllVCaches(void);
 extern int afs_FlushVCache(struct vcache *avc, int *slept);
 extern struct vcache *afs_GetRootVCache(struct VenusFid *afid,
                                        struct vrequest *areq,
-                                       afs_int32 * cached,
                                        struct volume *tvolp);
 extern struct vcache *afs_NewVCache(struct VenusFid *afid,
                                    struct server *serverp);
@@ -1081,10 +1076,43 @@ extern struct vcache *afs_NewBulkVCache(struct VenusFid *afid,
                                        struct server *serverp, int seq);
 extern int afs_VerifyVCache2(struct vcache *avc, struct vrequest *areq);
 extern struct vcache *afs_GetVCache(struct VenusFid *afid,
-                                   struct vrequest *areq, afs_int32 * cached,
-                                   struct vcache *avc);
+                                   struct vrequest *areq);
 extern void afs_PutVCache(struct vcache *avc);
 extern int afs_RefVCache(struct vcache *avc);
+
+/* Flags for afs_StaleVCacheFlags */
+
+/* afs_xcbhash is already locked by the caller */
+#define AFS_STALEVC_CBLOCKED (0x01)
+
+/* Normally we assume we only need to invalidate cached
+ * name -> vcache mappings for entries where the given
+ * vcache is the parent dir. This flag says to also clear
+ * entries for the vcache itself. */
+#define AFS_STALEVC_FILENAME (0x02)
+
+/* Do not touch the DNLC; the caller will deal with it. */
+#define AFS_STALEVC_NODNLC   (0x04)
+
+/* Do not run afs_DequeueCallback; the caller will take
+ * care of callback management. */
+#define AFS_STALEVC_NOCB     (0x08)
+
+/* NULL-out the callback field of the vcache, to save code at the callsite. */
+#define AFS_STALEVC_CLEARCB    (0x10)
+
+/* Skip the DNLC purge if CVInit or CVFlushed is set, for efficiency.
+ * A transitional flag used to reduce the logic change during refactoring
+ * that is expected to be removed and the purge behavior standardized. */
+#define AFS_STALEVC_SKIP_DNLC_FOR_INIT_FLUSHED (0x20)
+typedef unsigned int afs_stalevc_flags_t;
+
+#define afs_StaleVCache(avc) afs_StaleVCacheFlags(avc, 0, 0)
+extern void afs_StaleVCacheFlags(struct vcache *avc, afs_stalevc_flags_t flags,
+                                afs_uint32 cflags);
+
+extern void afs_SetDataVersion(struct vcache *avc, afs_hyper_t *avers);
+
 extern void afs_ProcessFS(struct vcache *avc,
                          struct AFSFetchStatus *astat,
                          struct vrequest *areq);
@@ -1102,7 +1130,7 @@ extern int afs_RemoteLookup(struct VenusFid *afid,
                            struct AFSCallBack *CallBackp,
                            struct server **serverp,
                            struct AFSVolSync *tsyncp);
-extern void afs_ResetVCache(struct vcache *, afs_ucred_t *);
+extern void afs_ResetVCache(struct vcache *, afs_ucred_t *, afs_int32 skipdnlc);
 extern afs_int32 afs_NFSFindVCache(struct vcache **avcp,
                                   struct VenusFid *afid);
 extern void afs_vcacheInit(int astatSize);
@@ -1146,6 +1174,8 @@ extern int afs_setattr(OSI_VC_DECL(avc), struct vattr *attrs,
 extern int afs_setattr(OSI_VC_DECL(avc), struct vattr *attrs,
                       afs_ucred_t *acred);
 #endif
+extern int afs_CreateAttr(struct vattr **out);
+extern void afs_DestroyAttr(struct vattr *vattr);
 
 /* VNOPS/afs_vnop_create.c */
 #ifdef AFS_SGI64_ENV
@@ -1174,19 +1204,15 @@ extern int afs_rmdir(OSI_VC_DECL(adp), char *aname, afs_ucred_t *acred);
 
 struct fid;
 /* VNOPS/afs_vnop_fid.c */
-#if !defined(AFS_ATHENA_ENV)
 #ifdef AFS_AIX41_ENV
 int afs_fid(OSI_VC_DECL(avc), struct fid *fidpp, struct ucred *credp);
-#elif defined(AFS_SUN54_ENV)
+#elif defined(AFS_SUN5_ENV)
 int afs_fid(OSI_VC_DECL(avc), struct fid *fidpp);
 #else
 int afs_fid(OSI_VC_DECL(avc), struct fid **fidpp);
 #endif                          /* AFS_AIX41_ENV */
-#endif
 
 /* VNOPS/afs_vnop_flock.c */
-extern afs_int32 lastWarnTime;
-
 extern void lockIdSet(struct AFS_FLOCK *flock, struct SimpleLocks *slp,
                      int clid);
 extern int HandleFlock(struct vcache *avc, int acom,
@@ -1309,7 +1335,7 @@ extern int afs_UFSHandleLink(struct vcache *avc,
                             struct vrequest *areq);
 extern int afs_symlink(OSI_VC_DECL(adp), char *aname,
                       struct vattr *attrs, char *atargetName,
-                      afs_ucred_t *acred);
+                      struct vcache **tvcp, afs_ucred_t *acred);
 extern int afs_readlink(OSI_VC_DECL(avc), struct uio *auio,
                        afs_ucred_t *acred);
 
@@ -1347,7 +1373,7 @@ extern int afs_close(OSI_VC_DECL(avc), afs_int32 aflags,
 #if defined(AFS_SGI65_ENV)
 extern int afs_fsync(OSI_VC_DECL(avc), int flags, afs_ucred_t *acred,
                     off_t start, off_t stop);
-#elif defined(AFS_SGI_ENV) || defined(AFS_SUN53_ENV)
+#elif defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)
 extern int afs_fsync(OSI_VC_DECL(avc), int flag, afs_ucred_t *acred);
 #else
 extern int afs_fsync(OSI_VC_DECL(avc), afs_ucred_t *acred);
@@ -1364,16 +1390,16 @@ extern struct volume *afs_FindVolume(struct VenusFid *afid,
                                     afs_int32 locktype);
 extern struct volume *afs_freeVolList;
 extern afs_int32 fvTable[NFENTRIES];
-extern void InstallVolumeEntry(struct volume *av, struct vldbentry *ve,
-                              int acell);
-extern void InstallNVolumeEntry(struct volume *av, struct nvldbentry *ve,
-                               int acell);
-extern void InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve,
-                               int acell, struct cell *tcell,
-                               struct vrequest *areq);
+extern void LockAndInstallVolumeEntry(struct volume *av, struct vldbentry *ve,
+                                     int acell);
+extern void LockAndInstallNVolumeEntry(struct volume *av, struct nvldbentry *ve,
+                                      int acell);
+extern void LockAndInstallUVolumeEntry(struct volume *av, struct uvldbentry *ve,
+                                      int acell, struct cell *tcell,
+                                      struct vrequest *areq);
 extern void afs_ResetVolumeInfo(struct volume *tv);
-extern struct volume *afs_MemGetVolSlot(void);
-extern void afs_ResetVolumes(struct server *srvp);
+extern struct volume *afs_MemGetVolSlot(afs_int32 volid, struct cell *cell);
+extern void afs_ResetVolumes(struct server *srvp, struct volume *tv);
 extern struct volume *afs_GetVolume(struct VenusFid *afid,
                                    struct vrequest *areq,
                                    afs_int32 locktype);
@@ -1381,7 +1407,7 @@ extern struct volume *afs_GetVolumeByName(char *aname,
                                          afs_int32 acell, int agood,
                                          struct vrequest *areq,
                                          afs_int32 locktype);
-extern struct volume *afs_UFSGetVolSlot(void);
+extern struct volume *afs_UFSGetVolSlot(afs_int32 volid, struct cell *cell);
 extern void afs_CheckVolumeNames(int flags);
 
 /* Prototypes for generated files that aren't really in src/afs/ */