diff options
Diffstat (limited to 'fs/ocfs2/file.c')
-rw-r--r-- | fs/ocfs2/file.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 600227389387..221c5e98957b 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -1993,31 +1993,16 @@ static ssize_t ocfs2_file_splice_write(struct pipe_inode_info *pipe, | |||
1993 | 1993 | ||
1994 | if (ret > 0) { | 1994 | if (ret > 0) { |
1995 | unsigned long nr_pages; | 1995 | unsigned long nr_pages; |
1996 | int err; | ||
1996 | 1997 | ||
1997 | *ppos += ret; | ||
1998 | nr_pages = (ret + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; | 1998 | nr_pages = (ret + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; |
1999 | 1999 | ||
2000 | /* | 2000 | err = generic_write_sync(out, *ppos, ret); |
2001 | * If file or inode is SYNC and we actually wrote some data, | 2001 | if (err) |
2002 | * sync it. | 2002 | ret = err; |
2003 | */ | 2003 | else |
2004 | if (unlikely((out->f_flags & O_SYNC) || IS_SYNC(inode))) { | 2004 | *ppos += ret; |
2005 | int err; | ||
2006 | |||
2007 | mutex_lock(&inode->i_mutex); | ||
2008 | err = ocfs2_rw_lock(inode, 1); | ||
2009 | if (err < 0) { | ||
2010 | mlog_errno(err); | ||
2011 | } else { | ||
2012 | err = generic_osync_inode(inode, mapping, | ||
2013 | OSYNC_METADATA|OSYNC_DATA); | ||
2014 | ocfs2_rw_unlock(inode, 1); | ||
2015 | } | ||
2016 | mutex_unlock(&inode->i_mutex); | ||
2017 | 2005 | ||
2018 | if (err) | ||
2019 | ret = err; | ||
2020 | } | ||
2021 | balance_dirty_pages_ratelimited_nr(mapping, nr_pages); | 2006 | balance_dirty_pages_ratelimited_nr(mapping, nr_pages); |
2022 | } | 2007 | } |
2023 | 2008 | ||