#include <afsconfig.h>
#include "afs/param.h"
-RCSID("$Header$");
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
-#include "afs/afs_stats.h" /* statistics */
-#include "afs/nfsclient.h"
+#include "afs/afs_stats.h" /* statistics */
+#include "afs/nfsclient.h"
-#if defined(AFS_SUN5_ENV)
/* This file contains Solaris VM-related code for the cache manager. */
#include <sys/mman.h>
*
* Locking: only the global lock is held on entry.
*/
-int osi_VM_GetDownD(struct vcache *avc, struct dcache *adc)
+int
+osi_VM_GetDownD(struct vcache *avc, struct dcache *adc)
{
int code;
AFS_GUNLOCK();
- code = afs_putpage(AFSTOV(avc),
- (offset_t) AFS_CHUNKTOBASE(adc->f.chunk),
- AFS_CHUNKTOSIZE(adc->f.chunk),
- B_INVAL, CRED());
+ code =
+ afs_putpage(AFSTOV(avc), (offset_t) AFS_CHUNKTOBASE(adc->f.chunk),
+ AFS_CHUNKTOSIZE(adc->f.chunk), B_INVAL, CRED());
AFS_GLOCK();
return code;
* is not dropped and re-acquired for any platform. It may be that *slept is
* therefore obsolescent.
*/
-int osi_VM_FlushVCache(struct vcache *avc, int *slept)
+int
+osi_VM_FlushVCache(struct vcache *avc, int *slept)
{
if (avc->vrefCount != 0)
return EBUSY;
/* if a lock is held, give up */
if (CheckLock(&avc->lock))
return EBUSY;
- if (afs_CheckBozonLock(&avc->pvnLock))
- return EBUSY;
AFS_GUNLOCK();
- pvn_vplist_dirty(AFSTOV(avc), 0, NULL, B_TRUNC|B_INVAL, CRED());
+ pvn_vplist_dirty(AFSTOV(avc), 0, NULL, B_TRUNC | B_INVAL, CRED());
AFS_GLOCK();
/* Might as well make the obvious check */
if (AFSTOV(avc)->v_pages)
- return EBUSY; /* should be all gone still */
+ return EBUSY; /* should be all gone still */
rw_destroy(&avc->rwlock);
if (avc->credp) {
* Locking: the vcache entry's lock is held. It will usually be dropped and
* re-obtained.
*/
-void osi_VM_StoreAllSegments(struct vcache *avc)
+void
+osi_VM_StoreAllSegments(struct vcache *avc)
{
AFS_GUNLOCK();
-#if defined(AFS_SUN56_ENV)
- (void) pvn_vplist_dirty(AFSTOV(avc), (u_offset_t)0, afs_putapage,
- 0, CRED());
-#else
- (void) pvn_vplist_dirty(AFSTOV(avc), 0, afs_putapage, 0, CRED());
-#endif
+ (void)pvn_vplist_dirty(AFSTOV(avc), (u_offset_t) 0, afs_putapage, 0,
+ CRED());
AFS_GLOCK();
}
* Locking: the vcache entry's lock is held. It may be dropped and
* re-obtained.
*/
-void osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred, int sync)
+void
+osi_VM_TryToSmush(struct vcache *avc, afs_ucred_t *acred, int sync)
{
AFS_GUNLOCK();
-#if defined(AFS_SUN56_ENV)
- (void) pvn_vplist_dirty(AFSTOV(avc), (u_offset_t)0, afs_putapage,
- (sync ? B_INVAL : B_FREE), acred);
-#else
- (void) pvn_vplist_dirty(AFSTOV(avc), 0, afs_putapage,
- (sync ? B_INVAL : B_FREE), acred);
-#endif
+ (void)pvn_vplist_dirty(AFSTOV(avc), (u_offset_t) 0, afs_putapage,
+ (sync ? B_INVAL : B_FREE), acred);
AFS_GLOCK();
}
*
* Locking: No lock is held, not even the global lock.
*/
-void osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp)
+void
+osi_VM_FlushPages(struct vcache *avc, afs_ucred_t *credp)
{
extern int afs_pvn_vptrunc;
afs_pvn_vptrunc++;
- (void) afs_putpage(AFSTOV(avc), (offset_t)0, 0,
- B_TRUNC|B_INVAL, credp);
+ (void)afs_putpage(AFSTOV(avc), (offset_t) 0, 0, B_TRUNC | B_INVAL, credp);
}
/* Zero no-longer-used part of last page, when truncating a file
* The caller will raise activeV (to prevent pageins), but this function must
* be called first, since it causes a pagein.
*/
-void osi_VM_PreTruncate(struct vcache *avc, int alen, struct AFS_UCRED *acred)
+void
+osi_VM_PreTruncate(struct vcache *avc, int alen, afs_ucred_t *acred)
{
page_t *pp;
int pageOffset = (alen & PAGEOFFSET);
page_unlock(pp);
}
AFS_GLOCK();
- ObtainWriteLock(&avc->lock,563);
+ ObtainWriteLock(&avc->lock, 563);
}
/* Purge pages beyond end-of-file, when truncating a file.
* Locking: no lock is held, not even the global lock.
* Pageins are blocked (activeV is raised).
*/
-void osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred)
+void
+osi_VM_Truncate(struct vcache *avc, int alen, afs_ucred_t *acred)
{
/*
* It's OK to specify afs_putapage here, even though we aren't holding
* the vcache entry lock, because it isn't going to get called.
*/
- pvn_vplist_dirty(AFSTOV(avc), alen, afs_putapage, B_TRUNC|B_INVAL,
+ pvn_vplist_dirty(AFSTOV(avc), alen, afs_putapage, B_TRUNC | B_INVAL,
acred);
}
-
-#endif /* SUN5 && !NCR */