diff options
Diffstat (limited to 'fs/xfs/xfs_log.c')
-rw-r--r-- | fs/xfs/xfs_log.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 2db39df5a57d..02a35fba5eae 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -169,7 +169,7 @@ xlog_reserveq_wake( | |||
169 | *free_bytes -= need_bytes; | 169 | *free_bytes -= need_bytes; |
170 | 170 | ||
171 | trace_xfs_log_grant_wake_up(log, tic); | 171 | trace_xfs_log_grant_wake_up(log, tic); |
172 | wake_up(&tic->t_wait); | 172 | wake_up_process(tic->t_task); |
173 | } | 173 | } |
174 | 174 | ||
175 | return true; | 175 | return true; |
@@ -193,7 +193,7 @@ xlog_writeq_wake( | |||
193 | *free_bytes -= need_bytes; | 193 | *free_bytes -= need_bytes; |
194 | 194 | ||
195 | trace_xfs_log_regrant_write_wake_up(log, tic); | 195 | trace_xfs_log_regrant_write_wake_up(log, tic); |
196 | wake_up(&tic->t_wait); | 196 | wake_up_process(tic->t_task); |
197 | } | 197 | } |
198 | 198 | ||
199 | return true; | 199 | return true; |
@@ -212,10 +212,13 @@ xlog_reserveq_wait( | |||
212 | goto shutdown; | 212 | goto shutdown; |
213 | xlog_grant_push_ail(log, need_bytes); | 213 | xlog_grant_push_ail(log, need_bytes); |
214 | 214 | ||
215 | __set_current_state(TASK_UNINTERRUPTIBLE); | ||
216 | spin_unlock(&log->l_grant_reserve_lock); | ||
217 | |||
215 | XFS_STATS_INC(xs_sleep_logspace); | 218 | XFS_STATS_INC(xs_sleep_logspace); |
216 | trace_xfs_log_grant_sleep(log, tic); | ||
217 | 219 | ||
218 | xlog_wait(&tic->t_wait, &log->l_grant_reserve_lock); | 220 | trace_xfs_log_grant_sleep(log, tic); |
221 | schedule(); | ||
219 | trace_xfs_log_grant_wake(log, tic); | 222 | trace_xfs_log_grant_wake(log, tic); |
220 | 223 | ||
221 | spin_lock(&log->l_grant_reserve_lock); | 224 | spin_lock(&log->l_grant_reserve_lock); |
@@ -243,10 +246,13 @@ xlog_writeq_wait( | |||
243 | goto shutdown; | 246 | goto shutdown; |
244 | xlog_grant_push_ail(log, need_bytes); | 247 | xlog_grant_push_ail(log, need_bytes); |
245 | 248 | ||
249 | __set_current_state(TASK_UNINTERRUPTIBLE); | ||
250 | spin_unlock(&log->l_grant_write_lock); | ||
251 | |||
246 | XFS_STATS_INC(xs_sleep_logspace); | 252 | XFS_STATS_INC(xs_sleep_logspace); |
247 | trace_xfs_log_regrant_write_sleep(log, tic); | ||
248 | 253 | ||
249 | xlog_wait(&tic->t_wait, &log->l_grant_write_lock); | 254 | trace_xfs_log_regrant_write_sleep(log, tic); |
255 | schedule(); | ||
250 | trace_xfs_log_regrant_write_wake(log, tic); | 256 | trace_xfs_log_regrant_write_wake(log, tic); |
251 | 257 | ||
252 | spin_lock(&log->l_grant_write_lock); | 258 | spin_lock(&log->l_grant_write_lock); |
@@ -3276,6 +3282,7 @@ xlog_ticket_alloc( | |||
3276 | } | 3282 | } |
3277 | 3283 | ||
3278 | atomic_set(&tic->t_ref, 1); | 3284 | atomic_set(&tic->t_ref, 1); |
3285 | tic->t_task = current; | ||
3279 | INIT_LIST_HEAD(&tic->t_queue); | 3286 | INIT_LIST_HEAD(&tic->t_queue); |
3280 | tic->t_unit_res = unit_bytes; | 3287 | tic->t_unit_res = unit_bytes; |
3281 | tic->t_curr_res = unit_bytes; | 3288 | tic->t_curr_res = unit_bytes; |
@@ -3287,7 +3294,6 @@ xlog_ticket_alloc( | |||
3287 | tic->t_trans_type = 0; | 3294 | tic->t_trans_type = 0; |
3288 | if (xflags & XFS_LOG_PERM_RESERV) | 3295 | if (xflags & XFS_LOG_PERM_RESERV) |
3289 | tic->t_flags |= XLOG_TIC_PERM_RESERV; | 3296 | tic->t_flags |= XLOG_TIC_PERM_RESERV; |
3290 | init_waitqueue_head(&tic->t_wait); | ||
3291 | 3297 | ||
3292 | xlog_tic_reset_res(tic); | 3298 | xlog_tic_reset_res(tic); |
3293 | 3299 | ||
@@ -3615,12 +3621,12 @@ xfs_log_force_umount( | |||
3615 | */ | 3621 | */ |
3616 | spin_lock(&log->l_grant_reserve_lock); | 3622 | spin_lock(&log->l_grant_reserve_lock); |
3617 | list_for_each_entry(tic, &log->l_reserveq, t_queue) | 3623 | list_for_each_entry(tic, &log->l_reserveq, t_queue) |
3618 | wake_up(&tic->t_wait); | 3624 | wake_up_process(tic->t_task); |
3619 | spin_unlock(&log->l_grant_reserve_lock); | 3625 | spin_unlock(&log->l_grant_reserve_lock); |
3620 | 3626 | ||
3621 | spin_lock(&log->l_grant_write_lock); | 3627 | spin_lock(&log->l_grant_write_lock); |
3622 | list_for_each_entry(tic, &log->l_writeq, t_queue) | 3628 | list_for_each_entry(tic, &log->l_writeq, t_queue) |
3623 | wake_up(&tic->t_wait); | 3629 | wake_up_process(tic->t_task); |
3624 | spin_unlock(&log->l_grant_write_lock); | 3630 | spin_unlock(&log->l_grant_write_lock); |
3625 | 3631 | ||
3626 | if (!(log->l_iclog->ic_state & XLOG_STATE_IOERROR)) { | 3632 | if (!(log->l_iclog->ic_state & XLOG_STATE_IOERROR)) { |