summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/dax.c4
-rw-r--r--fs/iomap.c5
-rw-r--r--include/linux/iomap.h1
3 files changed, 6 insertions, 4 deletions
diff --git a/fs/dax.c b/fs/dax.c
index 281e91a..28af41b 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -1266,7 +1266,7 @@ int dax_iomap_fault(struct vm_area_struct *vma, struct vm_fault *vmf,
loff_t pos = (loff_t)vmf->pgoff << PAGE_SHIFT;
sector_t sector;
struct iomap iomap = { 0 };
- unsigned flags = 0;
+ unsigned flags = IOMAP_FAULT;
int error, major = 0;
int locked_status = 0;
void *entry;
@@ -1467,7 +1467,7 @@ int dax_iomap_pmd_fault(struct vm_area_struct *vma, unsigned long address,
struct address_space *mapping = vma->vm_file->f_mapping;
unsigned long pmd_addr = address & PMD_MASK;
bool write = flags & FAULT_FLAG_WRITE;
- unsigned int iomap_flags = write ? IOMAP_WRITE : 0;
+ unsigned int iomap_flags = (write ? IOMAP_WRITE : 0) | IOMAP_FAULT;
struct inode *inode = mapping->host;
int result = VM_FAULT_FALLBACK;
struct iomap iomap = { 0 };
diff --git a/fs/iomap.c b/fs/iomap.c
index 013d1d3..51a0257 100644
--- a/fs/iomap.c
+++ b/fs/iomap.c
@@ -468,8 +468,9 @@ int iomap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
offset = page_offset(page);
while (length > 0) {
- ret = iomap_apply(inode, offset, length, IOMAP_WRITE,
- ops, page, iomap_page_mkwrite_actor);
+ ret = iomap_apply(inode, offset, length,
+ IOMAP_WRITE | IOMAP_FAULT, ops, page,
+ iomap_page_mkwrite_actor);
if (unlikely(ret <= 0))
goto out_unlock;
offset += ret;
diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index e63e288..b9e7b8e 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -44,6 +44,7 @@ struct iomap {
*/
#define IOMAP_WRITE (1 << 0)
#define IOMAP_ZERO (1 << 1)
+#define IOMAP_FAULT (1 << 3) /* mapping for page fault */
struct iomap_ops {
/*
OpenPOWER on IntegriCloud