aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/mmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/mmap.c')
-rw-r--r--fs/ocfs2/mmap.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ocfs2/mmap.c b/fs/ocfs2/mmap.c
index af2b8fe1f139..b04d6961c0d4 100644
--- a/fs/ocfs2/mmap.c
+++ b/fs/ocfs2/mmap.c
@@ -59,10 +59,11 @@ static int ocfs2_fault(struct vm_area_struct *area, struct vm_fault *vmf)
59 return ret; 59 return ret;
60} 60}
61 61
62static int __ocfs2_page_mkwrite(struct inode *inode, struct buffer_head *di_bh, 62static int __ocfs2_page_mkwrite(struct file *file, struct buffer_head *di_bh,
63 struct page *page) 63 struct page *page)
64{ 64{
65 int ret; 65 int ret;
66 struct inode *inode = file->f_path.dentry->d_inode;
66 struct address_space *mapping = inode->i_mapping; 67 struct address_space *mapping = inode->i_mapping;
67 loff_t pos = page_offset(page); 68 loff_t pos = page_offset(page);
68 unsigned int len = PAGE_CACHE_SIZE; 69 unsigned int len = PAGE_CACHE_SIZE;
@@ -109,7 +110,7 @@ static int __ocfs2_page_mkwrite(struct inode *inode, struct buffer_head *di_bh,
109 if (page->index == last_index) 110 if (page->index == last_index)
110 len = size & ~PAGE_CACHE_MASK; 111 len = size & ~PAGE_CACHE_MASK;
111 112
112 ret = ocfs2_write_begin_nolock(mapping, pos, len, 0, &locked_page, 113 ret = ocfs2_write_begin_nolock(file, mapping, pos, len, 0, &locked_page,
113 &fsdata, di_bh, page); 114 &fsdata, di_bh, page);
114 if (ret) { 115 if (ret) {
115 if (ret != -ENOSPC) 116 if (ret != -ENOSPC)
@@ -157,7 +158,7 @@ static int ocfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
157 */ 158 */
158 down_write(&OCFS2_I(inode)->ip_alloc_sem); 159 down_write(&OCFS2_I(inode)->ip_alloc_sem);
159 160
160 ret = __ocfs2_page_mkwrite(inode, di_bh, page); 161 ret = __ocfs2_page_mkwrite(vma->vm_file, di_bh, page);
161 162
162 up_write(&OCFS2_I(inode)->ip_alloc_sem); 163 up_write(&OCFS2_I(inode)->ip_alloc_sem);
163 164