summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_trans_priv.h
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2020-05-06 13:25:23 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2020-05-07 08:27:47 -0700
commit849274c103aeb149f23a81ba4a6bab42a5d77a78 (patch)
treec4aacab947b522b18434b30b92949a6ad34e40a7 /fs/xfs/xfs_trans_priv.h
parentb707fffda6a3e1d0a46fceaa4c3f6c06b90f448a (diff)
downloadlinux-849274c103aeb149f23a81ba4a6bab42a5d77a78.tar.gz
linux-849274c103aeb149f23a81ba4a6bab42a5d77a78.tar.bz2
linux-849274c103aeb149f23a81ba4a6bab42a5d77a78.zip
xfs: acquire ->ail_lock from xfs_trans_ail_delete()
Several callers acquire the lock just prior to the call. Callers that require ->ail_lock for other purposes already check IN_AIL state and thus don't require the additional shutdown check in the helper. Push the lock down into xfs_trans_ail_delete(), open code the instances that still acquire it, and remove the unnecessary ailp parameter. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Allison Collins <allison.henderson@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_trans_priv.h')
-rw-r--r--fs/xfs/xfs_trans_priv.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/xfs/xfs_trans_priv.h b/fs/xfs/xfs_trans_priv.h
index 35655eac01a6..e4362fb8d483 100644
--- a/fs/xfs/xfs_trans_priv.h
+++ b/fs/xfs/xfs_trans_priv.h
@@ -94,8 +94,7 @@ xfs_trans_ail_update(
xfs_lsn_t xfs_ail_delete_one(struct xfs_ail *ailp, struct xfs_log_item *lip);
void xfs_ail_update_finish(struct xfs_ail *ailp, xfs_lsn_t old_lsn)
__releases(ailp->ail_lock);
-void xfs_trans_ail_delete(struct xfs_ail *ailp, struct xfs_log_item *lip,
- int shutdown_type);
+void xfs_trans_ail_delete(struct xfs_log_item *lip, int shutdown_type);
static inline void
xfs_trans_ail_remove(
@@ -103,13 +102,16 @@ xfs_trans_ail_remove(
int shutdown_type)
{
struct xfs_ail *ailp = lip->li_ailp;
+ xfs_lsn_t tail_lsn;
spin_lock(&ailp->ail_lock);
- /* xfs_trans_ail_delete() drops the AIL lock */
- if (test_bit(XFS_LI_IN_AIL, &lip->li_flags))
- xfs_trans_ail_delete(ailp, lip, shutdown_type);
- else
+ /* xfs_ail_update_finish() drops the AIL lock */
+ if (test_bit(XFS_LI_IN_AIL, &lip->li_flags)) {
+ tail_lsn = xfs_ail_delete_one(ailp, lip);
+ xfs_ail_update_finish(ailp, tail_lsn);
+ } else {
spin_unlock(&ailp->ail_lock);
+ }
}
void xfs_ail_push(struct xfs_ail *, xfs_lsn_t);