2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include "afs/param.h"
13 #include "afs/sysincludes.h" /*Standard vendor system headers */
14 #include "afsincludes.h" /*AFS-based standard headers */
17 osi_TryEvictVCache(struct vcache
*avc
, int *slept
, int defersleep
) {
20 if (!VREFCOUNT_GT(avc
,0)
21 && avc
->opens
== 0 && (avc
->f
.states
& CUnlinkedDel
) == 0) {
23 * vgone() reclaims the vnode, which calls afs_FlushVCache(),
24 * then it puts the vnode on the free list.
25 * If we don't do this we end up with a cleaned vnode that's
26 * not on the free list.
40 tvc
= afs_osi_Alloc(sizeof(struct vcache
));
41 tvc
->v
= NULL
; /* important to clean this, or use memset 0 */
47 osi_PrePopulateVCache(struct vcache
*avc
) {
48 memset(avc
, 0, sizeof(struct vcache
));
52 osi_AttachVnode(struct vcache
*avc
, int seq
) {
53 ReleaseWriteLock(&afs_xvcache
);
55 afs_obsd_getnewvnode(avc
); /* includes one refcount */
57 ObtainWriteLock(&afs_xvcache
,337);
58 lockinit(&avc
->rwlock
, PINOD
, "vcache", 0, 0);
62 osi_PostPopulateVCache(struct vcache
*avc
) {
63 AFSTOV(avc
)->v_mount
= afs_globalVFS
;