xfs: add helper to conditionally remove items from the AIL
authorBrian Foster <bfoster@redhat.com>
Wed, 19 Aug 2015 00:01:08 +0000 (10:01 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 19 Aug 2015 00:01:08 +0000 (10:01 +1000)
Several areas of code duplicate a pattern where we take the AIL lock,
check whether an item is in the AIL and remove it if so. Create a new
helper for this pattern and use it where appropriate.

Signed-off-by: Brian Foster <bfoster@redhat.com>
fs/xfs/xfs_buf_item.c
fs/xfs/xfs_dquot.c
fs/xfs/xfs_extfree_item.c
fs/xfs/xfs_inode_item.c
fs/xfs/xfs_trans_priv.h

index 092d652..919057e 100644 (file)
@@ -647,11 +647,7 @@ xfs_buf_item_unlock(
                        xfs_buf_item_relse(bp);
                else if (aborted) {
                        ASSERT(XFS_FORCED_SHUTDOWN(lip->li_mountp));
-                       if (lip->li_flags & XFS_LI_IN_AIL) {
-                               spin_lock(&lip->li_ailp->xa_lock);
-                               xfs_trans_ail_delete(lip->li_ailp, lip,
-                                                    SHUTDOWN_LOG_IO_ERROR);
-                       }
+                       xfs_trans_ail_remove(lip, SHUTDOWN_LOG_IO_ERROR);
                        xfs_buf_item_relse(bp);
                }
        }
Simple merge
Simple merge
Simple merge
Simple merge