]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-linux-vmtruncate-20090130
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Thu, 12 Mar 2009 18:37:56 +0000 (18:37 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 12 Mar 2009 18:37:56 +0000 (18:37 +0000)
LICENSE IPL10
FIXES 124128

use linux's vmtruncate feature instead of doing a somewhat-right internal version

(cherry picked from commit 175393288df30ca88178ee98cdfff364bffbabb7)

src/afs/LINUX/osi_vm.c

index c7e39e29a46b3d55cc06a292158178a128620201..1236f02c55112a8bea11a9911a7edb6c6450ac92 100644 (file)
@@ -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);