#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
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;
}
*/
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
*/
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.
*/
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
}