]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
truncate-inode-pages-for-linux22-20010420
authorDerrick Brashear <shadow@dementia.org>
Sat, 21 Apr 2001 02:35:29 +0000 (02:35 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sat, 21 Apr 2001 02:35:29 +0000 (02:35 +0000)
backport support for 2.2 kernerls

src/afs/LINUX/osi_misc.c
src/afs/LINUX/osi_vm.c

index 1f22161130795c11b76b26eb33adb9ca4b590f6c..87ef735c5448937d2f284ed7550b37fcf8773e0c 100644 (file)
@@ -302,8 +302,10 @@ void osi_linux_free_inode_pages(void)
 #else
            if (ip->i_nrpages) {
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
                truncate_inode_pages(&ip->i_data, 0);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15)
+               truncate_inode_pages(ip, 0);
 #else
                invalidate_inode_pages(ip);
 #endif
index 927d992459097519fb06b4dcdf42718f53e307d0..675c48eb2680d9c3f82ca372c90d41660861f527 100644 (file)
@@ -45,8 +45,10 @@ int osi_VM_FlushVCache(struct vcache *avc, int *slept)
     if (avc->opens != 0)
        return EBUSY;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     truncate_inode_pages(&ip->i_data, 0);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15)
+    truncate_inode_pages(ip, 0);
 #else
     invalidate_inode_pages(ip);
 #endif
@@ -64,10 +66,14 @@ int osi_VM_FlushVCache(struct vcache *avc, int *slept)
  */
 void osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred, int sync)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     struct inode *ip = (struct inode*)avc;
 
     truncate_inode_pages(&ip->i_data, 0);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15)
+    struct inode *ip = (struct inode*)avc;
+
+    truncate_inode_pages(ip, 0);
 #else
     invalidate_inode_pages((struct inode *)avc);
 #endif
@@ -98,10 +104,14 @@ void osi_VM_StoreAllSegments(struct vcache *avc)
  */
 void osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     struct inode *ip = (struct inode*)avc;
 
     truncate_inode_pages(&ip->i_data, 0);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15)
+    struct inode *ip = (struct inode*)avc;
+
+    truncate_inode_pages(ip, 0);
 #else
     invalidate_inode_pages((struct inode*)avc);
 #endif
@@ -115,10 +125,14 @@ void osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp)
  */
 void osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
     struct inode *ip = (struct inode*)avc;
 
     truncate_inode_pages(&ip->i_data, alen);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15)
+    struct inode *ip = (struct inode*)avc;
+
+    truncate_inode_pages(ip, alen);
 #else
     invalidate_inode_pages((struct inode*)avc);
 #endif