aboutsummaryrefslogtreecommitdiff
path: root/fs/fuse/file.c
diff options
context:
space:
mode:
authorStefan Hajnoczi2020-08-19 18:19:52 -0400
committerMiklos Szeredi2020-09-10 11:39:23 +0200
commit2a9a609a0c4a3b0a6892fbe360b8c419839e6da7 (patch)
treea4f00f92b7b89b5c0461c86b5920e610bebb6ec9 /fs/fuse/file.c
parentc2d0ad00d948de73c78f05d2b3e5bdfa605035cc (diff)
virtiofs: add DAX mmap support
Add DAX mmap() support. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/file.c')
-rw-r--r--fs/fuse/file.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 6c586bc97b64..2aac787464bc 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -2325,6 +2325,10 @@ static int fuse_file_mmap(struct file *file, struct vm_area_struct *vma)
{
struct fuse_file *ff = file->private_data;
+ /* DAX mmap is superior to direct_io mmap */
+ if (FUSE_IS_DAX(file_inode(file)))
+ return fuse_dax_mmap(file, vma);
+
if (ff->open_flags & FOPEN_DIRECT_IO) {
/* Can't provide the coherency needed for MAP_SHARED */
if (vma->vm_flags & VM_MAYSHARE)
@@ -3413,6 +3417,7 @@ static const struct file_operations fuse_file_operations = {
.release = fuse_release,
.fsync = fuse_fsync,
.lock = fuse_file_lock,
+ .get_unmapped_area = thp_get_unmapped_area,
.flock = fuse_file_flock,
.splice_read = generic_file_splice_read,
.splice_write = iter_file_splice_write,