extern void vattr2inode(struct inode *ip, struct vattr *vp);
extern int afs_init_inodecache(void);
extern void afs_destroy_inodecache(void);
-extern void osi_linux_free_inode_pages(void);
/* osi_vnodeops.c */
extern void afs_fill_inode(struct inode *ip, struct vattr *vattr);
code = afs_root(sb);
if (code) {
afs_globalVFS = NULL;
- osi_linux_free_inode_pages();
+ afs_FlushAllVCaches();
module_put(THIS_MODULE);
}
afs_globalVFS = 0;
afs_globalVp = 0;
- osi_linux_free_inode_pages(); /* invalidate and release remaining AFS inodes. */
afs_shutdown();
mntput(afs_cacheMnt);
ip->i_ctime.tv_sec = vp->va_ctime.tv_sec;
ip->i_ctime.tv_nsec = 0;
}
-
-/* osi_linux_free_inode_pages
- *
- * Free all vnodes remaining in the afs hash. Must be done before
- * shutting down afs and freeing all memory.
- */
-void
-osi_linux_free_inode_pages(void)
-{
- int i;
- struct vcache *tvc, *nvc;
- extern struct vcache *afs_vhashT[VCSIZE];
-
- retry:
- for (i = 0; i < VCSIZE; i++) {
- for (tvc = afs_vhashT[i]; tvc; ) {
- int slept;
-
- nvc = tvc->hnext;
- if (afs_FlushVCache(tvc, &slept))
- printf("Failed to invalidate all pages on inode 0x%p\n", tvc);
- if (slept) {
- goto retry;
- }
- tvc = nvc;
- }
- }
-}
extern void vattr2inode(struct inode *ip, struct vattr *vp);
extern int afs_init_inodecache(void);
extern void afs_destroy_inodecache(void);
-extern void osi_linux_free_inode_pages(void);
/* osi_vnodeops.c */
extern void afs_fill_inode(struct inode *ip, struct vattr *vattr);
afs_globalVFS = 0;
afs_globalVp = 0;
- osi_linux_free_inode_pages(); /* invalidate and release remaining AFS inodes. */
afs_shutdown();
#if defined(AFS_LINUX24_ENV)
mntput(afs_cacheMnt);
ip->i_mtime = vp->va_mtime.tv_sec;
ip->i_ctime = vp->va_ctime.tv_sec;
}
-
-/* osi_linux_free_inode_pages
- *
- * Free all vnodes remaining in the afs hash. Must be done before
- * shutting down afs and freeing all memory.
- */
-void
-osi_linux_free_inode_pages(void)
-{
- int i;
- struct vcache *tvc, *nvc;
- extern struct vcache *afs_vhashT[VCSIZE];
-
- retry:
- for (i = 0; i < VCSIZE; i++) {
- for (tvc = afs_vhashT[i]; tvc; ) {
- int slept;
-
- nvc = tvc->hnext;
- if (afs_FlushVCache(tvc, &slept))
- printf("Failed to invalidate all pages on inode 0x%p\n", tvc);
- if (slept) {
- goto retry;
- }
- tvc = nvc;
- }
- }
-}
afs_globalVFS = 0;
- /* free mappings for all vcaches */
- for (i = 0; i < VCSIZE; i++) {
- for (vc = afs_vhashT[i]; vc; vc = nvc) {
- int fv_slept;
- nvc = vc->hnext;
- if (afs_FlushVCache(vc, &fv_slept)) {
- afs_warn("afs_FlushVCache failed on 0x%llx\n",
- (unsigned long long)vc);
- }
- }
- }
-
afs_shutdown();
}
afs_warn("afs: COLD ");
else
afs_warn("afs: WARM ");
- afs_warn("shutting down of: CB... ");
+ afs_warn("shutting down of: vcaches... ");
+
+ afs_FlushAllVCaches();
+
+ afs_warn("CB... ");
afs_termState = AFSOP_STOP_RXCALLBACK;
rx_WakeupServerProcs();
struct vrequest *areq,
afs_int32 * cached, 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,
#endif
}
+void
+afs_FlushAllVCaches(void)
+{
+ int i;
+ struct vcache *tvc, *nvc;
+
+ ObtainWriteLock(&afs_xvcache, 867);
+
+ retry:
+ for (i = 0; i < VCSIZE; i++) {
+ for (tvc = afs_vhashT[i]; tvc; tvc = nvc) {
+ int slept;
+
+ nvc = tvc->hnext;
+ if (afs_FlushVCache(tvc, &slept)) {
+ afs_warn("Failed to flush vcache 0x%lx\n", (unsigned long)(uintptr_t)tvc);
+ }
+ if (slept) {
+ goto retry;
+ }
+ tvc = nvc;
+ }
+ }
+
+ ReleaseWriteLock(&afs_xvcache);
+}
+
/*!
* This routine is responsible for allocating a new cache entry
* from the free list. It formats the cache entry and inserts it