The grant space add helper is separate from the check helper that potentially queues the task until sufficient log reservation is available. Callers of xlog_grant_head_check() immediately update the grant head on return. To facilitate additional coordination between the grant head check and update, fold the space update into the checking function. No functional changes. Signed-off-by: Brian Foster <bfoster@xxxxxxxxxx> --- fs/xfs/xfs_log.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 045ab648ca96..ce0aac89e675 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -342,6 +342,9 @@ xlog_grant_head_check( spin_unlock(&head->lock); } + if (!error) + xlog_grant_add_space(log, &head->grant, *need_bytes); + return error; } @@ -409,7 +412,6 @@ xfs_log_regrant( if (error) goto out_error; - xlog_grant_add_space(log, &log->l_write_head.grant, need_bytes); trace_xfs_log_regrant_exit(log, tic); xlog_verify_grant_tail(log); return 0; @@ -468,7 +470,6 @@ xfs_log_reserve( if (error) goto out_error; - xlog_grant_add_space(log, &log->l_reserve_head.grant, need_bytes); xlog_grant_add_space(log, &log->l_write_head.grant, need_bytes); trace_xfs_log_reserve_exit(log, tic); xlog_verify_grant_tail(log); -- 2.20.1