aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2008-06-01 22:07:34 +0000
committerRafael J. Wysocki <rjw@sisk.pl>2008-06-01 22:07:34 +0000
commite2946fb6abae14ef716e12a3fe6bb7831c206e9f (patch)
tree1999e823c70432aad82b9eb5ed72b0ed5753b31c
parentcb4b6f8c8d0ea554411bc538eb4d0d6c9468c476 (diff)
downloadsuspend-utils-e2946fb6abae14ef716e12a3fe6bb7831c206e9f.tar.gz
Well, (0 % anything) == 0, so currently "early writeout" is always enabled.
Fix that.
-rw-r--r--suspend.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/suspend.c b/suspend.c
index 7183437..7e320da 100644
--- a/suspend.c
+++ b/suspend.c
@@ -796,7 +796,7 @@ static int save_image(struct swap_writer *handle, unsigned int nr_pages)
if (early_writeout)
writeout_rate = m;
else
- writeout_rate = nr_pages;
+ writeout_rate = nr_pages + 1;
/* The buffer may be partially filled at this point */
for (nr_pages = 0; ; nr_pages++) {
@@ -832,7 +832,7 @@ static int save_image(struct swap_writer *handle, unsigned int nr_pages)
}
}
- if (!(nr_pages % writeout_rate))
+ if (!((nr_pages + 1) % writeout_rate))
start_writeout(handle->fd);
if (handle->page_ptr - handle->buffer >= buffer_size) {