提交 e1ebfd33 编写于 作者: T Trond Myklebust

NFS: Kill the "defined but not used" compile error on nommu machines

Bryan Wu reports that when compiling NFS on nommu machines he gets a
"defined but not used" error on nfs_file_mmap().

The easiest fix is simply to get rid of the special casing in NFS, and
just always call generic_file_mmap() to set up the file.
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 72cb77f4
...@@ -64,11 +64,7 @@ const struct file_operations nfs_file_operations = { ...@@ -64,11 +64,7 @@ const struct file_operations nfs_file_operations = {
.write = do_sync_write, .write = do_sync_write,
.aio_read = nfs_file_read, .aio_read = nfs_file_read,
.aio_write = nfs_file_write, .aio_write = nfs_file_write,
#ifdef CONFIG_MMU
.mmap = nfs_file_mmap, .mmap = nfs_file_mmap,
#else
.mmap = generic_file_mmap,
#endif
.open = nfs_file_open, .open = nfs_file_open,
.flush = nfs_file_flush, .flush = nfs_file_flush,
.release = nfs_file_release, .release = nfs_file_release,
...@@ -304,11 +300,13 @@ nfs_file_mmap(struct file * file, struct vm_area_struct * vma) ...@@ -304,11 +300,13 @@ nfs_file_mmap(struct file * file, struct vm_area_struct * vma)
dprintk("NFS: mmap(%s/%s)\n", dprintk("NFS: mmap(%s/%s)\n",
dentry->d_parent->d_name.name, dentry->d_name.name); dentry->d_parent->d_name.name, dentry->d_name.name);
status = nfs_revalidate_mapping(inode, file->f_mapping); /* Note: generic_file_mmap() returns ENOSYS on nommu systems
* so we call that before revalidating the mapping
*/
status = generic_file_mmap(file, vma);
if (!status) { if (!status) {
vma->vm_ops = &nfs_file_vm_ops; vma->vm_ops = &nfs_file_vm_ops;
vma->vm_flags |= VM_CAN_NONLINEAR; status = nfs_revalidate_mapping(inode, file->f_mapping);
file_accessed(file);
} }
return status; return status;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册