From: Simon Wilkinson Date: Thu, 12 Mar 2009 18:37:56 +0000 (+0000) Subject: STABLE14-linux-vmtruncate-20090130 X-Git-Tag: openafs-stable-1_4_9pre1~33 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=bda95331a73392c5d7d3cbf5ac7df15bee3dd22f;p=packages%2Fo%2Fopenafs.git STABLE14-linux-vmtruncate-20090130 LICENSE IPL10 FIXES 124128 use linux's vmtruncate feature instead of doing a somewhat-right internal version (cherry picked from commit 175393288df30ca88178ee98cdfff364bffbabb7) --- diff --git a/src/afs/LINUX/osi_vm.c b/src/afs/LINUX/osi_vm.c index c7e39e29a..1236f02c5 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);