diff options
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r-- | fs/f2fs/data.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 6d4a743caf86..e88f46f122aa 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
@@ -701,6 +701,27 @@ err: | |||
701 | return err; | 701 | return err; |
702 | } | 702 | } |
703 | 703 | ||
704 | static int f2fs_write_end(struct file *file, | ||
705 | struct address_space *mapping, | ||
706 | loff_t pos, unsigned len, unsigned copied, | ||
707 | struct page *page, void *fsdata) | ||
708 | { | ||
709 | struct inode *inode = page->mapping->host; | ||
710 | |||
711 | SetPageUptodate(page); | ||
712 | set_page_dirty(page); | ||
713 | |||
714 | if (pos + copied > i_size_read(inode)) { | ||
715 | i_size_write(inode, pos + copied); | ||
716 | mark_inode_dirty(inode); | ||
717 | update_inode_page(inode); | ||
718 | } | ||
719 | |||
720 | unlock_page(page); | ||
721 | page_cache_release(page); | ||
722 | return copied; | ||
723 | } | ||
724 | |||
704 | static ssize_t f2fs_direct_IO(int rw, struct kiocb *iocb, | 725 | static ssize_t f2fs_direct_IO(int rw, struct kiocb *iocb, |
705 | const struct iovec *iov, loff_t offset, unsigned long nr_segs) | 726 | const struct iovec *iov, loff_t offset, unsigned long nr_segs) |
706 | { | 727 | { |
@@ -757,7 +778,7 @@ const struct address_space_operations f2fs_dblock_aops = { | |||
757 | .writepage = f2fs_write_data_page, | 778 | .writepage = f2fs_write_data_page, |
758 | .writepages = f2fs_write_data_pages, | 779 | .writepages = f2fs_write_data_pages, |
759 | .write_begin = f2fs_write_begin, | 780 | .write_begin = f2fs_write_begin, |
760 | .write_end = nobh_write_end, | 781 | .write_end = f2fs_write_end, |
761 | .set_page_dirty = f2fs_set_data_page_dirty, | 782 | .set_page_dirty = f2fs_set_data_page_dirty, |
762 | .invalidatepage = f2fs_invalidate_data_page, | 783 | .invalidatepage = f2fs_invalidate_data_page, |
763 | .releasepage = f2fs_release_data_page, | 784 | .releasepage = f2fs_release_data_page, |