From 37995231e4a38607119964d71fedd717e9365184 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Thu, 2 Apr 2009 14:25:35 +0200 Subject: [PATCH] --- yaml --- r: 140415 b: refs/heads/master c: fc280c9692031ee41545d6bea00bbb7c7dec97a9 h: refs/heads/master i: 140413: 49dd4e08134a64ece2a6e403c9ba876e28b3e3f1 140411: dca03a95bb0b78dd33af4758b62ba34c84babb02 140407: 70f4534c9c837a23aa590ec630bd203dae1350c0 140399: 53c1afac04eaae07976fff8a85a2aec465fc09b8 140383: 1dec33142c1b65168de8835a8d3e3952f24ec1ee 140351: 87a1ce886c21915eba107cc266104f8131aa5896 140287: 5cc369f156f403011c296af939a0a602dec0afa3 v: v3 --- [refs] | 2 +- trunk/fs/fuse/file.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 1f5c2a4c9de5..c7a655d6fb35 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f4975c67dd9ad8eb47a4c77af0521a2b16ee0197 +refs/heads/master: fc280c9692031ee41545d6bea00bbb7c7dec97a9 diff --git a/trunk/fs/fuse/file.c b/trunk/fs/fuse/file.c index 78a2c8333700..2b25133524a3 100644 --- a/trunk/fs/fuse/file.c +++ b/trunk/fs/fuse/file.c @@ -1292,6 +1292,15 @@ static int fuse_file_mmap(struct file *file, struct vm_area_struct *vma) return 0; } +static int fuse_direct_mmap(struct file *file, struct vm_area_struct *vma) +{ + /* Can't provide the coherency needed for MAP_SHARED */ + if (vma->vm_flags & VM_MAYSHARE) + return -ENODEV; + + return generic_file_mmap(file, vma); +} + static int convert_fuse_file_lock(const struct fuse_file_lock *ffl, struct file_lock *fl) { @@ -1926,6 +1935,7 @@ static const struct file_operations fuse_direct_io_file_operations = { .llseek = fuse_file_llseek, .read = fuse_direct_read, .write = fuse_direct_write, + .mmap = fuse_direct_mmap, .open = fuse_open, .flush = fuse_flush, .release = fuse_release, @@ -1935,7 +1945,7 @@ static const struct file_operations fuse_direct_io_file_operations = { .unlocked_ioctl = fuse_file_ioctl, .compat_ioctl = fuse_file_compat_ioctl, .poll = fuse_file_poll, - /* no mmap and splice_read */ + /* no splice_read */ }; static const struct address_space_operations fuse_file_aops = {