if (pp->index >= end_index + 1 || !offset)
return -EIO;
do_it:
- AFS_GLOCK();
status = afs_linux_writepage_sync(inode, pp, 0, offset);
- AFS_GUNLOCK();
SetPageUptodate(pp);
UnlockPage(pp);
if (status == offset)
base = (pp->index << PAGE_CACHE_SHIFT) + offset;
credp = crref();
+ lock_kernel();
+ AFS_GLOCK();
afs_Trace4(afs_iclSetp, CM_TRACE_UPDATEPAGE, ICL_TYPE_POINTER, vcp,
ICL_TYPE_POINTER, pp, ICL_TYPE_INT32, page_count(pp),
ICL_TYPE_INT32, 99999);
ICL_TYPE_POINTER, pp, ICL_TYPE_INT32, page_count(pp),
ICL_TYPE_INT32, code);
+ AFS_GUNLOCK();
+ unlock_kernel();
crfree(credp);
kunmap(pp);
return code;
}
-static int
-afs_linux_updatepage(struct file *file, struct page *page,
- unsigned long offset, unsigned int count)
-{
- struct dentry *dentry = file->f_dentry;
-
- return afs_linux_writepage_sync(dentry->d_inode, page, offset, count);
-}
#else
/* afs_linux_updatepage
* What one would have thought was writepage - write dirty page to file.
{
int code;
- lock_kernel();
- AFS_GLOCK();
- code = afs_linux_updatepage(file, page, offset, to - offset);
- AFS_GUNLOCK();
- unlock_kernel();
+ code = afs_linux_writepage_sync(file->f_dentry->d_inode, page,
+ offset, to - offset);
+#if !defined(AFS_LINUX26_ENV)
kunmap(page);
+#endif
return code;
}
afs_linux_prepare_write(struct file *file, struct page *page, unsigned from,
unsigned to)
{
+/* sometime between 2.4.0 and 2.4.19, the callers of prepare_write began to
+ call kmap directly instead of relying on us to do it */
+#if !defined(AFS_LINUX26_ENV)
kmap(page);
+#endif
return 0;
}