new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -202,7 +202,7 @@ static void __remove_shared_vm_struct(struct vm_area_struct *vma,
|
||||
struct file *file, struct address_space *mapping)
|
||||
{
|
||||
if (vma->vm_flags & VM_DENYWRITE)
|
||||
atomic_inc(&file->f_path.dentry->d_inode->i_writecount);
|
||||
atomic_inc(&file_inode(file)->i_writecount);
|
||||
if (vma->vm_flags & VM_SHARED)
|
||||
mapping->i_mmap_writable--;
|
||||
|
||||
@@ -567,7 +567,7 @@ static void __vma_link_file(struct vm_area_struct *vma)
|
||||
struct address_space *mapping = file->f_mapping;
|
||||
|
||||
if (vma->vm_flags & VM_DENYWRITE)
|
||||
atomic_dec(&file->f_path.dentry->d_inode->i_writecount);
|
||||
atomic_dec(&file_inode(file)->i_writecount);
|
||||
if (vma->vm_flags & VM_SHARED)
|
||||
mapping->i_mmap_writable++;
|
||||
|
||||
@@ -1217,7 +1217,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
inode = file ? file->f_path.dentry->d_inode : NULL;
|
||||
inode = file ? file_inode(file) : NULL;
|
||||
|
||||
if (file) {
|
||||
switch (flags & MAP_TYPE) {
|
||||
@@ -1403,7 +1403,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
|
||||
int error;
|
||||
struct rb_node **rb_link, *rb_parent;
|
||||
unsigned long charged = 0;
|
||||
struct inode *inode = file ? file->f_path.dentry->d_inode : NULL;
|
||||
struct inode *inode = file ? file_inode(file) : NULL;
|
||||
|
||||
/* Clear old maps */
|
||||
error = -ENOMEM;
|
||||
|
Reference in New Issue
Block a user