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
)
21 /* Perhaps this function should use vgone() or vrecycle() instead. */
23 if ((afs_debug
& AFSDEB_GENERAL
) != 0) {
24 printf("%s enter\n", __func__
);
27 if (osi_VM_FlushVCache(avc
) != 0) {
33 if ((afs_debug
& AFSDEB_GENERAL
) != 0) {
34 printf("%s exit %d\n", __func__
, code
);
45 tvc
= afs_osi_Alloc(sizeof(struct vcache
));
46 tvc
->v
= NULL
; /* important to clean this, or use memset 0 */
52 osi_PrePopulateVCache(struct vcache
*avc
)
54 memset(avc
, 0, sizeof(struct vcache
));
58 osi_AttachVnode(struct vcache
*avc
, int seq
)
60 ReleaseWriteLock(&afs_xvcache
);
62 afs_nbsd_getnewvnode(avc
); /* includes one refcount */
64 ObtainWriteLock(&afs_xvcache
,337);
65 #ifndef AFS_NBSD50_ENV
66 lockinit(&avc
->rwlock
, PINOD
, "vcache", 0, 0);
71 osi_PostPopulateVCache(struct vcache
*avc
)
73 AFSTOV(avc
)->v_mount
= afs_globalVFS
;