From: Derrick Brashear Date: Sat, 21 Apr 2001 02:35:29 +0000 (+0000) Subject: truncate-inode-pages-for-linux22-20010420 X-Git-Tag: openafs-stable-1_1_0~191 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=cb169b7b125167def267d0199e85b0b0af91f597 truncate-inode-pages-for-linux22-20010420 backport support for 2.2 kernerls --- diff --git a/src/afs/LINUX/osi_misc.c b/src/afs/LINUX/osi_misc.c index 1f22161..87ef735 100644 --- a/src/afs/LINUX/osi_misc.c +++ b/src/afs/LINUX/osi_misc.c @@ -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 diff --git a/src/afs/LINUX/osi_vm.c b/src/afs/LINUX/osi_vm.c index 927d992..675c48e 100644 --- a/src/afs/LINUX/osi_vm.c +++ b/src/afs/LINUX/osi_vm.c @@ -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