diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-03-31 12:35:13 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-11 22:27:56 -0400 |
commit | 6e242a1ceeb1bcf55ffefa84d3079f711fe8a667 (patch) | |
tree | dfb200b1b2769808fa6115f13782307a7197ce24 /mm/nommu.c | |
parent | d0f88f8d5da674445f23ace60bb1896f4a3a3783 (diff) | |
download | op-kernel-dev-6e242a1ceeb1bcf55ffefa84d3079f711fe8a667.zip op-kernel-dev-6e242a1ceeb1bcf55ffefa84d3079f711fe8a667.tar.gz |
nommu: use __vfs_read()
... instead of open-coding the call of ->read()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm/nommu.c')
-rw-r--r-- | mm/nommu.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1016,7 +1016,7 @@ static int validate_mmap_request(struct file *file, * device */ if (!file->f_op->get_unmapped_area) capabilities &= ~NOMMU_MAP_DIRECT; - if (!file->f_op->read) + if (!(file->f_mode & FMODE_CAN_READ)) capabilities &= ~NOMMU_MAP_COPY; /* The file shall have been opened with read permission. */ @@ -1240,7 +1240,7 @@ static int do_mmap_private(struct vm_area_struct *vma, old_fs = get_fs(); set_fs(KERNEL_DS); - ret = vma->vm_file->f_op->read(vma->vm_file, base, len, &fpos); + ret = __vfs_read(vma->vm_file, base, len, &fpos); set_fs(old_fs); if (ret < 0) |