From 6d309f86089ea707dbeb6ab553e3dfd23b6c338c Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Thu, 9 Jan 2020 12:28:57 -0600 Subject: [PATCH 1/1] afs: Remove osi_VMDirty_p The function osi_VMDirty_p is mentioned in a few places in src/afs, but it has always been ifdef'd or commented out, ever since OpenAFS 1.0. Remove the dead code. Change-Id: Ia7cad718114d91adf9e403e29f9ac976c3f08bfd Reviewed-on: https://gerrit.openafs.org/14023 Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk Tested-by: BuildBot --- src/afs/afs.h | 1 - src/afs/afs_osi_vm.c | 71 ------------------------------------------------ src/afs/afs_prototypes.h | 1 - 3 files changed, 73 deletions(-) diff --git a/src/afs/afs.h b/src/afs/afs.h index ce980bd..c262165 100644 --- a/src/afs/afs.h +++ b/src/afs/afs.h @@ -1342,7 +1342,6 @@ struct afs_FetchOutput { #define AFS_ZEROS 64 /* zero buffer */ -/*#define afs_DirtyPages(avc) (((avc)->f.states & CDirty) || osi_VMDirty_p((avc)))*/ #define afs_DirtyPages(avc) ((avc)->f.states & CDirty) #define afs_InReadDir(avc) (((avc)->f.states & CReadDir) && (avc)->readdir_pid == MyPidxx2Pid(MyPidxx)) diff --git a/src/afs/afs_osi_vm.c b/src/afs/afs_osi_vm.c index 569be55..dc25df8 100644 --- a/src/afs/afs_osi_vm.c +++ b/src/afs/afs_osi_vm.c @@ -172,77 +172,6 @@ osi_FlushText_really(struct vcache *vp) } #endif /* AFS_TEXT_ENV */ -/* ? is it moderately likely that there are dirty VM pages associated with - * this vnode? - * - * Prereqs: avc must be write-locked - * - * System Dependencies: - *must* support each type of system for which - * memory mapped files are supported, even if all - * it does is return TRUE; - * - * NB: this routine should err on the side of caution for ProcessFS to work - * correctly (or at least, not to introduce worse bugs than already exist) - */ -#ifdef notdef -int -osi_VMDirty_p(struct vcache *avc) -{ - int dirtyPages; - - if (avc->execsOrWriters <= 0) - return 0; /* can't be many dirty pages here, I guess */ - -#if defined (AFS_AIX32_ENV) -#ifdef notdef - /* because of the level of hardware involvment with VM and all the - * warnings about "This routine must be called at VMM interrupt - * level", I thought it would be safest to disable interrupts while - * looking at the software page fault table. */ - - /* convert vm handle into index into array: I think that stoinio is - * always zero... Look into this XXX */ -#define VMHASH(handle) ( \ - ( ((handle) & ~vmker.stoinio) \ - ^ ((((handle) & ~vmker.stoinio) & vmker.stoimask) << vmker.stoihash) \ - ) & 0x000fffff) - - if (avc->segid) { - unsigned int pagef, pri, index, next; - - index = VMHASH(avc->segid); - if (scb_valid(index)) { /* could almost be an ASSERT */ - - pri = disable_ints(); - for (pagef = scb_sidlist(index); pagef >= 0; pagef = next) { - next = pft_sidfwd(pagef); - if (pft_modbit(pagef)) { /* has page frame been modified? */ - enable_ints(pri); - return 1; - } - } - enable_ints(pri); - } - } -#undef VMHASH -#endif -#endif /* AFS_AIX32_ENV */ - -#if defined (AFS_SUN5_ENV) - if (avc->f.states & CMAPPED) { - struct page *pg; - for (pg = AFSTOV(avc)->v_s.v_Pages; pg; pg = pg->p_vpnext) { - if (pg->p_mod) { - return 1; - } - } - } -#endif - return 0; -} -#endif /* notdef */ - - /* * Solaris osi_ReleaseVM should not drop and re-obtain the vcache entry lock. * This leads to bad races when osi_ReleaseVM() is called from diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h index ac0473d..da79b61 100644 --- a/src/afs/afs_prototypes.h +++ b/src/afs/afs_prototypes.h @@ -622,7 +622,6 @@ extern int osi_Active(struct vcache *avc); extern void osi_FlushPages(struct vcache *avc, afs_ucred_t *credp); extern void osi_FlushText_really(struct vcache *vp); -extern int osi_VMDirty_p(struct vcache *avc); #ifndef UKERNEL extern void osi_ReleaseVM(struct vcache *avc, afs_ucred_t *acred); #endif -- 1.9.4