/* afs_call.c */
extern int afs_cold_shutdown;
-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);
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, int indexvalid, int datavalid);
+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,
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, int indexvalid, int datavalid);
+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);
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);
struct afs_lock *alock);
extern void afs_osi_SleepS(char *addr,
struct afs_lock *alock);
-#ifdef AFS_BOZONLOCK_ENV
-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
#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 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
# 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);
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);
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_ShakeLooseVCaches(afs_int32 anumber);
extern afs_int32 afs_maxvcount;
extern afs_int32 afs_vcount;
struct vcache *avc);
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);