Commit a0987ad5 authored by Jan Kara's avatar Jan Kara Committed by Dan Williams

dax: Create local variable for VMA in dax_iomap_pte_fault()

There are already two users and more are coming.
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 5e161e40
...@@ -1108,7 +1108,8 @@ static int dax_fault_return(int error) ...@@ -1108,7 +1108,8 @@ static int dax_fault_return(int error)
static int dax_iomap_pte_fault(struct vm_fault *vmf, static int dax_iomap_pte_fault(struct vm_fault *vmf,
const struct iomap_ops *ops) const struct iomap_ops *ops)
{ {
struct address_space *mapping = vmf->vma->vm_file->f_mapping; struct vm_area_struct *vma = vmf->vma;
struct address_space *mapping = vma->vm_file->f_mapping;
struct inode *inode = mapping->host; struct inode *inode = mapping->host;
unsigned long vaddr = vmf->address; unsigned long vaddr = vmf->address;
loff_t pos = (loff_t)vmf->pgoff << PAGE_SHIFT; loff_t pos = (loff_t)vmf->pgoff << PAGE_SHIFT;
...@@ -1196,7 +1197,7 @@ static int dax_iomap_pte_fault(struct vm_fault *vmf, ...@@ -1196,7 +1197,7 @@ static int dax_iomap_pte_fault(struct vm_fault *vmf,
case IOMAP_MAPPED: case IOMAP_MAPPED:
if (iomap.flags & IOMAP_F_NEW) { if (iomap.flags & IOMAP_F_NEW) {
count_vm_event(PGMAJFAULT); count_vm_event(PGMAJFAULT);
count_memcg_event_mm(vmf->vma->vm_mm, PGMAJFAULT); count_memcg_event_mm(vma->vm_mm, PGMAJFAULT);
major = VM_FAULT_MAJOR; major = VM_FAULT_MAJOR;
} }
error = dax_insert_mapping(vmf, &iomap, pos, entry); error = dax_insert_mapping(vmf, &iomap, pos, entry);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment