aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mmap.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-23 17:07:38 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-22 23:31:31 -0500
commit496ad9aa8ef448058e36ca7a787c61f2e63f0f54 (patch)
tree8f4abde793cd7db5bb8fde6d27ebcacd0e54379a /mm/mmap.c
parent57eccb830f1cc93d4b506ba306d8dfa685e0c88f (diff)
new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm/mmap.c')
-rw-r--r--mm/mmap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index 35730ee9d515..22dfc01e9681 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -202,7 +202,7 @@ static void __remove_shared_vm_struct(struct vm_area_struct *vma,
202 struct file *file, struct address_space *mapping) 202 struct file *file, struct address_space *mapping)
203{ 203{
204 if (vma->vm_flags & VM_DENYWRITE) 204 if (vma->vm_flags & VM_DENYWRITE)
205 atomic_inc(&file->f_path.dentry->d_inode->i_writecount); 205 atomic_inc(&file_inode(file)->i_writecount);
206 if (vma->vm_flags & VM_SHARED) 206 if (vma->vm_flags & VM_SHARED)
207 mapping->i_mmap_writable--; 207 mapping->i_mmap_writable--;
208 208
@@ -567,7 +567,7 @@ static void __vma_link_file(struct vm_area_struct *vma)
567 struct address_space *mapping = file->f_mapping; 567 struct address_space *mapping = file->f_mapping;
568 568
569 if (vma->vm_flags & VM_DENYWRITE) 569 if (vma->vm_flags & VM_DENYWRITE)
570 atomic_dec(&file->f_path.dentry->d_inode->i_writecount); 570 atomic_dec(&file_inode(file)->i_writecount);
571 if (vma->vm_flags & VM_SHARED) 571 if (vma->vm_flags & VM_SHARED)
572 mapping->i_mmap_writable++; 572 mapping->i_mmap_writable++;
573 573
@@ -1217,7 +1217,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
1217 return -EAGAIN; 1217 return -EAGAIN;
1218 } 1218 }
1219 1219
1220 inode = file ? file->f_path.dentry->d_inode : NULL; 1220 inode = file ? file_inode(file) : NULL;
1221 1221
1222 if (file) { 1222 if (file) {
1223 switch (flags & MAP_TYPE) { 1223 switch (flags & MAP_TYPE) {
@@ -1403,7 +1403,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
1403 int error; 1403 int error;
1404 struct rb_node **rb_link, *rb_parent; 1404 struct rb_node **rb_link, *rb_parent;
1405 unsigned long charged = 0; 1405 unsigned long charged = 0;
1406 struct inode *inode = file ? file->f_path.dentry->d_inode : NULL; 1406 struct inode *inode = file ? file_inode(file) : NULL;
1407 1407
1408 /* Clear old maps */ 1408 /* Clear old maps */
1409 error = -ENOMEM; 1409 error = -ENOMEM;