Commit d729eae8 authored by Michael Nishimoto's avatar Michael Nishimoto Committed by Niv Sardi

[XFS] Ensure that 2 GiB xfs logs work properly.

We found this while experimenting with 2GiB xfs logs. The previous code
never assumed that xfs logs would ever get so large.

SGI-PV: 981502
SGI-Modid: xfs-linux-melb:xfs-kern:31058a
Signed-off-by: default avatarMichael Nishimoto <miken@agami.com>
Signed-off-by: default avatarDavid Chinner <dgc@sgi.com>
Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
parent b41759cf
...@@ -226,20 +226,24 @@ xlog_grant_sub_space(struct log *log, int bytes) ...@@ -226,20 +226,24 @@ xlog_grant_sub_space(struct log *log, int bytes)
static void static void
xlog_grant_add_space_write(struct log *log, int bytes) xlog_grant_add_space_write(struct log *log, int bytes)
{ {
int tmp = log->l_logsize - log->l_grant_write_bytes;
if (tmp > bytes)
log->l_grant_write_bytes += bytes; log->l_grant_write_bytes += bytes;
if (log->l_grant_write_bytes > log->l_logsize) { else {
log->l_grant_write_bytes -= log->l_logsize;
log->l_grant_write_cycle++; log->l_grant_write_cycle++;
log->l_grant_write_bytes = bytes - tmp;
} }
} }
static void static void
xlog_grant_add_space_reserve(struct log *log, int bytes) xlog_grant_add_space_reserve(struct log *log, int bytes)
{ {
int tmp = log->l_logsize - log->l_grant_reserve_bytes;
if (tmp > bytes)
log->l_grant_reserve_bytes += bytes; log->l_grant_reserve_bytes += bytes;
if (log->l_grant_reserve_bytes > log->l_logsize) { else {
log->l_grant_reserve_bytes -= log->l_logsize;
log->l_grant_reserve_cycle++; log->l_grant_reserve_cycle++;
log->l_grant_reserve_bytes = bytes - tmp;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment