Merge 1.8.0~pre4 packaging into master
[pkg-k5-afs_openafs.git] / src / afs / HPUX / osi_vcache.c
blobcf669a29dc7ccfcf4162cd8c0634607b6e0ad275
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
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
8 */
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 */
16 int
17 osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) {
18 int code;
20 /* we can't control whether we sleep */
21 if (!VREFCOUNT_GT(avc,0)
22 && avc->opens == 0 && (avc->f.states & CUnlinkedDel) == 0) {
23 code = afs_FlushVCache(avc, slept);
24 if (code == 0)
25 return 1;
27 return 0;
30 struct vcache *
31 osi_NewVnode(void) {
32 return afs_osi_Alloc(sizeof(struct vcache));
35 void
36 osi_PrePopulateVCache(struct vcache *avc) {
37 memset(avc, 0, sizeof(struct vcache));
39 avc->flushDV.low = avc->flushDV.high = AFS_MAXDV;
42 void
43 osi_AttachVnode(struct vcache *avc, int seq) {
46 void
47 osi_PostPopulateVCache(struct vcache *avc) {
48 AFSTOV(avc)->v_op = afs_ops;
49 avc->v.v_vfsp = afs_globalVFS;
50 vSetType(avc, VREG);