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

dax: Create local variable for vmf->flags & FAULT_FLAG_WRITE test

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 a0987ad5
...@@ -1116,6 +1116,7 @@ static int dax_iomap_pte_fault(struct vm_fault *vmf, ...@@ -1116,6 +1116,7 @@ static int dax_iomap_pte_fault(struct vm_fault *vmf,
struct iomap iomap = { 0 }; struct iomap iomap = { 0 };
unsigned flags = IOMAP_FAULT; unsigned flags = IOMAP_FAULT;
int error, major = 0; int error, major = 0;
bool write = vmf->flags & FAULT_FLAG_WRITE;
int vmf_ret = 0; int vmf_ret = 0;
void *entry; void *entry;
...@@ -1130,7 +1131,7 @@ static int dax_iomap_pte_fault(struct vm_fault *vmf, ...@@ -1130,7 +1131,7 @@ static int dax_iomap_pte_fault(struct vm_fault *vmf,
goto out; goto out;
} }
if ((vmf->flags & FAULT_FLAG_WRITE) && !vmf->cow_page) if (write && !vmf->cow_page)
flags |= IOMAP_WRITE; flags |= IOMAP_WRITE;
entry = grab_mapping_entry(mapping, vmf->pgoff, 0); entry = grab_mapping_entry(mapping, vmf->pgoff, 0);
...@@ -1207,7 +1208,7 @@ static int dax_iomap_pte_fault(struct vm_fault *vmf, ...@@ -1207,7 +1208,7 @@ static int dax_iomap_pte_fault(struct vm_fault *vmf,
break; break;
case IOMAP_UNWRITTEN: case IOMAP_UNWRITTEN:
case IOMAP_HOLE: case IOMAP_HOLE:
if (!(vmf->flags & FAULT_FLAG_WRITE)) { if (!write) {
vmf_ret = dax_load_hole(mapping, entry, vmf); vmf_ret = dax_load_hole(mapping, entry, vmf);
goto finish_iomap; goto finish_iomap;
} }
......
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