From: Nickolai Zeldovich Date: Tue, 29 Jan 2002 16:18:58 +0000 (+0000) Subject: STABLE12-linux-use-fdatasync-directly-20020129 X-Git-Tag: openafs-stable-1_2_3~6 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=670138541918d383a4bf32178804b3f770339059;p=packages%2Fo%2Fopenafs.git STABLE12-linux-use-fdatasync-directly-20020129 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) --- diff --git a/src/afs/LINUX/osi_vm.c b/src/afs/LINUX/osi_vm.c index b5e0491f7..cb3b56916 100644 --- a/src/afs/LINUX/osi_vm.c +++ b/src/afs/LINUX/osi_vm.c @@ -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