BSD CMs: Don't call nonexistent afs_FlushVS in afs_vop_reclaim
[openafs.git] / src / afs / NBSD / osi_vm.c
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  *
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  */
9
10
11 /* osi_vm.c implements:
12  *
13  * osi_VM_FlushVCache(avc, slept)
14  * osi_ubc_flush_dirty_and_wait(vp, flags)
15  * osi_VM_StoreAllSegments(avc)
16  * osi_VM_TryToSmush(avc, acred, sync)
17  * osi_VM_FlushPages(avc, credp)
18  * osi_VM_Truncate(avc, alen, acred)
19  */
20
21 #include <afsconfig.h>
22 #include "afs/param.h"
23
24 #include "afs/sysincludes.h"    /* Standard vendor system headers */
25 #include "afs/afsincludes.h"    /* Afs-based standard headers */
26 #include "afs/afs_stats.h"      /* statistics */
27 /* #include <vm/vm_ubc.h> */
28 #include <limits.h>
29 #include <float.h>
30
31 /* Try to discard pages, in order to recycle a vcache entry.
32  *
33  * We also make some sanity checks:  ref count, open count, held locks.
34  *
35  * We also do some non-VM-related chores, such as releasing the cred pointer
36  * (for AIX and Solaris) and releasing the gnode (for AIX).
37  *
38  * Locking:  afs_xvcache lock is held.  If it is dropped and re-acquired,
39  *   *slept should be set to warn the caller.
40  *
41  * Formerly, afs_xvcache was dropped and re-acquired for Solaris, but now it
42  * is not dropped and re-acquired for any platform.  It may be that *slept is
43  * therefore obsolescent.
44  *
45  * OSF/1 Locking:  VN_LOCK has been called.
46  */
47 int
48 osi_VM_FlushVCache(struct vcache *avc, int *slept)
49 {
50     return 0;
51 }
52
53 /* Try to store pages to cache, in order to store a file back to the server.
54  *
55  * Locking:  the vcache entry's lock is held.  It will usually be dropped and
56  * re-obtained.
57  */
58 void
59 osi_VM_StoreAllSegments(struct vcache *avc)
60 {
61 }
62
63 /* Try to invalidate pages, for "fs flush" or "fs flushv"; or
64  * try to free pages, when deleting a file.
65  *
66  * Locking:  the vcache entry's lock is held.  It may be dropped and
67  * re-obtained.
68  *
69  * Since we drop and re-obtain the lock, we can't guarantee that there won't
70  * be some pages around when we return, newly created by concurrent activity.
71  */
72 void
73 osi_VM_TryToSmush(struct vcache *avc, afs_ucred_t *acred, int sync)
74 {
75 }
76
77 /* Purge VM for a file when its callback is revoked.
78  *
79  * Locking:  No lock is held, not even the global lock.
80  */
81 void
82 osi_VM_FlushPages(struct vcache *avc, afs_ucred_t *credp)
83 {
84 }
85
86 /* Purge pages beyond end-of-file, when truncating a file.
87  *
88  * Locking:  no lock is held, not even the global lock.
89  * activeV is raised.  This is supposed to block pageins, but at present
90  * it only works on Solaris.
91  */
92 void
93 osi_VM_Truncate(struct vcache *avc, int alen, afs_ucred_t *acred)
94 {
95 }