Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294608
b: refs/heads/master
c: cfb7cdc
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Ben Myers committed Feb 23, 2012
1 parent 238c91b commit eacc1ad
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 35 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: 5b03ff1b2444ddf7b8084b7505101e97257aff5a
refs/heads/master: cfb7cdca0aca5ee2e2ef491284bf1edc3b581885
35 changes: 5 additions & 30 deletions trunk/fs/xfs/xfs_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,18 +762,13 @@ xfs_log_item_init(

/*
* Wake up processes waiting for log space after we have moved the log tail.
*
* If opportunistic is set wake up one waiter even if we do not have enough
* free space by our strict accounting.
*/
void
xfs_log_space_wake(
struct xfs_mount *mp,
bool opportunistic)
struct xfs_mount *mp)
{
struct xlog_ticket *tic;
struct log *log = mp->m_log;
int need_bytes, free_bytes;
int free_bytes;

if (XLOG_FORCED_SHUTDOWN(log))
return;
Expand All @@ -783,16 +778,7 @@ xfs_log_space_wake(

spin_lock(&log->l_grant_write_lock);
free_bytes = xlog_space_left(log, &log->l_grant_write_head);
list_for_each_entry(tic, &log->l_writeq, t_queue) {
ASSERT(tic->t_flags & XLOG_TIC_PERM_RESERV);

if (free_bytes < tic->t_unit_res && !opportunistic)
break;
opportunistic = false;
free_bytes -= tic->t_unit_res;
trace_xfs_log_regrant_write_wake_up(log, tic);
wake_up(&tic->t_wait);
}
xlog_writeq_wake(log, &free_bytes);
spin_unlock(&log->l_grant_write_lock);
}

Expand All @@ -801,18 +787,7 @@ xfs_log_space_wake(

spin_lock(&log->l_grant_reserve_lock);
free_bytes = xlog_space_left(log, &log->l_grant_reserve_head);
list_for_each_entry(tic, &log->l_reserveq, t_queue) {
if (tic->t_flags & XLOG_TIC_PERM_RESERV)
need_bytes = tic->t_unit_res*tic->t_cnt;
else
need_bytes = tic->t_unit_res;
if (free_bytes < need_bytes && !opportunistic)
break;
opportunistic = false;
free_bytes -= need_bytes;
trace_xfs_log_grant_wake_up(log, tic);
wake_up(&tic->t_wait);
}
xlog_reserveq_wake(log, &free_bytes);
spin_unlock(&log->l_grant_reserve_lock);
}
}
Expand Down Expand Up @@ -2748,7 +2723,7 @@ xlog_ungrant_log_space(xlog_t *log,

trace_xfs_log_ungrant_exit(log, ticket);

xfs_log_space_wake(log->l_mp, false);
xfs_log_space_wake(log->l_mp);
}

/*
Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/xfs/xfs_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ int xfs_log_mount(struct xfs_mount *mp,
int num_bblocks);
int xfs_log_mount_finish(struct xfs_mount *mp);
xfs_lsn_t xlog_assign_tail_lsn(struct xfs_mount *mp);
void xfs_log_space_wake(struct xfs_mount *mp,
bool opportunistic);
void xfs_log_space_wake(struct xfs_mount *mp);
int xfs_log_notify(struct xfs_mount *mp,
struct xlog_in_core *iclog,
xfs_log_callback_t *callback_entry);
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/xfs/xfs_trans_ail.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ xfs_trans_ail_update_bulk(

if (mlip_changed && !XFS_FORCED_SHUTDOWN(ailp->xa_mount)) {
xlog_assign_tail_lsn(ailp->xa_mount);
xfs_log_space_wake(ailp->xa_mount, false);
xfs_log_space_wake(ailp->xa_mount);
}
}

Expand Down Expand Up @@ -733,7 +733,7 @@ xfs_trans_ail_delete_bulk(

if (mlip_changed && !XFS_FORCED_SHUTDOWN(ailp->xa_mount)) {
xlog_assign_tail_lsn(ailp->xa_mount);
xfs_log_space_wake(ailp->xa_mount, false);
xfs_log_space_wake(ailp->xa_mount);
}
}

Expand Down

0 comments on commit eacc1ad

Please sign in to comment.