linux-call-truncate-inode-pages-in-preference-to-invalidate-inode-pages-20010420
authorChas Williams <chas@cmf.nrl.navy.mil>
Sat, 21 Apr 2001 02:23:04 +0000 (02:23 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sat, 21 Apr 2001 02:23:04 +0000 (02:23 +0000)
To cure "Failed to invalidate all pages on inode 0xc9208720"

====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================

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

index d9b0515..1f22161 100644 (file)
@@ -302,7 +302,11 @@ void osi_linux_free_inode_pages(void)
 #else
            if (ip->i_nrpages) {
 #endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15)
+               truncate_inode_pages(&ip->i_data, 0);
+#else
                invalidate_inode_pages(ip);
+#endif
 #if defined(AFS_LINUX24_ENV)
                if (ip->i_data.nrpages) {
 #else
index 2b8fbb7..927d992 100644 (file)
@@ -45,7 +45,11 @@ int osi_VM_FlushVCache(struct vcache *avc, int *slept)
     if (avc->opens != 0)
        return EBUSY;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15)
+    truncate_inode_pages(&ip->i_data, 0);
+#else
     invalidate_inode_pages(ip);
+#endif
     return 0;
 }
 
@@ -60,7 +64,13 @@ 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)
+    struct inode *ip = (struct inode*)avc;
+
+    truncate_inode_pages(&ip->i_data, 0);
+#else
     invalidate_inode_pages((struct inode *)avc);
+#endif
 }
 
 /* Flush and invalidate pages, for fsync() with INVAL flag
@@ -88,7 +98,13 @@ 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)
+    struct inode *ip = (struct inode*)avc;
+
+    truncate_inode_pages(&ip->i_data, 0);
+#else
     invalidate_inode_pages((struct inode*)avc);
+#endif
 }
 
 /* Purge pages beyond end-of-file, when truncating a file.
@@ -99,5 +115,11 @@ 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)
+    struct inode *ip = (struct inode*)avc;
+
+    truncate_inode_pages(&ip->i_data, alen);
+#else
     invalidate_inode_pages((struct inode*)avc);
+#endif
 }