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"
14 #include "afs/sysincludes.h" /* Standard vendor system headers */
15 #include "afsincludes.h" /* Afs-based standard headers */
16 #include "afs/afs_stats.h" /* statistics */
18 /* Try to discard pages, in order to recycle a vcache entry.
20 * We also make some sanity checks: ref count, open count, held locks.
22 * We also do some non-VM-related chores, such as releasing the cred pointer
23 * (for AIX and Solaris) and releasing the gnode (for AIX).
25 * Locking: afs_xvcache lock is held. It must not be dropped.
28 osi_VM_FlushVCache(struct vcache
*avc
)
30 if (avc
->vrefCount
> 1)
39 /* Try to store pages to cache, in order to store a file back to the server.
41 * Locking: the vcache entry's lock is held. It will usually be dropped and
45 osi_VM_StoreAllSegments(struct vcache
*avc
)
47 ; /* Nothing here yet */
50 /* Try to invalidate pages, for "fs flush" or "fs flushv"; or
51 * try to free pages, when deleting a file.
53 * Locking: the vcache entry's lock is held. It may be dropped and
57 osi_VM_TryToSmush(struct vcache
*avc
, afs_ucred_t
*acred
, int sync
)
59 struct vnode
*vp
= AFSTOV(avc
);
61 /* Flush the delayed write blocks associated with this vnode
62 * from the buffer cache
64 if ((vp
->v_flag
& VTEXT
) == 0) {
67 /* Mark the cached blocks on the free list as invalid; it invalidates blocks
68 * associated with vp which are on the freelist.
74 /* Purge VM for a file when its callback is revoked.
76 * Locking: No lock is held, not even the global lock.
79 osi_VM_FlushPages(struct vcache
*avc
, afs_ucred_t
*credp
)
81 ; /* Nothing here yet */
84 /* Purge pages beyond end-of-file, when truncating a file.
86 * Locking: no lock is held, not even the global lock.
87 * activeV is raised. This is supposed to block pageins, but at present
88 * it only works on Solaris.
91 osi_VM_Truncate(struct vcache
*avc
, int alen
, afs_ucred_t
*acred
)
93 ; /* Nothing here yet */