]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE12-linux-use-fdatasync-directly-20020129
authorNickolai Zeldovich <kolya@mit.edu>
Tue, 29 Jan 2002 16:18:58 +0000 (16:18 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 29 Jan 2002 16:18:58 +0000 (16:18 +0000)
Use filemap_fdata{sync,wait} directly (available in 2.4.5 and above)
rather than write_inode_now(), which steals afs inodes and puts them
on the global inode lists.

(cherry picked from commit 30c69dae289b0184d2d38e4d9781de5a2c81952c)

src/afs/LINUX/osi_vm.c

index b5e0491f749a52c195870a0b35af22badaa96419..cb3b5691629b85eeaffad6d6a8f4fbf812a231c3 100644 (file)
@@ -89,12 +89,14 @@ void osi_VM_FSyncInval(struct vcache *avc)
  */
 void osi_VM_StoreAllSegments(struct vcache *avc)
 {
-#ifdef AFS_LINUX24_ENV
     struct inode *ip = (struct inode *) avc;
-   
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,5)
+    /* filemap_fdatasync() only exported in 2.4.5 and above */
     ReleaseWriteLock(&avc->lock);
     AFS_GUNLOCK();
-    write_inode_now(ip, 1);
+    filemap_fdatasync(ip->i_mapping);
+    filemap_fdatawait(ip->i_mapping);
     AFS_GLOCK();
     ObtainWriteLock(&avc->lock, 121);
 #endif