Thread (52 messages) 52 messages, 4 authors, 2017-08-24
STALE3205d
Revisions (2)
  1. rfc [diff vs current]
  2. v2 current

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

From: Jan Kara <hidden>
Date: 2017-08-17 16:08:28
Also in: linux-fsdevel, linux-xfs, nvdimm
Subsystem: filesystem direct access (dax), filesystems (vfs and infrastructure), the rest · Maintainers: Dan Williams, Alexander Viro, Christian Brauner, Linus Torvalds

There are already two users and more are coming.

Signed-off-by: Jan Kara <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help