diff options
Diffstat (limited to 'fs/xfs/xfs_sync.c')
-rw-r--r-- | fs/xfs/xfs_sync.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/xfs/xfs_sync.c b/fs/xfs/xfs_sync.c index 4604f90f86a3..aa3dc1a4d53d 100644 --- a/fs/xfs/xfs_sync.c +++ b/fs/xfs/xfs_sync.c | |||
@@ -227,21 +227,17 @@ xfs_sync_inode_data( | |||
227 | int error = 0; | 227 | int error = 0; |
228 | 228 | ||
229 | if (!mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) | 229 | if (!mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) |
230 | goto out_wait; | 230 | return 0; |
231 | 231 | ||
232 | if (!xfs_ilock_nowait(ip, XFS_IOLOCK_SHARED)) { | 232 | if (!xfs_ilock_nowait(ip, XFS_IOLOCK_SHARED)) { |
233 | if (flags & SYNC_TRYLOCK) | 233 | if (flags & SYNC_TRYLOCK) |
234 | goto out_wait; | 234 | return 0; |
235 | xfs_ilock(ip, XFS_IOLOCK_SHARED); | 235 | xfs_ilock(ip, XFS_IOLOCK_SHARED); |
236 | } | 236 | } |
237 | 237 | ||
238 | error = xfs_flush_pages(ip, 0, -1, (flags & SYNC_WAIT) ? | 238 | error = xfs_flush_pages(ip, 0, -1, (flags & SYNC_WAIT) ? |
239 | 0 : XBF_ASYNC, FI_NONE); | 239 | 0 : XBF_ASYNC, FI_NONE); |
240 | xfs_iunlock(ip, XFS_IOLOCK_SHARED); | 240 | xfs_iunlock(ip, XFS_IOLOCK_SHARED); |
241 | |||
242 | out_wait: | ||
243 | if (flags & SYNC_WAIT) | ||
244 | xfs_ioend_wait(ip); | ||
245 | return error; | 241 | return error; |
246 | } | 242 | } |
247 | 243 | ||
@@ -322,6 +318,7 @@ xfs_sync_fsdata( | |||
322 | struct xfs_mount *mp) | 318 | struct xfs_mount *mp) |
323 | { | 319 | { |
324 | struct xfs_buf *bp; | 320 | struct xfs_buf *bp; |
321 | int error; | ||
325 | 322 | ||
326 | /* | 323 | /* |
327 | * If the buffer is pinned then push on the log so we won't get stuck | 324 | * If the buffer is pinned then push on the log so we won't get stuck |
@@ -334,8 +331,9 @@ xfs_sync_fsdata( | |||
334 | bp = xfs_getsb(mp, 0); | 331 | bp = xfs_getsb(mp, 0); |
335 | if (xfs_buf_ispinned(bp)) | 332 | if (xfs_buf_ispinned(bp)) |
336 | xfs_log_force(mp, 0); | 333 | xfs_log_force(mp, 0); |
337 | 334 | error = xfs_bwrite(bp); | |
338 | return xfs_bwrite(mp, bp); | 335 | xfs_buf_relse(bp); |
336 | return error; | ||
339 | } | 337 | } |
340 | 338 | ||
341 | /* | 339 | /* |
@@ -379,7 +377,7 @@ xfs_quiesce_data( | |||
379 | 377 | ||
380 | /* flush data-only devices */ | 378 | /* flush data-only devices */ |
381 | if (mp->m_rtdev_targp) | 379 | if (mp->m_rtdev_targp) |
382 | XFS_bflush(mp->m_rtdev_targp); | 380 | xfs_flush_buftarg(mp->m_rtdev_targp, 1); |
383 | 381 | ||
384 | return error ? error : error2; | 382 | return error ? error : error2; |
385 | } | 383 | } |