diff options
author | Christoph Hellwig <hch@infradead.org> | 2012-02-19 21:31:27 -0500 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-02-22 23:26:47 -0500 |
commit | a79bf2d75b8f96bcdb6714138cd53cb3c358669c (patch) | |
tree | 50c5e40becc5559133c29332f947750fe72529e8 /fs | |
parent | c303c5b8c3b8eace41c4fba26205b50c0f8e4ca0 (diff) |
xfs: add xlog_grant_head_wake_all
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/xfs_log.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 30fec0a2a213..a0d1376b3d48 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -159,6 +159,18 @@ xlog_grant_head_init( | |||
159 | spin_lock_init(&head->lock); | 159 | spin_lock_init(&head->lock); |
160 | } | 160 | } |
161 | 161 | ||
162 | STATIC void | ||
163 | xlog_grant_head_wake_all( | ||
164 | struct xlog_grant_head *head) | ||
165 | { | ||
166 | struct xlog_ticket *tic; | ||
167 | |||
168 | spin_lock(&head->lock); | ||
169 | list_for_each_entry(tic, &head->waiters, t_queue) | ||
170 | wake_up_process(tic->t_task); | ||
171 | spin_unlock(&head->lock); | ||
172 | } | ||
173 | |||
162 | STATIC bool | 174 | STATIC bool |
163 | xlog_reserveq_wake( | 175 | xlog_reserveq_wake( |
164 | struct log *log, | 176 | struct log *log, |
@@ -3557,7 +3569,6 @@ xfs_log_force_umount( | |||
3557 | struct xfs_mount *mp, | 3569 | struct xfs_mount *mp, |
3558 | int logerror) | 3570 | int logerror) |
3559 | { | 3571 | { |
3560 | xlog_ticket_t *tic; | ||
3561 | xlog_t *log; | 3572 | xlog_t *log; |
3562 | int retval; | 3573 | int retval; |
3563 | 3574 | ||
@@ -3625,15 +3636,8 @@ xfs_log_force_umount( | |||
3625 | * we don't enqueue anything once the SHUTDOWN flag is set, and this | 3636 | * we don't enqueue anything once the SHUTDOWN flag is set, and this |
3626 | * action is protected by the grant locks. | 3637 | * action is protected by the grant locks. |
3627 | */ | 3638 | */ |
3628 | spin_lock(&log->l_reserve_head.lock); | 3639 | xlog_grant_head_wake_all(&log->l_reserve_head); |
3629 | list_for_each_entry(tic, &log->l_reserve_head.waiters, t_queue) | 3640 | xlog_grant_head_wake_all(&log->l_write_head); |
3630 | wake_up_process(tic->t_task); | ||
3631 | spin_unlock(&log->l_reserve_head.lock); | ||
3632 | |||
3633 | spin_lock(&log->l_write_head.lock); | ||
3634 | list_for_each_entry(tic, &log->l_write_head.waiters, t_queue) | ||
3635 | wake_up_process(tic->t_task); | ||
3636 | spin_unlock(&log->l_write_head.lock); | ||
3637 | 3641 | ||
3638 | if (!(log->l_iclog->ic_state & XLOG_STATE_IOERROR)) { | 3642 | if (!(log->l_iclog->ic_state & XLOG_STATE_IOERROR)) { |
3639 | ASSERT(!logerror); | 3643 | ASSERT(!logerror); |