summaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index abc048dc2..9f58b4171 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -99,7 +99,7 @@ nfs_writepage_sync(struct dentry *dentry, struct inode *inode,
dentry->d_parent->d_name.name, dentry->d_name.name,
count, page->index, offset);
- buffer = (u8 *) page_address(page) + offset;
+ buffer = (u8 *) kmap(page) + offset;
offset += page->index << PAGE_CACHE_SHIFT;
do {
@@ -132,6 +132,7 @@ nfs_writepage_sync(struct dentry *dentry, struct inode *inode,
} while (count);
io_error:
+ kunmap(page);
/* Note: we don't refresh if the call failed (fattr invalid) */
if (refresh && result >= 0) {
/* See comments in nfs_wback_result */
@@ -314,6 +315,7 @@ create_write_request(struct file * file, struct page *page, unsigned int offset,
wreq->wb_bytes = bytes;
wreq->wb_count = 2; /* One for the IO, one for us */
+ kmap(page);
append_write_request(&NFS_WRITEBACK(inode), wreq);
if (nr_write_requests++ > NFS_WRITEBACK_MAX*3/4)
@@ -412,9 +414,8 @@ wait_on_write_request(struct nfs_wreq *req)
* (for now), and we currently do this synchronously only.
*/
int
-nfs_writepage(struct file * file, struct page *page)
+nfs_writepage(struct dentry * dentry, struct page *page)
{
- struct dentry *dentry = file->f_dentry;
return nfs_writepage_sync(dentry, dentry->d_inode, page, 0, PAGE_SIZE);
}
@@ -687,6 +688,7 @@ nfs_wback_result(struct rpc_task *task)
if (WB_INVALIDATE(req))
ClearPageUptodate(page);
+ kunmap(page);
__free_page(page);
remove_write_request(&NFS_WRITEBACK(inode), req);
nr_write_requests--;