diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/file.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 404c19c866a7..1eab9c9ad242 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -64,11 +64,7 @@ const struct file_operations nfs_file_operations = { | |||
64 | .write = do_sync_write, | 64 | .write = do_sync_write, |
65 | .aio_read = nfs_file_read, | 65 | .aio_read = nfs_file_read, |
66 | .aio_write = nfs_file_write, | 66 | .aio_write = nfs_file_write, |
67 | #ifdef CONFIG_MMU | ||
68 | .mmap = nfs_file_mmap, | 67 | .mmap = nfs_file_mmap, |
69 | #else | ||
70 | .mmap = generic_file_mmap, | ||
71 | #endif | ||
72 | .open = nfs_file_open, | 68 | .open = nfs_file_open, |
73 | .flush = nfs_file_flush, | 69 | .flush = nfs_file_flush, |
74 | .release = nfs_file_release, | 70 | .release = nfs_file_release, |
@@ -304,11 +300,13 @@ nfs_file_mmap(struct file * file, struct vm_area_struct * vma) | |||
304 | dprintk("NFS: mmap(%s/%s)\n", | 300 | dprintk("NFS: mmap(%s/%s)\n", |
305 | dentry->d_parent->d_name.name, dentry->d_name.name); | 301 | dentry->d_parent->d_name.name, dentry->d_name.name); |
306 | 302 | ||
307 | status = nfs_revalidate_mapping(inode, file->f_mapping); | 303 | /* Note: generic_file_mmap() returns ENOSYS on nommu systems |
304 | * so we call that before revalidating the mapping | ||
305 | */ | ||
306 | status = generic_file_mmap(file, vma); | ||
308 | if (!status) { | 307 | if (!status) { |
309 | vma->vm_ops = &nfs_file_vm_ops; | 308 | vma->vm_ops = &nfs_file_vm_ops; |
310 | vma->vm_flags |= VM_CAN_NONLINEAR; | 309 | status = nfs_revalidate_mapping(inode, file->f_mapping); |
311 | file_accessed(file); | ||
312 | } | 310 | } |
313 | return status; | 311 | return status; |
314 | } | 312 | } |