diff options
author | Jan Kara <jack@suse.cz> | 2017-11-01 16:36:35 +0100 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2017-11-03 06:26:23 -0700 |
commit | d2c43ef13327478b299db0f58193495367c6d4ae (patch) | |
tree | 8d5daaa905c7189033e4816049babc7a5906215e /fs/dax.c | |
parent | a0987ad5c576626fdb40547f5ac99b4f90608dda (diff) | |
download | lwn-d2c43ef13327478b299db0f58193495367c6d4ae.tar.gz lwn-d2c43ef13327478b299db0f58193495367c6d4ae.zip |
dax: Create local variable for vmf->flags & FAULT_FLAG_WRITE test
There are already two users and more are coming.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'fs/dax.c')
-rw-r--r-- | fs/dax.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1116,6 +1116,7 @@ static int dax_iomap_pte_fault(struct vm_fault *vmf, struct iomap iomap = { 0 }; unsigned flags = IOMAP_FAULT; int error, major = 0; + bool write = vmf->flags & FAULT_FLAG_WRITE; int vmf_ret = 0; void *entry; @@ -1130,7 +1131,7 @@ static int dax_iomap_pte_fault(struct vm_fault *vmf, goto out; } - if ((vmf->flags & FAULT_FLAG_WRITE) && !vmf->cow_page) + if (write && !vmf->cow_page) flags |= IOMAP_WRITE; entry = grab_mapping_entry(mapping, vmf->pgoff, 0); @@ -1207,7 +1208,7 @@ static int dax_iomap_pte_fault(struct vm_fault *vmf, break; case IOMAP_UNWRITTEN: case IOMAP_HOLE: - if (!(vmf->flags & FAULT_FLAG_WRITE)) { + if (!write) { vmf_ret = dax_load_hole(mapping, entry, vmf); goto finish_iomap; } |