xfs
[Top] [All Lists]

[PATCH 043/102] xfs: add xlog_grant_head_wake_all

To: xfs@xxxxxxxxxxx
Subject: [PATCH 043/102] xfs: add xlog_grant_head_wake_all
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Thu, 23 Aug 2012 15:02:01 +1000
In-reply-to: <1345698180-13612-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1345698180-13612-1-git-send-email-david@xxxxxxxxxxxxx>
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>

Upstream commit: a79bf2d75b8f96bcdb6714138cd53cb3c358669c

Reviewed-by: Mark Tinguely <tinguely@xxxxxxx>
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
Signed-off-by: Ben Myers <bpm@xxxxxxx>
---
 fs/xfs/xfs_log.c |   24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 6ef0264..eb19abf 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -159,6 +159,18 @@ xlog_grant_head_init(
        spin_lock_init(&head->lock);
 }
 
+STATIC void
+xlog_grant_head_wake_all(
+       struct xlog_grant_head  *head)
+{
+       struct xlog_ticket      *tic;
+
+       spin_lock(&head->lock);
+       list_for_each_entry(tic, &head->waiters, t_queue)
+               wake_up_process(tic->t_task);
+       spin_unlock(&head->lock);
+}
+
 STATIC bool
 xlog_reserveq_wake(
        struct log              *log,
@@ -3608,7 +3620,6 @@ xfs_log_force_umount(
        struct xfs_mount        *mp,
        int                     logerror)
 {
-       xlog_ticket_t   *tic;
        xlog_t          *log;
        int             retval;
 
@@ -3676,15 +3687,8 @@ xfs_log_force_umount(
         * we don't enqueue anything once the SHUTDOWN flag is set, and this
         * action is protected by the grant locks.
         */
-       spin_lock(&log->l_reserve_head.lock);
-       list_for_each_entry(tic, &log->l_reserve_head.waiters, t_queue)
-               wake_up_process(tic->t_task);
-       spin_unlock(&log->l_reserve_head.lock);
-
-       spin_lock(&log->l_write_head.lock);
-       list_for_each_entry(tic, &log->l_write_head.waiters, t_queue)
-               wake_up_process(tic->t_task);
-       spin_unlock(&log->l_write_head.lock);
+       xlog_grant_head_wake_all(&log->l_reserve_head);
+       xlog_grant_head_wake_all(&log->l_write_head);
 
        if (!(log->l_iclog->ic_state & XLOG_STATE_IOERROR)) {
                ASSERT(!logerror);
-- 
1.7.10

<Prev in Thread] Current Thread [Next in Thread>