diff options
author | Brian Foster <bfoster@redhat.com> | 2015-08-19 02:01:08 +0200 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2015-08-19 02:01:08 +0200 |
commit | 146e54b71ea4b998d65c25964807ff6792bbf436 (patch) | |
tree | 2fc5a2db363067cbdec6718318769d188c11a161 /fs/xfs/xfs_inode_item.c | |
parent | xfs: fix btree cursor error cleanups (diff) | |
download | linux-146e54b71ea4b998d65c25964807ff6792bbf436.tar.xz linux-146e54b71ea4b998d65c25964807ff6792bbf436.zip |
xfs: add helper to conditionally remove items from the AIL
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>
Diffstat (limited to 'fs/xfs/xfs_inode_item.c')
-rw-r--r-- | fs/xfs/xfs_inode_item.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index bf13a5a7e2f4..62bd80f4edd9 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c @@ -703,17 +703,10 @@ xfs_iflush_abort( xfs_inode_log_item_t *iip = ip->i_itemp; if (iip) { - struct xfs_ail *ailp = iip->ili_item.li_ailp; if (iip->ili_item.li_flags & XFS_LI_IN_AIL) { - spin_lock(&ailp->xa_lock); - if (iip->ili_item.li_flags & XFS_LI_IN_AIL) { - /* xfs_trans_ail_delete() drops the AIL lock. */ - xfs_trans_ail_delete(ailp, &iip->ili_item, - stale ? - SHUTDOWN_LOG_IO_ERROR : + xfs_trans_ail_remove(&iip->ili_item, + stale ? SHUTDOWN_LOG_IO_ERROR : SHUTDOWN_CORRUPT_INCORE); - } else - spin_unlock(&ailp->xa_lock); } iip->ili_logged = 0; /* |