2017-08-17 16:08:06

by Jan Kara

[permalink] [raw]
Subject: [PATCH 04/13] dax: Create local variable for VMA in dax_iomap_pte_fault()

There are already two users and more are coming.

Signed-off-by: Jan Kara <[email protected]>
---
fs/dax.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/dax.c b/fs/dax.c
index 1122356f8b88..75aa0d9fb39f 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -1097,7 +1097,8 @@ static int dax_fault_return(int error)
static int dax_iomap_pte_fault(struct vm_fault *vmf,
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;
unsigned long vaddr = vmf->address;
loff_t pos = (loff_t)vmf->pgoff << PAGE_SHIFT;
@@ -1185,7 +1186,7 @@ static int dax_iomap_pte_fault(struct vm_fault *vmf,
case IOMAP_MAPPED:
if (iomap.flags & IOMAP_F_NEW) {
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;
}
error = dax_insert_mapping(vmf, &iomap, pos, entry);
--
2.12.3


2017-08-18 22:08:00

by Ross Zwisler

[permalink] [raw]
Subject: Re: [PATCH 04/13] dax: Create local variable for VMA in dax_iomap_pte_fault()

On Thu, Aug 17, 2017 at 06:08:06PM +0200, Jan Kara wrote:
> There are already two users and more are coming.
>
> Signed-off-by: Jan Kara <[email protected]>

Sure.

Reviewed-by: Ross Zwisler <[email protected]>