Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 143174
b: refs/heads/master
c: 9d7fef7
h: refs/heads/master
v: v3
  • Loading branch information
Dave Chinner authored and Christoph Hellwig committed Apr 6, 2009
1 parent 51b8826 commit 1632299
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c626d174cfe38e7f0545d074c299527892cd8c45
refs/heads/master: 9d7fef74b23fe57803c5f71fab11630d9ec2cb4b
37 changes: 19 additions & 18 deletions trunk/fs/xfs/xfs_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -2560,18 +2560,19 @@ xlog_grant_log_space(xlog_t *log,
xlog_ins_ticketq(&log->l_reserve_headq, tic);
xlog_trace_loggrant(log, tic,
"xlog_grant_log_space: sleep 2");
spin_unlock(&log->l_grant_lock);
xlog_grant_push_ail(log->l_mp, need_bytes);
spin_lock(&log->l_grant_lock);

XFS_STATS_INC(xs_sleep_logspace);
sv_wait(&tic->t_wait, PINOD|PLTWAIT, &log->l_grant_lock, s);

if (XLOG_FORCED_SHUTDOWN(log)) {
spin_lock(&log->l_grant_lock);
spin_lock(&log->l_grant_lock);
if (XLOG_FORCED_SHUTDOWN(log))
goto error_return;
}

xlog_trace_loggrant(log, tic,
"xlog_grant_log_space: wake 2");
xlog_grant_push_ail(log->l_mp, need_bytes);
spin_lock(&log->l_grant_lock);
goto redo;
} else if (tic->t_flags & XLOG_TIC_IN_Q)
xlog_del_ticketq(&log->l_reserve_headq, tic);
Expand Down Expand Up @@ -2650,7 +2651,7 @@ xlog_regrant_write_log_space(xlog_t *log,
* for more free space, otherwise try to get some space for
* this transaction.
*/

need_bytes = tic->t_unit_res;
if ((ntic = log->l_write_headq)) {
free_bytes = xlog_space_left(log, log->l_grant_write_cycle,
log->l_grant_write_bytes);
Expand All @@ -2670,26 +2671,25 @@ xlog_regrant_write_log_space(xlog_t *log,

xlog_trace_loggrant(log, tic,
"xlog_regrant_write_log_space: sleep 1");
spin_unlock(&log->l_grant_lock);
xlog_grant_push_ail(log->l_mp, need_bytes);
spin_lock(&log->l_grant_lock);

XFS_STATS_INC(xs_sleep_logspace);
sv_wait(&tic->t_wait, PINOD|PLTWAIT,
&log->l_grant_lock, s);

/* If we're shutting down, this tic is already
* off the queue */
if (XLOG_FORCED_SHUTDOWN(log)) {
spin_lock(&log->l_grant_lock);
spin_lock(&log->l_grant_lock);
if (XLOG_FORCED_SHUTDOWN(log))
goto error_return;
}

xlog_trace_loggrant(log, tic,
"xlog_regrant_write_log_space: wake 1");
xlog_grant_push_ail(log->l_mp, tic->t_unit_res);
spin_lock(&log->l_grant_lock);
}
}

need_bytes = tic->t_unit_res;

redo:
if (XLOG_FORCED_SHUTDOWN(log))
goto error_return;
Expand All @@ -2699,19 +2699,20 @@ xlog_regrant_write_log_space(xlog_t *log,
if (free_bytes < need_bytes) {
if ((tic->t_flags & XLOG_TIC_IN_Q) == 0)
xlog_ins_ticketq(&log->l_write_headq, tic);
spin_unlock(&log->l_grant_lock);
xlog_grant_push_ail(log->l_mp, need_bytes);
spin_lock(&log->l_grant_lock);

XFS_STATS_INC(xs_sleep_logspace);
sv_wait(&tic->t_wait, PINOD|PLTWAIT, &log->l_grant_lock, s);

/* If we're shutting down, this tic is already off the queue */
if (XLOG_FORCED_SHUTDOWN(log)) {
spin_lock(&log->l_grant_lock);
spin_lock(&log->l_grant_lock);
if (XLOG_FORCED_SHUTDOWN(log))
goto error_return;
}

xlog_trace_loggrant(log, tic,
"xlog_regrant_write_log_space: wake 2");
xlog_grant_push_ail(log->l_mp, need_bytes);
spin_lock(&log->l_grant_lock);
goto redo;
} else if (tic->t_flags & XLOG_TIC_IN_Q)
xlog_del_ticketq(&log->l_write_headq, tic);
Expand Down

0 comments on commit 1632299

Please sign in to comment.