diff options
-rw-r--r-- | fs/9p/vfs_file.c | 8 | ||||
-rw-r--r-- | fs/adfs/file.c | 4 | ||||
-rw-r--r-- | fs/affs/file.c | 4 | ||||
-rw-r--r-- | fs/bfs/file.c | 4 | ||||
-rw-r--r-- | fs/ecryptfs/file.c | 4 | ||||
-rw-r--r-- | fs/exofs/file.c | 4 | ||||
-rw-r--r-- | fs/ext2/file.c | 4 | ||||
-rw-r--r-- | fs/ext3/file.c | 4 | ||||
-rw-r--r-- | fs/f2fs/file.c | 4 | ||||
-rw-r--r-- | fs/fat/file.c | 4 | ||||
-rw-r--r-- | fs/hfs/inode.c | 4 | ||||
-rw-r--r-- | fs/hfsplus/inode.c | 4 | ||||
-rw-r--r-- | fs/hostfs/hostfs_kern.c | 4 | ||||
-rw-r--r-- | fs/hpfs/file.c | 4 | ||||
-rw-r--r-- | fs/jffs2/file.c | 4 | ||||
-rw-r--r-- | fs/jfs/file.c | 4 | ||||
-rw-r--r-- | fs/logfs/file.c | 4 | ||||
-rw-r--r-- | fs/minix/file.c | 4 | ||||
-rw-r--r-- | fs/nilfs2/file.c | 4 | ||||
-rw-r--r-- | fs/omfs/file.c | 4 | ||||
-rw-r--r-- | fs/ramfs/file-mmu.c | 4 | ||||
-rw-r--r-- | fs/ramfs/file-nommu.c | 4 | ||||
-rw-r--r-- | fs/reiserfs/file.c | 4 | ||||
-rw-r--r-- | fs/sysv/file.c | 4 | ||||
-rw-r--r-- | fs/ufs/file.c | 4 | ||||
-rw-r--r-- | include/linux/fs.h | 2 | ||||
-rw-r--r-- | mm/filemap.c | 61 | ||||
-rw-r--r-- | mm/shmem.c | 4 | ||||
-rw-r--r-- | mm/vmscan.c | 2 |
29 files changed, 94 insertions, 79 deletions
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 47e0597d1e9b..b9b5f979a2ca 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c | |||
@@ -763,7 +763,7 @@ err_out: | |||
763 | 763 | ||
764 | buff_write: | 764 | buff_write: |
765 | mutex_unlock(&inode->i_mutex); | 765 | mutex_unlock(&inode->i_mutex); |
766 | return do_sync_write(filp, data, count, offsetp); | 766 | return new_sync_write(filp, data, count, offsetp); |
767 | } | 767 | } |
768 | 768 | ||
769 | /** | 769 | /** |
@@ -781,7 +781,7 @@ v9fs_cached_file_write(struct file *filp, const char __user * data, | |||
781 | 781 | ||
782 | if (filp->f_flags & O_DIRECT) | 782 | if (filp->f_flags & O_DIRECT) |
783 | return v9fs_direct_write(filp, data, count, offset); | 783 | return v9fs_direct_write(filp, data, count, offset); |
784 | return do_sync_write(filp, data, count, offset); | 784 | return new_sync_write(filp, data, count, offset); |
785 | } | 785 | } |
786 | 786 | ||
787 | 787 | ||
@@ -851,7 +851,7 @@ const struct file_operations v9fs_cached_file_operations = { | |||
851 | .read = v9fs_cached_file_read, | 851 | .read = v9fs_cached_file_read, |
852 | .write = v9fs_cached_file_write, | 852 | .write = v9fs_cached_file_write, |
853 | .read_iter = generic_file_read_iter, | 853 | .read_iter = generic_file_read_iter, |
854 | .aio_write = generic_file_aio_write, | 854 | .write_iter = generic_file_write_iter, |
855 | .open = v9fs_file_open, | 855 | .open = v9fs_file_open, |
856 | .release = v9fs_dir_release, | 856 | .release = v9fs_dir_release, |
857 | .lock = v9fs_file_lock, | 857 | .lock = v9fs_file_lock, |
@@ -864,7 +864,7 @@ const struct file_operations v9fs_cached_file_operations_dotl = { | |||
864 | .read = v9fs_cached_file_read, | 864 | .read = v9fs_cached_file_read, |
865 | .write = v9fs_cached_file_write, | 865 | .write = v9fs_cached_file_write, |
866 | .read_iter = generic_file_read_iter, | 866 | .read_iter = generic_file_read_iter, |
867 | .aio_write = generic_file_aio_write, | 867 | .write_iter = generic_file_write_iter, |
868 | .open = v9fs_file_open, | 868 | .open = v9fs_file_open, |
869 | .release = v9fs_dir_release, | 869 | .release = v9fs_dir_release, |
870 | .lock = v9fs_file_lock_dotl, | 870 | .lock = v9fs_file_lock_dotl, |
diff --git a/fs/adfs/file.c b/fs/adfs/file.c index 3bfc9efa29b4..07c9edce5aa7 100644 --- a/fs/adfs/file.c +++ b/fs/adfs/file.c | |||
@@ -27,8 +27,8 @@ const struct file_operations adfs_file_operations = { | |||
27 | .read_iter = generic_file_read_iter, | 27 | .read_iter = generic_file_read_iter, |
28 | .mmap = generic_file_mmap, | 28 | .mmap = generic_file_mmap, |
29 | .fsync = generic_file_fsync, | 29 | .fsync = generic_file_fsync, |
30 | .write = do_sync_write, | 30 | .write = new_sync_write, |
31 | .aio_write = generic_file_aio_write, | 31 | .write_iter = generic_file_write_iter, |
32 | .splice_read = generic_file_splice_read, | 32 | .splice_read = generic_file_splice_read, |
33 | }; | 33 | }; |
34 | 34 | ||
diff --git a/fs/affs/file.c b/fs/affs/file.c index 982853f17afc..9df23175e28b 100644 --- a/fs/affs/file.c +++ b/fs/affs/file.c | |||
@@ -29,8 +29,8 @@ const struct file_operations affs_file_operations = { | |||
29 | .llseek = generic_file_llseek, | 29 | .llseek = generic_file_llseek, |
30 | .read = new_sync_read, | 30 | .read = new_sync_read, |
31 | .read_iter = generic_file_read_iter, | 31 | .read_iter = generic_file_read_iter, |
32 | .write = do_sync_write, | 32 | .write = new_sync_write, |
33 | .aio_write = generic_file_aio_write, | 33 | .write_iter = generic_file_write_iter, |
34 | .mmap = generic_file_mmap, | 34 | .mmap = generic_file_mmap, |
35 | .open = affs_file_open, | 35 | .open = affs_file_open, |
36 | .release = affs_file_release, | 36 | .release = affs_file_release, |
diff --git a/fs/bfs/file.c b/fs/bfs/file.c index 0aa788892f93..e7f88ace1a25 100644 --- a/fs/bfs/file.c +++ b/fs/bfs/file.c | |||
@@ -25,8 +25,8 @@ const struct file_operations bfs_file_operations = { | |||
25 | .llseek = generic_file_llseek, | 25 | .llseek = generic_file_llseek, |
26 | .read = new_sync_read, | 26 | .read = new_sync_read, |
27 | .read_iter = generic_file_read_iter, | 27 | .read_iter = generic_file_read_iter, |
28 | .write = do_sync_write, | 28 | .write = new_sync_write, |
29 | .aio_write = generic_file_aio_write, | 29 | .write_iter = generic_file_write_iter, |
30 | .mmap = generic_file_mmap, | 30 | .mmap = generic_file_mmap, |
31 | .splice_read = generic_file_splice_read, | 31 | .splice_read = generic_file_splice_read, |
32 | }; | 32 | }; |
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c index b32827c917e1..db0fad3269c0 100644 --- a/fs/ecryptfs/file.c +++ b/fs/ecryptfs/file.c | |||
@@ -353,8 +353,8 @@ const struct file_operations ecryptfs_main_fops = { | |||
353 | .llseek = generic_file_llseek, | 353 | .llseek = generic_file_llseek, |
354 | .read = new_sync_read, | 354 | .read = new_sync_read, |
355 | .read_iter = ecryptfs_read_update_atime, | 355 | .read_iter = ecryptfs_read_update_atime, |
356 | .write = do_sync_write, | 356 | .write = new_sync_write, |
357 | .aio_write = generic_file_aio_write, | 357 | .write_iter = generic_file_write_iter, |
358 | .iterate = ecryptfs_readdir, | 358 | .iterate = ecryptfs_readdir, |
359 | .unlocked_ioctl = ecryptfs_unlocked_ioctl, | 359 | .unlocked_ioctl = ecryptfs_unlocked_ioctl, |
360 | #ifdef CONFIG_COMPAT | 360 | #ifdef CONFIG_COMPAT |
diff --git a/fs/exofs/file.c b/fs/exofs/file.c index 90d394da7471..5b7f6be5a2d5 100644 --- a/fs/exofs/file.c +++ b/fs/exofs/file.c | |||
@@ -68,9 +68,9 @@ static int exofs_flush(struct file *file, fl_owner_t id) | |||
68 | const struct file_operations exofs_file_operations = { | 68 | const struct file_operations exofs_file_operations = { |
69 | .llseek = generic_file_llseek, | 69 | .llseek = generic_file_llseek, |
70 | .read = new_sync_read, | 70 | .read = new_sync_read, |
71 | .write = do_sync_write, | 71 | .write = new_sync_write, |
72 | .read_iter = generic_file_read_iter, | 72 | .read_iter = generic_file_read_iter, |
73 | .aio_write = generic_file_aio_write, | 73 | .write_iter = generic_file_write_iter, |
74 | .mmap = generic_file_mmap, | 74 | .mmap = generic_file_mmap, |
75 | .open = generic_file_open, | 75 | .open = generic_file_open, |
76 | .release = exofs_release_file, | 76 | .release = exofs_release_file, |
diff --git a/fs/ext2/file.c b/fs/ext2/file.c index 407305072597..970c6aca15cc 100644 --- a/fs/ext2/file.c +++ b/fs/ext2/file.c | |||
@@ -63,9 +63,9 @@ int ext2_fsync(struct file *file, loff_t start, loff_t end, int datasync) | |||
63 | const struct file_operations ext2_file_operations = { | 63 | const struct file_operations ext2_file_operations = { |
64 | .llseek = generic_file_llseek, | 64 | .llseek = generic_file_llseek, |
65 | .read = new_sync_read, | 65 | .read = new_sync_read, |
66 | .write = do_sync_write, | 66 | .write = new_sync_write, |
67 | .read_iter = generic_file_read_iter, | 67 | .read_iter = generic_file_read_iter, |
68 | .aio_write = generic_file_aio_write, | 68 | .write_iter = generic_file_write_iter, |
69 | .unlocked_ioctl = ext2_ioctl, | 69 | .unlocked_ioctl = ext2_ioctl, |
70 | #ifdef CONFIG_COMPAT | 70 | #ifdef CONFIG_COMPAT |
71 | .compat_ioctl = ext2_compat_ioctl, | 71 | .compat_ioctl = ext2_compat_ioctl, |
diff --git a/fs/ext3/file.c b/fs/ext3/file.c index 5439d2f0141b..c833b1226d4d 100644 --- a/fs/ext3/file.c +++ b/fs/ext3/file.c | |||
@@ -51,9 +51,9 @@ static int ext3_release_file (struct inode * inode, struct file * filp) | |||
51 | const struct file_operations ext3_file_operations = { | 51 | const struct file_operations ext3_file_operations = { |
52 | .llseek = generic_file_llseek, | 52 | .llseek = generic_file_llseek, |
53 | .read = new_sync_read, | 53 | .read = new_sync_read, |
54 | .write = do_sync_write, | 54 | .write = new_sync_write, |
55 | .read_iter = generic_file_read_iter, | 55 | .read_iter = generic_file_read_iter, |
56 | .aio_write = generic_file_aio_write, | 56 | .write_iter = generic_file_write_iter, |
57 | .unlocked_ioctl = ext3_ioctl, | 57 | .unlocked_ioctl = ext3_ioctl, |
58 | #ifdef CONFIG_COMPAT | 58 | #ifdef CONFIG_COMPAT |
59 | .compat_ioctl = ext3_compat_ioctl, | 59 | .compat_ioctl = ext3_compat_ioctl, |
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 0e01fb0bc97c..22f4900dd8eb 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c | |||
@@ -680,9 +680,9 @@ long f2fs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
680 | const struct file_operations f2fs_file_operations = { | 680 | const struct file_operations f2fs_file_operations = { |
681 | .llseek = generic_file_llseek, | 681 | .llseek = generic_file_llseek, |
682 | .read = new_sync_read, | 682 | .read = new_sync_read, |
683 | .write = do_sync_write, | 683 | .write = new_sync_write, |
684 | .read_iter = generic_file_read_iter, | 684 | .read_iter = generic_file_read_iter, |
685 | .aio_write = generic_file_aio_write, | 685 | .write_iter = generic_file_write_iter, |
686 | .open = generic_file_open, | 686 | .open = generic_file_open, |
687 | .mmap = f2fs_file_mmap, | 687 | .mmap = f2fs_file_mmap, |
688 | .fsync = f2fs_sync_file, | 688 | .fsync = f2fs_sync_file, |
diff --git a/fs/fat/file.c b/fs/fat/file.c index 29285e990c90..85f79a89e747 100644 --- a/fs/fat/file.c +++ b/fs/fat/file.c | |||
@@ -171,9 +171,9 @@ int fat_file_fsync(struct file *filp, loff_t start, loff_t end, int datasync) | |||
171 | const struct file_operations fat_file_operations = { | 171 | const struct file_operations fat_file_operations = { |
172 | .llseek = generic_file_llseek, | 172 | .llseek = generic_file_llseek, |
173 | .read = new_sync_read, | 173 | .read = new_sync_read, |
174 | .write = do_sync_write, | 174 | .write = new_sync_write, |
175 | .read_iter = generic_file_read_iter, | 175 | .read_iter = generic_file_read_iter, |
176 | .aio_write = generic_file_aio_write, | 176 | .write_iter = generic_file_write_iter, |
177 | .mmap = generic_file_mmap, | 177 | .mmap = generic_file_mmap, |
178 | .release = fat_file_release, | 178 | .release = fat_file_release, |
179 | .unlocked_ioctl = fat_generic_ioctl, | 179 | .unlocked_ioctl = fat_generic_ioctl, |
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index 6d4055aff109..d0929bc81782 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c | |||
@@ -676,8 +676,8 @@ static const struct file_operations hfs_file_operations = { | |||
676 | .llseek = generic_file_llseek, | 676 | .llseek = generic_file_llseek, |
677 | .read = new_sync_read, | 677 | .read = new_sync_read, |
678 | .read_iter = generic_file_read_iter, | 678 | .read_iter = generic_file_read_iter, |
679 | .write = do_sync_write, | 679 | .write = new_sync_write, |
680 | .aio_write = generic_file_aio_write, | 680 | .write_iter = generic_file_write_iter, |
681 | .mmap = generic_file_mmap, | 681 | .mmap = generic_file_mmap, |
682 | .splice_read = generic_file_splice_read, | 682 | .splice_read = generic_file_splice_read, |
683 | .fsync = hfs_file_fsync, | 683 | .fsync = hfs_file_fsync, |
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index cccc89e47cb6..0cf786f2d046 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c | |||
@@ -343,8 +343,8 @@ static const struct file_operations hfsplus_file_operations = { | |||
343 | .llseek = generic_file_llseek, | 343 | .llseek = generic_file_llseek, |
344 | .read = new_sync_read, | 344 | .read = new_sync_read, |
345 | .read_iter = generic_file_read_iter, | 345 | .read_iter = generic_file_read_iter, |
346 | .write = do_sync_write, | 346 | .write = new_sync_write, |
347 | .aio_write = generic_file_aio_write, | 347 | .write_iter = generic_file_write_iter, |
348 | .mmap = generic_file_mmap, | 348 | .mmap = generic_file_mmap, |
349 | .splice_read = generic_file_splice_read, | 349 | .splice_read = generic_file_splice_read, |
350 | .fsync = hfsplus_file_fsync, | 350 | .fsync = hfsplus_file_fsync, |
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index ce0005d8ffeb..bb529f3b7f2b 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c | |||
@@ -381,8 +381,8 @@ static const struct file_operations hostfs_file_fops = { | |||
381 | .read = new_sync_read, | 381 | .read = new_sync_read, |
382 | .splice_read = generic_file_splice_read, | 382 | .splice_read = generic_file_splice_read, |
383 | .read_iter = generic_file_read_iter, | 383 | .read_iter = generic_file_read_iter, |
384 | .aio_write = generic_file_aio_write, | 384 | .write_iter = generic_file_write_iter, |
385 | .write = do_sync_write, | 385 | .write = new_sync_write, |
386 | .mmap = generic_file_mmap, | 386 | .mmap = generic_file_mmap, |
387 | .open = hostfs_file_open, | 387 | .open = hostfs_file_open, |
388 | .release = hostfs_file_release, | 388 | .release = hostfs_file_release, |
diff --git a/fs/hpfs/file.c b/fs/hpfs/file.c index bacb478a4990..7f54e5f76cec 100644 --- a/fs/hpfs/file.c +++ b/fs/hpfs/file.c | |||
@@ -199,8 +199,8 @@ const struct file_operations hpfs_file_ops = | |||
199 | .llseek = generic_file_llseek, | 199 | .llseek = generic_file_llseek, |
200 | .read = new_sync_read, | 200 | .read = new_sync_read, |
201 | .read_iter = generic_file_read_iter, | 201 | .read_iter = generic_file_read_iter, |
202 | .write = do_sync_write, | 202 | .write = new_sync_write, |
203 | .aio_write = generic_file_aio_write, | 203 | .write_iter = generic_file_write_iter, |
204 | .mmap = generic_file_mmap, | 204 | .mmap = generic_file_mmap, |
205 | .release = hpfs_file_release, | 205 | .release = hpfs_file_release, |
206 | .fsync = hpfs_file_fsync, | 206 | .fsync = hpfs_file_fsync, |
diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c index 9192127d591c..64989ca9ba90 100644 --- a/fs/jffs2/file.c +++ b/fs/jffs2/file.c | |||
@@ -53,8 +53,8 @@ const struct file_operations jffs2_file_operations = | |||
53 | .open = generic_file_open, | 53 | .open = generic_file_open, |
54 | .read = new_sync_read, | 54 | .read = new_sync_read, |
55 | .read_iter = generic_file_read_iter, | 55 | .read_iter = generic_file_read_iter, |
56 | .write = do_sync_write, | 56 | .write = new_sync_write, |
57 | .aio_write = generic_file_aio_write, | 57 | .write_iter = generic_file_write_iter, |
58 | .unlocked_ioctl=jffs2_ioctl, | 58 | .unlocked_ioctl=jffs2_ioctl, |
59 | .mmap = generic_file_readonly_mmap, | 59 | .mmap = generic_file_readonly_mmap, |
60 | .fsync = jffs2_fsync, | 60 | .fsync = jffs2_fsync, |
diff --git a/fs/jfs/file.c b/fs/jfs/file.c index a5d8299b2208..cc744ecaf51f 100644 --- a/fs/jfs/file.c +++ b/fs/jfs/file.c | |||
@@ -151,10 +151,10 @@ const struct inode_operations jfs_file_inode_operations = { | |||
151 | const struct file_operations jfs_file_operations = { | 151 | const struct file_operations jfs_file_operations = { |
152 | .open = jfs_open, | 152 | .open = jfs_open, |
153 | .llseek = generic_file_llseek, | 153 | .llseek = generic_file_llseek, |
154 | .write = do_sync_write, | 154 | .write = new_sync_write, |
155 | .read = new_sync_read, | 155 | .read = new_sync_read, |
156 | .read_iter = generic_file_read_iter, | 156 | .read_iter = generic_file_read_iter, |
157 | .aio_write = generic_file_aio_write, | 157 | .write_iter = generic_file_write_iter, |
158 | .mmap = generic_file_mmap, | 158 | .mmap = generic_file_mmap, |
159 | .splice_read = generic_file_splice_read, | 159 | .splice_read = generic_file_splice_read, |
160 | .splice_write = generic_file_splice_write, | 160 | .splice_write = generic_file_splice_write, |
diff --git a/fs/logfs/file.c b/fs/logfs/file.c index 1ca8026dc664..8538752df2f6 100644 --- a/fs/logfs/file.c +++ b/fs/logfs/file.c | |||
@@ -265,14 +265,14 @@ const struct inode_operations logfs_reg_iops = { | |||
265 | 265 | ||
266 | const struct file_operations logfs_reg_fops = { | 266 | const struct file_operations logfs_reg_fops = { |
267 | .read_iter = generic_file_read_iter, | 267 | .read_iter = generic_file_read_iter, |
268 | .aio_write = generic_file_aio_write, | 268 | .write_iter = generic_file_write_iter, |
269 | .fsync = logfs_fsync, | 269 | .fsync = logfs_fsync, |
270 | .unlocked_ioctl = logfs_ioctl, | 270 | .unlocked_ioctl = logfs_ioctl, |
271 | .llseek = generic_file_llseek, | 271 | .llseek = generic_file_llseek, |
272 | .mmap = generic_file_readonly_mmap, | 272 | .mmap = generic_file_readonly_mmap, |
273 | .open = generic_file_open, | 273 | .open = generic_file_open, |
274 | .read = new_sync_read, | 274 | .read = new_sync_read, |
275 | .write = do_sync_write, | 275 | .write = new_sync_write, |
276 | }; | 276 | }; |
277 | 277 | ||
278 | const struct address_space_operations logfs_reg_aops = { | 278 | const struct address_space_operations logfs_reg_aops = { |
diff --git a/fs/minix/file.c b/fs/minix/file.c index 607b47145325..a967de085ac0 100644 --- a/fs/minix/file.c +++ b/fs/minix/file.c | |||
@@ -16,8 +16,8 @@ const struct file_operations minix_file_operations = { | |||
16 | .llseek = generic_file_llseek, | 16 | .llseek = generic_file_llseek, |
17 | .read = new_sync_read, | 17 | .read = new_sync_read, |
18 | .read_iter = generic_file_read_iter, | 18 | .read_iter = generic_file_read_iter, |
19 | .write = do_sync_write, | 19 | .write = new_sync_write, |
20 | .aio_write = generic_file_aio_write, | 20 | .write_iter = generic_file_write_iter, |
21 | .mmap = generic_file_mmap, | 21 | .mmap = generic_file_mmap, |
22 | .fsync = generic_file_fsync, | 22 | .fsync = generic_file_fsync, |
23 | .splice_read = generic_file_splice_read, | 23 | .splice_read = generic_file_splice_read, |
diff --git a/fs/nilfs2/file.c b/fs/nilfs2/file.c index dcb1b0e8b435..24978153c0c4 100644 --- a/fs/nilfs2/file.c +++ b/fs/nilfs2/file.c | |||
@@ -153,9 +153,9 @@ static int nilfs_file_mmap(struct file *file, struct vm_area_struct *vma) | |||
153 | const struct file_operations nilfs_file_operations = { | 153 | const struct file_operations nilfs_file_operations = { |
154 | .llseek = generic_file_llseek, | 154 | .llseek = generic_file_llseek, |
155 | .read = new_sync_read, | 155 | .read = new_sync_read, |
156 | .write = do_sync_write, | 156 | .write = new_sync_write, |
157 | .read_iter = generic_file_read_iter, | 157 | .read_iter = generic_file_read_iter, |
158 | .aio_write = generic_file_aio_write, | 158 | .write_iter = generic_file_write_iter, |
159 | .unlocked_ioctl = nilfs_ioctl, | 159 | .unlocked_ioctl = nilfs_ioctl, |
160 | #ifdef CONFIG_COMPAT | 160 | #ifdef CONFIG_COMPAT |
161 | .compat_ioctl = nilfs_compat_ioctl, | 161 | .compat_ioctl = nilfs_compat_ioctl, |
diff --git a/fs/omfs/file.c b/fs/omfs/file.c index 3bf28da9f0df..902e88527fce 100644 --- a/fs/omfs/file.c +++ b/fs/omfs/file.c | |||
@@ -338,9 +338,9 @@ static sector_t omfs_bmap(struct address_space *mapping, sector_t block) | |||
338 | const struct file_operations omfs_file_operations = { | 338 | const struct file_operations omfs_file_operations = { |
339 | .llseek = generic_file_llseek, | 339 | .llseek = generic_file_llseek, |
340 | .read = new_sync_read, | 340 | .read = new_sync_read, |
341 | .write = do_sync_write, | 341 | .write = new_sync_write, |
342 | .read_iter = generic_file_read_iter, | 342 | .read_iter = generic_file_read_iter, |
343 | .aio_write = generic_file_aio_write, | 343 | .write_iter = generic_file_write_iter, |
344 | .mmap = generic_file_mmap, | 344 | .mmap = generic_file_mmap, |
345 | .fsync = generic_file_fsync, | 345 | .fsync = generic_file_fsync, |
346 | .splice_read = generic_file_splice_read, | 346 | .splice_read = generic_file_splice_read, |
diff --git a/fs/ramfs/file-mmu.c b/fs/ramfs/file-mmu.c index 30ffb367bc0b..6ea0b9718a9d 100644 --- a/fs/ramfs/file-mmu.c +++ b/fs/ramfs/file-mmu.c | |||
@@ -33,8 +33,8 @@ | |||
33 | const struct file_operations ramfs_file_operations = { | 33 | const struct file_operations ramfs_file_operations = { |
34 | .read = new_sync_read, | 34 | .read = new_sync_read, |
35 | .read_iter = generic_file_read_iter, | 35 | .read_iter = generic_file_read_iter, |
36 | .write = do_sync_write, | 36 | .write = new_sync_write, |
37 | .aio_write = generic_file_aio_write, | 37 | .write_iter = generic_file_write_iter, |
38 | .mmap = generic_file_mmap, | 38 | .mmap = generic_file_mmap, |
39 | .fsync = noop_fsync, | 39 | .fsync = noop_fsync, |
40 | .splice_read = generic_file_splice_read, | 40 | .splice_read = generic_file_splice_read, |
diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c index 416db04f8464..9ed420f8f3ca 100644 --- a/fs/ramfs/file-nommu.c +++ b/fs/ramfs/file-nommu.c | |||
@@ -39,8 +39,8 @@ const struct file_operations ramfs_file_operations = { | |||
39 | .get_unmapped_area = ramfs_nommu_get_unmapped_area, | 39 | .get_unmapped_area = ramfs_nommu_get_unmapped_area, |
40 | .read = new_sync_read, | 40 | .read = new_sync_read, |
41 | .read_iter = generic_file_read_iter, | 41 | .read_iter = generic_file_read_iter, |
42 | .write = do_sync_write, | 42 | .write = new_sync_write, |
43 | .aio_write = generic_file_aio_write, | 43 | .write_iter = generic_file_write_iter, |
44 | .fsync = noop_fsync, | 44 | .fsync = noop_fsync, |
45 | .splice_read = generic_file_splice_read, | 45 | .splice_read = generic_file_splice_read, |
46 | .splice_write = generic_file_splice_write, | 46 | .splice_write = generic_file_splice_write, |
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c index 7592d681fd8c..7c8ecd6468db 100644 --- a/fs/reiserfs/file.c +++ b/fs/reiserfs/file.c | |||
@@ -236,7 +236,7 @@ int reiserfs_commit_page(struct inode *inode, struct page *page, | |||
236 | 236 | ||
237 | const struct file_operations reiserfs_file_operations = { | 237 | const struct file_operations reiserfs_file_operations = { |
238 | .read = new_sync_read, | 238 | .read = new_sync_read, |
239 | .write = do_sync_write, | 239 | .write = new_sync_write, |
240 | .unlocked_ioctl = reiserfs_ioctl, | 240 | .unlocked_ioctl = reiserfs_ioctl, |
241 | #ifdef CONFIG_COMPAT | 241 | #ifdef CONFIG_COMPAT |
242 | .compat_ioctl = reiserfs_compat_ioctl, | 242 | .compat_ioctl = reiserfs_compat_ioctl, |
@@ -246,7 +246,7 @@ const struct file_operations reiserfs_file_operations = { | |||
246 | .release = reiserfs_file_release, | 246 | .release = reiserfs_file_release, |
247 | .fsync = reiserfs_sync_file, | 247 | .fsync = reiserfs_sync_file, |
248 | .read_iter = generic_file_read_iter, | 248 | .read_iter = generic_file_read_iter, |
249 | .aio_write = generic_file_aio_write, | 249 | .write_iter = generic_file_write_iter, |
250 | .splice_read = generic_file_splice_read, | 250 | .splice_read = generic_file_splice_read, |
251 | .splice_write = generic_file_splice_write, | 251 | .splice_write = generic_file_splice_write, |
252 | .llseek = generic_file_llseek, | 252 | .llseek = generic_file_llseek, |
diff --git a/fs/sysv/file.c b/fs/sysv/file.c index d99be8877388..b00811c75b24 100644 --- a/fs/sysv/file.c +++ b/fs/sysv/file.c | |||
@@ -23,8 +23,8 @@ const struct file_operations sysv_file_operations = { | |||
23 | .llseek = generic_file_llseek, | 23 | .llseek = generic_file_llseek, |
24 | .read = new_sync_read, | 24 | .read = new_sync_read, |
25 | .read_iter = generic_file_read_iter, | 25 | .read_iter = generic_file_read_iter, |
26 | .write = do_sync_write, | 26 | .write = new_sync_write, |
27 | .aio_write = generic_file_aio_write, | 27 | .write_iter = generic_file_write_iter, |
28 | .mmap = generic_file_mmap, | 28 | .mmap = generic_file_mmap, |
29 | .fsync = generic_file_fsync, | 29 | .fsync = generic_file_fsync, |
30 | .splice_read = generic_file_splice_read, | 30 | .splice_read = generic_file_splice_read, |
diff --git a/fs/ufs/file.c b/fs/ufs/file.c index b6b402989e6b..c84ec010a676 100644 --- a/fs/ufs/file.c +++ b/fs/ufs/file.c | |||
@@ -37,8 +37,8 @@ const struct file_operations ufs_file_operations = { | |||
37 | .llseek = generic_file_llseek, | 37 | .llseek = generic_file_llseek, |
38 | .read = new_sync_read, | 38 | .read = new_sync_read, |
39 | .read_iter = generic_file_read_iter, | 39 | .read_iter = generic_file_read_iter, |
40 | .write = do_sync_write, | 40 | .write = new_sync_write, |
41 | .aio_write = generic_file_aio_write, | 41 | .write_iter = generic_file_write_iter, |
42 | .mmap = generic_file_mmap, | 42 | .mmap = generic_file_mmap, |
43 | .open = generic_file_open, | 43 | .open = generic_file_open, |
44 | .fsync = generic_file_fsync, | 44 | .fsync = generic_file_fsync, |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 17535e0a4547..4b221637f09e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -2414,7 +2414,9 @@ int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isbl | |||
2414 | extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); | 2414 | extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); |
2415 | extern ssize_t generic_file_read_iter(struct kiocb *, struct iov_iter *); | 2415 | extern ssize_t generic_file_read_iter(struct kiocb *, struct iov_iter *); |
2416 | extern ssize_t __generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long); | 2416 | extern ssize_t __generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long); |
2417 | extern ssize_t __generic_file_write_iter(struct kiocb *, struct iov_iter *); | ||
2417 | extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); | 2418 | extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); |
2419 | extern ssize_t generic_file_write_iter(struct kiocb *, struct iov_iter *); | ||
2418 | extern ssize_t generic_file_direct_write(struct kiocb *, struct iov_iter *, loff_t); | 2420 | extern ssize_t generic_file_direct_write(struct kiocb *, struct iov_iter *, loff_t); |
2419 | extern ssize_t generic_perform_write(struct file *, struct iov_iter *, loff_t); | 2421 | extern ssize_t generic_perform_write(struct file *, struct iov_iter *, loff_t); |
2420 | extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); | 2422 | extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); |
diff --git a/mm/filemap.c b/mm/filemap.c index c0404b763a17..d2d9eeec8bf0 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -2542,10 +2542,9 @@ again: | |||
2542 | EXPORT_SYMBOL(generic_perform_write); | 2542 | EXPORT_SYMBOL(generic_perform_write); |
2543 | 2543 | ||
2544 | /** | 2544 | /** |
2545 | * __generic_file_aio_write - write data to a file | 2545 | * __generic_file_write_iter - write data to a file |
2546 | * @iocb: IO state structure (file, offset, etc.) | 2546 | * @iocb: IO state structure (file, offset, etc.) |
2547 | * @iov: vector with data to write | 2547 | * @from: iov_iter with data to write |
2548 | * @nr_segs: number of segments in the vector | ||
2549 | * | 2548 | * |
2550 | * This function does all the work needed for actually writing data to a | 2549 | * This function does all the work needed for actually writing data to a |
2551 | * file. It does all basic checks, removes SUID from the file, updates | 2550 | * file. It does all basic checks, removes SUID from the file, updates |
@@ -2559,21 +2558,16 @@ EXPORT_SYMBOL(generic_perform_write); | |||
2559 | * A caller has to handle it. This is mainly due to the fact that we want to | 2558 | * A caller has to handle it. This is mainly due to the fact that we want to |
2560 | * avoid syncing under i_mutex. | 2559 | * avoid syncing under i_mutex. |
2561 | */ | 2560 | */ |
2562 | ssize_t __generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | 2561 | ssize_t __generic_file_write_iter(struct kiocb *iocb, struct iov_iter *from) |
2563 | unsigned long nr_segs) | ||
2564 | { | 2562 | { |
2565 | struct file *file = iocb->ki_filp; | 2563 | struct file *file = iocb->ki_filp; |
2566 | struct address_space * mapping = file->f_mapping; | 2564 | struct address_space * mapping = file->f_mapping; |
2567 | size_t count; /* after file limit checks */ | ||
2568 | struct inode *inode = mapping->host; | 2565 | struct inode *inode = mapping->host; |
2569 | loff_t pos = iocb->ki_pos; | 2566 | loff_t pos = iocb->ki_pos; |
2570 | ssize_t written = 0; | 2567 | ssize_t written = 0; |
2571 | ssize_t err; | 2568 | ssize_t err; |
2572 | ssize_t status; | 2569 | ssize_t status; |
2573 | struct iov_iter from; | 2570 | size_t count = iov_iter_count(from); |
2574 | |||
2575 | count = iov_length(iov, nr_segs); | ||
2576 | iov_iter_init(&from, WRITE, iov, nr_segs, count); | ||
2577 | 2571 | ||
2578 | /* We can write back this queue in page reclaim */ | 2572 | /* We can write back this queue in page reclaim */ |
2579 | current->backing_dev_info = mapping->backing_dev_info; | 2573 | current->backing_dev_info = mapping->backing_dev_info; |
@@ -2584,7 +2578,7 @@ ssize_t __generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
2584 | if (count == 0) | 2578 | if (count == 0) |
2585 | goto out; | 2579 | goto out; |
2586 | 2580 | ||
2587 | iov_iter_truncate(&from, count); | 2581 | iov_iter_truncate(from, count); |
2588 | 2582 | ||
2589 | err = file_remove_suid(file); | 2583 | err = file_remove_suid(file); |
2590 | if (err) | 2584 | if (err) |
@@ -2598,7 +2592,7 @@ ssize_t __generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
2598 | if (unlikely(file->f_flags & O_DIRECT)) { | 2592 | if (unlikely(file->f_flags & O_DIRECT)) { |
2599 | loff_t endbyte; | 2593 | loff_t endbyte; |
2600 | 2594 | ||
2601 | written = generic_file_direct_write(iocb, &from, pos); | 2595 | written = generic_file_direct_write(iocb, from, pos); |
2602 | if (written < 0 || written == count) | 2596 | if (written < 0 || written == count) |
2603 | goto out; | 2597 | goto out; |
2604 | 2598 | ||
@@ -2609,7 +2603,7 @@ ssize_t __generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
2609 | pos += written; | 2603 | pos += written; |
2610 | count -= written; | 2604 | count -= written; |
2611 | 2605 | ||
2612 | status = generic_perform_write(file, &from, pos); | 2606 | status = generic_perform_write(file, from, pos); |
2613 | /* | 2607 | /* |
2614 | * If generic_perform_write() returned a synchronous error | 2608 | * If generic_perform_write() returned a synchronous error |
2615 | * then we want to return the number of bytes which were | 2609 | * then we want to return the number of bytes which were |
@@ -2641,7 +2635,7 @@ ssize_t __generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
2641 | */ | 2635 | */ |
2642 | } | 2636 | } |
2643 | } else { | 2637 | } else { |
2644 | written = generic_perform_write(file, &from, pos); | 2638 | written = generic_perform_write(file, from, pos); |
2645 | if (likely(written >= 0)) | 2639 | if (likely(written >= 0)) |
2646 | iocb->ki_pos = pos + written; | 2640 | iocb->ki_pos = pos + written; |
2647 | } | 2641 | } |
@@ -2649,30 +2643,36 @@ out: | |||
2649 | current->backing_dev_info = NULL; | 2643 | current->backing_dev_info = NULL; |
2650 | return written ? written : err; | 2644 | return written ? written : err; |
2651 | } | 2645 | } |
2646 | EXPORT_SYMBOL(__generic_file_write_iter); | ||
2647 | |||
2648 | ssize_t __generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | ||
2649 | unsigned long nr_segs) | ||
2650 | { | ||
2651 | size_t count = iov_length(iov, nr_segs); | ||
2652 | struct iov_iter from; | ||
2653 | |||
2654 | iov_iter_init(&from, WRITE, iov, nr_segs, count); | ||
2655 | return __generic_file_write_iter(iocb, &from); | ||
2656 | } | ||
2652 | EXPORT_SYMBOL(__generic_file_aio_write); | 2657 | EXPORT_SYMBOL(__generic_file_aio_write); |
2653 | 2658 | ||
2654 | /** | 2659 | /** |
2655 | * generic_file_aio_write - write data to a file | 2660 | * generic_file_write_iter - write data to a file |
2656 | * @iocb: IO state structure | 2661 | * @iocb: IO state structure |
2657 | * @iov: vector with data to write | 2662 | * @from: iov_iter with data to write |
2658 | * @nr_segs: number of segments in the vector | ||
2659 | * @pos: position in file where to write | ||
2660 | * | 2663 | * |
2661 | * This is a wrapper around __generic_file_aio_write() to be used by most | 2664 | * This is a wrapper around __generic_file_write_iter() to be used by most |
2662 | * filesystems. It takes care of syncing the file in case of O_SYNC file | 2665 | * filesystems. It takes care of syncing the file in case of O_SYNC file |
2663 | * and acquires i_mutex as needed. | 2666 | * and acquires i_mutex as needed. |
2664 | */ | 2667 | */ |
2665 | ssize_t generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | 2668 | ssize_t generic_file_write_iter(struct kiocb *iocb, struct iov_iter *from) |
2666 | unsigned long nr_segs, loff_t pos) | ||
2667 | { | 2669 | { |
2668 | struct file *file = iocb->ki_filp; | 2670 | struct file *file = iocb->ki_filp; |
2669 | struct inode *inode = file->f_mapping->host; | 2671 | struct inode *inode = file->f_mapping->host; |
2670 | ssize_t ret; | 2672 | ssize_t ret; |
2671 | 2673 | ||
2672 | BUG_ON(iocb->ki_pos != pos); | ||
2673 | |||
2674 | mutex_lock(&inode->i_mutex); | 2674 | mutex_lock(&inode->i_mutex); |
2675 | ret = __generic_file_aio_write(iocb, iov, nr_segs); | 2675 | ret = __generic_file_write_iter(iocb, from); |
2676 | mutex_unlock(&inode->i_mutex); | 2676 | mutex_unlock(&inode->i_mutex); |
2677 | 2677 | ||
2678 | if (ret > 0) { | 2678 | if (ret > 0) { |
@@ -2684,6 +2684,19 @@ ssize_t generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
2684 | } | 2684 | } |
2685 | return ret; | 2685 | return ret; |
2686 | } | 2686 | } |
2687 | EXPORT_SYMBOL(generic_file_write_iter); | ||
2688 | |||
2689 | ssize_t generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | ||
2690 | unsigned long nr_segs, loff_t pos) | ||
2691 | { | ||
2692 | size_t count = iov_length(iov, nr_segs); | ||
2693 | struct iov_iter from; | ||
2694 | |||
2695 | BUG_ON(iocb->ki_pos != pos); | ||
2696 | |||
2697 | iov_iter_init(&from, WRITE, iov, nr_segs, count); | ||
2698 | return generic_file_write_iter(iocb, &from); | ||
2699 | } | ||
2687 | EXPORT_SYMBOL(generic_file_aio_write); | 2700 | EXPORT_SYMBOL(generic_file_aio_write); |
2688 | 2701 | ||
2689 | /** | 2702 | /** |
diff --git a/mm/shmem.c b/mm/shmem.c index edc6c7e817e9..d3e5c6fc313c 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -2618,9 +2618,9 @@ static const struct file_operations shmem_file_operations = { | |||
2618 | #ifdef CONFIG_TMPFS | 2618 | #ifdef CONFIG_TMPFS |
2619 | .llseek = shmem_file_llseek, | 2619 | .llseek = shmem_file_llseek, |
2620 | .read = new_sync_read, | 2620 | .read = new_sync_read, |
2621 | .write = do_sync_write, | 2621 | .write = new_sync_write, |
2622 | .read_iter = shmem_file_read_iter, | 2622 | .read_iter = shmem_file_read_iter, |
2623 | .aio_write = generic_file_aio_write, | 2623 | .write_iter = generic_file_write_iter, |
2624 | .fsync = noop_fsync, | 2624 | .fsync = noop_fsync, |
2625 | .splice_read = shmem_file_splice_read, | 2625 | .splice_read = shmem_file_splice_read, |
2626 | .splice_write = generic_file_splice_write, | 2626 | .splice_write = generic_file_splice_write, |
diff --git a/mm/vmscan.c b/mm/vmscan.c index 32c661d66a45..9c2dba6ac685 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -458,7 +458,7 @@ static pageout_t pageout(struct page *page, struct address_space *mapping, | |||
458 | * stalls if we need to run get_block(). We could test | 458 | * stalls if we need to run get_block(). We could test |
459 | * PagePrivate for that. | 459 | * PagePrivate for that. |
460 | * | 460 | * |
461 | * If this process is currently in __generic_file_aio_write() against | 461 | * If this process is currently in __generic_file_write_iter() against |
462 | * this page's queue, we can perform writeback even if that | 462 | * this page's queue, we can perform writeback even if that |
463 | * will block. | 463 | * will block. |
464 | * | 464 | * |