diff options
Diffstat (limited to 'fs/splice.c')
-rw-r--r-- | fs/splice.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/fs/splice.c b/fs/splice.c index aec4014291be..7394e9e17534 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -980,25 +980,15 @@ generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out, | |||
980 | 980 | ||
981 | if (ret > 0) { | 981 | if (ret > 0) { |
982 | unsigned long nr_pages; | 982 | unsigned long nr_pages; |
983 | int err; | ||
983 | 984 | ||
984 | *ppos += ret; | ||
985 | nr_pages = (ret + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; | 985 | nr_pages = (ret + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; |
986 | 986 | ||
987 | /* | 987 | err = generic_write_sync(out, *ppos, ret); |
988 | * If file or inode is SYNC and we actually wrote some data, | 988 | if (err) |
989 | * sync it. | 989 | ret = err; |
990 | */ | 990 | else |
991 | if (unlikely((out->f_flags & O_SYNC) || IS_SYNC(inode))) { | 991 | *ppos += ret; |
992 | int err; | ||
993 | |||
994 | mutex_lock(&inode->i_mutex); | ||
995 | err = generic_osync_inode(inode, mapping, | ||
996 | OSYNC_METADATA|OSYNC_DATA); | ||
997 | mutex_unlock(&inode->i_mutex); | ||
998 | |||
999 | if (err) | ||
1000 | ret = err; | ||
1001 | } | ||
1002 | balance_dirty_pages_ratelimited_nr(mapping, nr_pages); | 992 | balance_dirty_pages_ratelimited_nr(mapping, nr_pages); |
1003 | } | 993 | } |
1004 | 994 | ||