aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode_item.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2012-04-23 01:58:36 -0400
committerBen Myers <bpm@sgi.com>2012-05-14 17:20:28 -0400
commit4c46819a8097a75d3b378c5e56d2bcf47bb7408d (patch)
tree031f84bd94f044218d43ef3d11f90df0480513c6 /fs/xfs/xfs_inode_item.c
parent8a48088f6439249019b5e17f6391e710656879d9 (diff)
xfs: do not write the buffer from xfs_iflush
Instead of writing the buffer directly from inside xfs_iflush return it to the caller and let the caller decide what to do with the buffer. Also remove the pincount check in xfs_iflush that all non-blocking callers already implement and the now unused flags parameter. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_inode_item.c')
-rw-r--r--fs/xfs/xfs_inode_item.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c
index 05d924efceaf..d3601ab75dd3 100644
--- a/fs/xfs/xfs_inode_item.c
+++ b/fs/xfs/xfs_inode_item.c
@@ -506,6 +506,15 @@ xfs_inode_item_trylock(
506 if (!xfs_ilock_nowait(ip, XFS_ILOCK_SHARED)) 506 if (!xfs_ilock_nowait(ip, XFS_ILOCK_SHARED))
507 return XFS_ITEM_LOCKED; 507 return XFS_ITEM_LOCKED;
508 508
509 /*
510 * Re-check the pincount now that we stabilized the value by
511 * taking the ilock.
512 */
513 if (xfs_ipincount(ip) > 0) {
514 xfs_iunlock(ip, XFS_ILOCK_SHARED);
515 return XFS_ITEM_PINNED;
516 }
517
509 if (!xfs_iflock_nowait(ip)) { 518 if (!xfs_iflock_nowait(ip)) {
510 /* 519 /*
511 * inode has already been flushed to the backing buffer, 520 * inode has already been flushed to the backing buffer,
@@ -666,6 +675,8 @@ xfs_inode_item_push(
666{ 675{
667 struct xfs_inode_log_item *iip = INODE_ITEM(lip); 676 struct xfs_inode_log_item *iip = INODE_ITEM(lip);
668 struct xfs_inode *ip = iip->ili_inode; 677 struct xfs_inode *ip = iip->ili_inode;
678 struct xfs_buf *bp = NULL;
679 int error;
669 680
670 ASSERT(xfs_isilocked(ip, XFS_ILOCK_SHARED)); 681 ASSERT(xfs_isilocked(ip, XFS_ILOCK_SHARED));
671 ASSERT(xfs_isiflocked(ip)); 682 ASSERT(xfs_isiflocked(ip));
@@ -689,7 +700,11 @@ xfs_inode_item_push(
689 * will pull the inode from the AIL, mark it clean and unlock the flush 700 * will pull the inode from the AIL, mark it clean and unlock the flush
690 * lock. 701 * lock.
691 */ 702 */
692 (void) xfs_iflush(ip, SYNC_TRYLOCK); 703 error = xfs_iflush(ip, &bp);
704 if (!error) {
705 xfs_buf_delwri_queue(bp);
706 xfs_buf_relse(bp);
707 }
693 xfs_iunlock(ip, XFS_ILOCK_SHARED); 708 xfs_iunlock(ip, XFS_ILOCK_SHARED);
694} 709}
695 710