diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-14 17:36:47 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-14 17:36:47 -0400 |
| commit | 4142e0d1def2c0176c27fd2e810243045a62eb6d (patch) | |
| tree | a21f76fafcd7609419a3ce610d8b9360748ccd76 /fs/ntfs/file.c | |
| parent | 33f1de69312432baecb997a570b7d77c4d02d1ed (diff) | |
| parent | 2daea67e966dc0c42067ebea015ddac6834cef88 (diff) | |
Merge branch 'osync_cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6
* 'osync_cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6:
fsync: wait for data writeout completion before calling ->fsync
vfs: Remove generic_osync_inode() and sync_page_range{_nolock}()
fat: Opencode sync_page_range_nolock()
pohmelfs: Use new syncing helper
xfs: Convert sync_page_range() to simple filemap_write_and_wait_range()
ocfs2: Update syncing after splicing to match generic version
ntfs: Use new syncing helpers and update comments
ext4: Remove syncing logic from ext4_file_write
ext3: Remove syncing logic from ext3_file_write
ext2: Update comment about generic_osync_inode
vfs: Introduce new helpers for syncing after writing to O_SYNC file or IS_SYNC inode
vfs: Rename generic_file_aio_write_nolock
ocfs2: Use __generic_file_aio_write instead of generic_file_aio_write_nolock
pohmelfs: Use __generic_file_aio_write instead of generic_file_aio_write_nolock
vfs: Remove syncing from generic_file_direct_write() and generic_file_buffered_write()
vfs: Export __generic_file_aio_write() and add some comments
vfs: Introduce filemap_fdatawait_range
Diffstat (limited to 'fs/ntfs/file.c')
| -rw-r--r-- | fs/ntfs/file.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c index 3140a4429af1..4350d4993b18 100644 --- a/fs/ntfs/file.c +++ b/fs/ntfs/file.c | |||
| @@ -2076,14 +2076,6 @@ err_out: | |||
| 2076 | *ppos = pos; | 2076 | *ppos = pos; |
| 2077 | if (cached_page) | 2077 | if (cached_page) |
| 2078 | page_cache_release(cached_page); | 2078 | page_cache_release(cached_page); |
| 2079 | /* For now, when the user asks for O_SYNC, we actually give O_DSYNC. */ | ||
| 2080 | if (likely(!status)) { | ||
| 2081 | if (unlikely((file->f_flags & O_SYNC) || IS_SYNC(vi))) { | ||
| 2082 | if (!mapping->a_ops->writepage || !is_sync_kiocb(iocb)) | ||
| 2083 | status = generic_osync_inode(vi, mapping, | ||
| 2084 | OSYNC_METADATA|OSYNC_DATA); | ||
| 2085 | } | ||
| 2086 | } | ||
| 2087 | pagevec_lru_add_file(&lru_pvec); | 2079 | pagevec_lru_add_file(&lru_pvec); |
| 2088 | ntfs_debug("Done. Returning %s (written 0x%lx, status %li).", | 2080 | ntfs_debug("Done. Returning %s (written 0x%lx, status %li).", |
| 2089 | written ? "written" : "status", (unsigned long)written, | 2081 | written ? "written" : "status", (unsigned long)written, |
| @@ -2145,8 +2137,8 @@ static ssize_t ntfs_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
| 2145 | mutex_lock(&inode->i_mutex); | 2137 | mutex_lock(&inode->i_mutex); |
| 2146 | ret = ntfs_file_aio_write_nolock(iocb, iov, nr_segs, &iocb->ki_pos); | 2138 | ret = ntfs_file_aio_write_nolock(iocb, iov, nr_segs, &iocb->ki_pos); |
| 2147 | mutex_unlock(&inode->i_mutex); | 2139 | mutex_unlock(&inode->i_mutex); |
| 2148 | if (ret > 0 && ((file->f_flags & O_SYNC) || IS_SYNC(inode))) { | 2140 | if (ret > 0) { |
| 2149 | int err = sync_page_range(inode, mapping, pos, ret); | 2141 | int err = generic_write_sync(file, pos, ret); |
| 2150 | if (err < 0) | 2142 | if (err < 0) |
| 2151 | ret = err; | 2143 | ret = err; |
| 2152 | } | 2144 | } |
| @@ -2173,8 +2165,8 @@ static ssize_t ntfs_file_writev(struct file *file, const struct iovec *iov, | |||
| 2173 | if (ret == -EIOCBQUEUED) | 2165 | if (ret == -EIOCBQUEUED) |
| 2174 | ret = wait_on_sync_kiocb(&kiocb); | 2166 | ret = wait_on_sync_kiocb(&kiocb); |
| 2175 | mutex_unlock(&inode->i_mutex); | 2167 | mutex_unlock(&inode->i_mutex); |
| 2176 | if (ret > 0 && ((file->f_flags & O_SYNC) || IS_SYNC(inode))) { | 2168 | if (ret > 0) { |
| 2177 | int err = sync_page_range(inode, mapping, *ppos - ret, ret); | 2169 | int err = generic_write_sync(file, *ppos - ret, ret); |
| 2178 | if (err < 0) | 2170 | if (err < 0) |
| 2179 | ret = err; | 2171 | ret = err; |
| 2180 | } | 2172 | } |
