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"
15 #include "../afs/sysincludes.h" /* Standard vendor system headers */
16 #include "../afs/afsincludes.h" /* Afs-based standard headers */
17 #include "../afs/afs_stats.h" /* statistics */
19 /* Try to discard pages, in order to recycle a vcache entry.
21 * We also make some sanity checks: ref count, open count, held locks.
23 * We also do some non-VM-related chores, such as releasing the cred pointer
24 * (for AIX and Solaris) and releasing the gnode (for AIX).
26 * Locking: afs_xvcache lock is held. If it is dropped and re-acquired,
27 * *slept should be set to warn the caller.
29 * Formerly, afs_xvcache was dropped and re-acquired for Solaris, but now it
30 * is not dropped and re-acquired for any platform. It may be that *slept is
31 * therefore obsolescent.
34 osi_VM_FlushVCache(avc, slept)
38 if (avc->vrefCount > 1)
47 /* Try to store pages to cache, in order to store a file back to the server.
49 * Locking: the vcache entry's lock is held. It will usually be dropped and
53 osi_VM_StoreAllSegments(avc)
56 ; /* Nothing here yet */
59 /* Try to invalidate pages, for "fs flush" or "fs flushv"; or
60 * try to free pages, when deleting a file.
62 * Locking: the vcache entry's lock is held. It may be dropped and
66 osi_VM_TryToSmush(avc, acred, sync)
68 struct AFS_UCRED *acred;
71 struct vnode *vp = AFSTOV(avc);
73 /* Flush the delayed write blocks associated with this vnode
74 * from the buffer cache
76 if ((vp->v_flag & VTEXT) == 0) {
79 /* Mark the cached blocks on the free list as invalid; it invalidates blocks
80 * associated with vp which are on the freelist.
86 /* Purge VM for a file when its callback is revoked.
88 * Locking: No lock is held, not even the global lock.
91 osi_VM_FlushPages(avc, credp)
93 struct AFS_UCRED *credp;
95 ; /* Nothing here yet */
98 /* Purge pages beyond end-of-file, when truncating a file.
100 * Locking: no lock is held, not even the global lock.
101 * activeV is raised. This is supposed to block pageins, but at present
102 * it only works on Solaris.
105 osi_VM_Truncate(avc, alen, acred)
108 struct AFS_UCRED *acred;
110 ; /* Nothing here yet */