SOLARIS: Add afs_putpage prototype, and follow it

A couple of places call afs_putpage outside of osi_vnodeops.c (where
it's defined). So, add a prototype for it in osi_prototypes.h. Also
make the call sites actually follow the prototype, by giving the
correct arguments in the AFS_SUN511_ENV case.

Change-Id: I2c9e500ee0fe544df64b4d023091f4a1ad965485
Reviewed-on: https://gerrit.openafs.org/12704
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
This commit is contained in:
Andrew Deason 2017-08-09 20:06:35 -05:00
parent b53952bc25
commit 43b5029eee
2 changed files with 18 additions and 0 deletions

View File

@ -11,6 +11,15 @@
#define _OSI_PROTOTYPES_H_
/* osi_vnodeops.c */
#ifdef AFS_SUN511_ENV
int afs_putpage(struct vnode *vp, offset_t off, size_t len, int flags,
afs_ucred_t *cred, caller_context_t *ct);
#else
int afs_putpage(struct vnode *vp, offset_t off, u_int len, int flags,
afs_ucred_t *cred);
#endif
int afs_putapage(struct vnode *vp, struct page *pages, u_offset_t * offp,
size_t * lenp, int flags, afs_ucred_t *credp);

View File

@ -47,8 +47,13 @@ osi_VM_GetDownD(struct vcache *avc, struct dcache *adc)
AFS_GUNLOCK();
code =
#ifdef AFS_SUN511_ENV
afs_putpage(AFSTOV(avc), (offset_t) AFS_CHUNKTOBASE(adc->f.chunk),
AFS_CHUNKTOSIZE(adc->f.chunk), B_INVAL, CRED(), NULL);
#else
afs_putpage(AFSTOV(avc), (offset_t) AFS_CHUNKTOBASE(adc->f.chunk),
AFS_CHUNKTOSIZE(adc->f.chunk), B_INVAL, CRED());
#endif
AFS_GLOCK();
return code;
@ -161,7 +166,11 @@ osi_VM_FlushPages(struct vcache *avc, afs_ucred_t *credp)
extern int afs_pvn_vptrunc;
afs_pvn_vptrunc++;
#ifdef AFS_SUN511_ENV
(void)afs_putpage(AFSTOV(avc), (offset_t) 0, 0, B_TRUNC | B_INVAL, credp, NULL);
#else
(void)afs_putpage(AFSTOV(avc), (offset_t) 0, 0, B_TRUNC | B_INVAL, credp);
#endif
}
/* Zero no-longer-used part of last page, when truncating a file