aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-11-01 11:36:42 -0400
committerDan Williams <dan.j.williams@intel.com>2017-11-03 09:26:25 -0400
commitcaa51d26f85c248f1c4f43a870ad3ef84bf9eb8f (patch)
tree1949315570cf10dc95ebf1dde715cc1abaf81a2f /include/linux/mm.h
parentb6fb293f2497a9841d94f6b57bd2bb2cd222da43 (diff)
dax, iomap: Add support for synchronous faults
Add a flag to iomap interface informing the caller that inode needs fdstasync(2) for returned extent to become persistent and use it in DAX fault code so that we don't map such extents into page tables immediately. Instead we propagate the information that fdatasync(2) is necessary from dax_iomap_fault() with a new VM_FAULT_NEEDDSYNC flag. Filesystem fault handler is then responsible for calling fdatasync(2) and inserting pfn into page tables. Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 5411cb7442de..f57e55782d7d 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1182,6 +1182,9 @@ static inline void clear_page_pfmemalloc(struct page *page)
1182#define VM_FAULT_RETRY 0x0400 /* ->fault blocked, must retry */ 1182#define VM_FAULT_RETRY 0x0400 /* ->fault blocked, must retry */
1183#define VM_FAULT_FALLBACK 0x0800 /* huge page fault failed, fall back to small */ 1183#define VM_FAULT_FALLBACK 0x0800 /* huge page fault failed, fall back to small */
1184#define VM_FAULT_DONE_COW 0x1000 /* ->fault has fully handled COW */ 1184#define VM_FAULT_DONE_COW 0x1000 /* ->fault has fully handled COW */
1185#define VM_FAULT_NEEDDSYNC 0x2000 /* ->fault did not modify page tables
1186 * and needs fsync() to complete (for
1187 * synchronous page faults in DAX) */
1185 1188
1186#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_SIGSEGV | \ 1189#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_SIGSEGV | \
1187 VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_LARGE | \ 1190 VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_LARGE | \
@@ -1199,7 +1202,8 @@ static inline void clear_page_pfmemalloc(struct page *page)
1199 { VM_FAULT_LOCKED, "LOCKED" }, \ 1202 { VM_FAULT_LOCKED, "LOCKED" }, \
1200 { VM_FAULT_RETRY, "RETRY" }, \ 1203 { VM_FAULT_RETRY, "RETRY" }, \
1201 { VM_FAULT_FALLBACK, "FALLBACK" }, \ 1204 { VM_FAULT_FALLBACK, "FALLBACK" }, \
1202 { VM_FAULT_DONE_COW, "DONE_COW" } 1205 { VM_FAULT_DONE_COW, "DONE_COW" }, \
1206 { VM_FAULT_NEEDDSYNC, "NEEDDSYNC" }
1203 1207
1204/* Encode hstate index for a hwpoisoned large page */ 1208/* Encode hstate index for a hwpoisoned large page */
1205#define VM_FAULT_SET_HINDEX(x) ((x) << 12) 1209#define VM_FAULT_SET_HINDEX(x) ((x) << 12)