Example #1
0
int
osi_TryEvictVCache(struct vcache *avc, int *slept) {
    int code;

    if (!VREFCOUNT_GT(avc,0)
         && avc->opens == 0 && (avc->f.states & CUnlinkedDel) == 0) {
        code = afs_FlushVCache(avc, slept);
	if (code == 0)
	    return 1;
    }
    return 0;
}
Example #2
0
int
osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) {
     int code;
     /* we can't control whether we sleep */
     if (!VREFCOUNT_GT(avc,0)
         && avc->opens == 0 && (avc->f.states & CUnlinkedDel) == 0) {
        code = afs_FlushVCache(avc, slept);
	if (code == 0)
	    return 1;
     }
     return 0;
}
Example #3
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];

    for (i = 0; i < VCSIZE; i++) {
	for (tvc = afs_vhashT[i]; tvc; ) {
	    int slept;
	
	    nvc = tvc->hnext;
	    if (afs_FlushVCache(tvc, &slept))		/* slept always 0 for linux? */
		printf("Failed to invalidate all pages on inode 0x%p\n", tvc);
	    tvc = nvc;
	}
    }
}