diff options
author | Brian Foster <bfoster@redhat.com> | 2015-08-19 10:01:08 +1000 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2015-08-19 10:01:08 +1000 |
commit | 146e54b71ea4b998d65c25964807ff6792bbf436 (patch) | |
tree | 2fc5a2db363067cbdec6718318769d188c11a161 /fs/xfs/xfs_extfree_item.c | |
parent | f307080a626569f89bc8fbad9f936b307aded877 (diff) |
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_extfree_item.c')
-rw-r--r-- | fs/xfs/xfs_extfree_item.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c index ce1d4fb39c4d..4aa0153214f9 100644 --- a/fs/xfs/xfs_extfree_item.c +++ b/fs/xfs/xfs_extfree_item.c @@ -286,20 +286,8 @@ void xfs_efi_release( struct xfs_efi_log_item *efip) { - struct xfs_ail *ailp = efip->efi_item.li_ailp; - if (atomic_dec_and_test(&efip->efi_refcount)) { - spin_lock(&ailp->xa_lock); - /* - * We don't know whether the EFI made it to the AIL. Remove it - * if so. Note that xfs_trans_ail_delete() drops the AIL lock. - */ - if (efip->efi_item.li_flags & XFS_LI_IN_AIL) - xfs_trans_ail_delete(ailp, &efip->efi_item, - SHUTDOWN_LOG_IO_ERROR); - else - spin_unlock(&ailp->xa_lock); - + xfs_trans_ail_remove(&efip->efi_item, SHUTDOWN_LOG_IO_ERROR); xfs_efi_item_free(efip); } } |