diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2008-06-01 22:07:34 +0000 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2008-06-01 22:07:34 +0000 |
commit | e2946fb6abae14ef716e12a3fe6bb7831c206e9f (patch) | |
tree | 1999e823c70432aad82b9eb5ed72b0ed5753b31c | |
parent | cb4b6f8c8d0ea554411bc538eb4d0d6c9468c476 (diff) | |
download | suspend-utils-e2946fb6abae14ef716e12a3fe6bb7831c206e9f.tar.gz |
Well, (0 % anything) == 0, so currently "early writeout" is always enabled.
Fix that.
-rw-r--r-- | suspend.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) { |