From: Nickolai Zeldovich Date: Tue, 29 Jan 2002 16:07:27 +0000 (+0000) Subject: Use filemap_fdata{sync,wait} directly (available in 2.4.5 and above) X-Git-Tag: openafs-devel-1_3_0~24 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=30c69dae289b0184d2d38e4d9781de5a2c81952c 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. --- diff --git a/src/afs/LINUX/osi_vm.c b/src/afs/LINUX/osi_vm.c index b5e0491..cb3b569 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