Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107408
b: refs/heads/master
c: d729eae
h: refs/heads/master
v: v3
  • Loading branch information
Michael Nishimoto authored and Niv Sardi committed Jul 28, 2008
1 parent ae4163c commit 36058cb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 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: b41759cf11c84ad0d569c0ef200c449ad2cc24e3
refs/heads/master: d729eae8933cb3eb8edf1446532c178b66b293a9
16 changes: 10 additions & 6 deletions trunk/fs/xfs/xfs_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,20 +226,24 @@ xlog_grant_sub_space(struct log *log, int bytes)
static void
xlog_grant_add_space_write(struct log *log, int bytes)
{
log->l_grant_write_bytes += bytes;
if (log->l_grant_write_bytes > log->l_logsize) {
log->l_grant_write_bytes -= log->l_logsize;
int tmp = log->l_logsize - log->l_grant_write_bytes;
if (tmp > bytes)
log->l_grant_write_bytes += bytes;
else {
log->l_grant_write_cycle++;
log->l_grant_write_bytes = bytes - tmp;
}
}

static void
xlog_grant_add_space_reserve(struct log *log, int bytes)
{
log->l_grant_reserve_bytes += bytes;
if (log->l_grant_reserve_bytes > log->l_logsize) {
log->l_grant_reserve_bytes -= log->l_logsize;
int tmp = log->l_logsize - log->l_grant_reserve_bytes;
if (tmp > bytes)
log->l_grant_reserve_bytes += bytes;
else {
log->l_grant_reserve_cycle++;
log->l_grant_reserve_bytes = bytes - tmp;
}
}

Expand Down

0 comments on commit 36058cb

Please sign in to comment.