aboutsummaryrefslogtreecommitdiffstats
path: root/mm/filemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/filemap.c')
-rw-r--r--mm/filemap.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 3587554f45ef..849293c4f418 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -39,11 +39,10 @@
39/* 39/*
40 * FIXME: remove all knowledge of the buffer layer from the core VM 40 * FIXME: remove all knowledge of the buffer layer from the core VM
41 */ 41 */
42#include <linux/buffer_head.h> /* for generic_osync_inode */ 42#include <linux/buffer_head.h> /* for try_to_free_buffers */
43 43
44#include <asm/mman.h> 44#include <asm/mman.h>
45 45
46
47/* 46/*
48 * Shared mappings implemented 30.11.1994. It's not fully working yet, 47 * Shared mappings implemented 30.11.1994. It's not fully working yet,
49 * though. 48 * though.
@@ -2477,8 +2476,7 @@ ssize_t generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
2477 unsigned long nr_segs, loff_t pos) 2476 unsigned long nr_segs, loff_t pos)
2478{ 2477{
2479 struct file *file = iocb->ki_filp; 2478 struct file *file = iocb->ki_filp;
2480 struct address_space *mapping = file->f_mapping; 2479 struct inode *inode = file->f_mapping->host;
2481 struct inode *inode = mapping->host;
2482 ssize_t ret; 2480 ssize_t ret;
2483 2481
2484 BUG_ON(iocb->ki_pos != pos); 2482 BUG_ON(iocb->ki_pos != pos);
@@ -2487,11 +2485,10 @@ ssize_t generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
2487 ret = __generic_file_aio_write(iocb, iov, nr_segs, &iocb->ki_pos); 2485 ret = __generic_file_aio_write(iocb, iov, nr_segs, &iocb->ki_pos);
2488 mutex_unlock(&inode->i_mutex); 2486 mutex_unlock(&inode->i_mutex);
2489 2487
2490 if ((ret > 0 || ret == -EIOCBQUEUED) && 2488 if (ret > 0 || ret == -EIOCBQUEUED) {
2491 ((file->f_flags & O_SYNC) || IS_SYNC(inode))) {
2492 ssize_t err; 2489 ssize_t err;
2493 2490
2494 err = sync_page_range(inode, mapping, pos, ret); 2491 err = generic_write_sync(file, pos, ret);
2495 if (err < 0 && ret > 0) 2492 if (err < 0 && ret > 0)
2496 ret = err; 2493 ret = err;
2497 } 2494 }