From: Simon Wilkinson Date: Fri, 30 Jan 2009 14:36:24 +0000 (+0000) Subject: DEVEL15-linux-vmtruncate-20090130 X-Git-Tag: openafs-devel-1_5_58~162 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=fc7717096aa7c4f9a724c50b8d33b4001a781ece;p=packages%2Fo%2Fopenafs.git DEVEL15-linux-vmtruncate-20090130 LICENSE IPL10 FIXES 124128 use linux's vmtruncate feature instead of doing a somewhat-right internal versio n (cherry picked from commit 175393288df30ca88178ee98cdfff364bffbabb7) --- diff --git a/src/afs/LINUX/osi_vm.c b/src/afs/LINUX/osi_vm.c index c61822856..a22de829e 100644 --- a/src/afs/LINUX/osi_vm.c +++ b/src/afs/LINUX/osi_vm.c @@ -52,7 +52,7 @@ osi_VM_FlushVCache(struct vcache *avc, int *slept) return EBUSY; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) - truncate_inode_pages(&ip->i_data, 0); + return vmtruncate(ip, 0); #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15) truncate_inode_pages(ip, 0); #else @@ -131,9 +131,7 @@ void osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) - struct inode *ip = AFSTOV(avc); - - truncate_inode_pages(&ip->i_data, 0); + vmtruncate(AFSTOV(avc), 0); #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15) struct inode *ip = AFSTOV(avc); @@ -153,9 +151,7 @@ void osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) - struct inode *ip = AFSTOV(avc); - - truncate_inode_pages(&ip->i_data, alen); + vmtruncate(AFSTOV(avc), alen); #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15) struct inode *ip = AFSTOV(avc);