diff options
Diffstat (limited to 'mm')
| -rw-r--r-- | mm/nommu.c | 4 | ||||
| -rw-r--r-- | mm/shmem.c | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/mm/nommu.c b/mm/nommu.c index 3fba2dc97c44..e544508e2a4b 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
| @@ -1016,7 +1016,7 @@ static int validate_mmap_request(struct file *file, | |||
| 1016 | * device */ | 1016 | * device */ |
| 1017 | if (!file->f_op->get_unmapped_area) | 1017 | if (!file->f_op->get_unmapped_area) |
| 1018 | capabilities &= ~NOMMU_MAP_DIRECT; | 1018 | capabilities &= ~NOMMU_MAP_DIRECT; |
| 1019 | if (!file->f_op->read) | 1019 | if (!(file->f_mode & FMODE_CAN_READ)) |
| 1020 | capabilities &= ~NOMMU_MAP_COPY; | 1020 | capabilities &= ~NOMMU_MAP_COPY; |
| 1021 | 1021 | ||
| 1022 | /* The file shall have been opened with read permission. */ | 1022 | /* The file shall have been opened with read permission. */ |
| @@ -1240,7 +1240,7 @@ static int do_mmap_private(struct vm_area_struct *vma, | |||
| 1240 | 1240 | ||
| 1241 | old_fs = get_fs(); | 1241 | old_fs = get_fs(); |
| 1242 | set_fs(KERNEL_DS); | 1242 | set_fs(KERNEL_DS); |
| 1243 | ret = vma->vm_file->f_op->read(vma->vm_file, base, len, &fpos); | 1243 | ret = __vfs_read(vma->vm_file, base, len, &fpos); |
| 1244 | set_fs(old_fs); | 1244 | set_fs(old_fs); |
| 1245 | 1245 | ||
| 1246 | if (ret < 0) | 1246 | if (ret < 0) |
diff --git a/mm/shmem.c b/mm/shmem.c index 80b360c7bcd1..1ea2400b5245 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
| @@ -3118,8 +3118,6 @@ static const struct file_operations shmem_file_operations = { | |||
| 3118 | .mmap = shmem_mmap, | 3118 | .mmap = shmem_mmap, |
| 3119 | #ifdef CONFIG_TMPFS | 3119 | #ifdef CONFIG_TMPFS |
| 3120 | .llseek = shmem_file_llseek, | 3120 | .llseek = shmem_file_llseek, |
| 3121 | .read = new_sync_read, | ||
| 3122 | .write = new_sync_write, | ||
| 3123 | .read_iter = shmem_file_read_iter, | 3121 | .read_iter = shmem_file_read_iter, |
| 3124 | .write_iter = generic_file_write_iter, | 3122 | .write_iter = generic_file_write_iter, |
| 3125 | .fsync = noop_fsync, | 3123 | .fsync = noop_fsync, |
