Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285839
b: refs/heads/master
c: ee34a37
h: refs/heads/master
i:
  285837: bd0e3a1
  285835: 5cbfade
  285831: c07eb6b
  285823: ecd5eff
v: v3
  • Loading branch information
Barry Song authored and Rafael J. Wysocki committed Jan 13, 2012
1 parent bef6340 commit 086fa00
Show file tree
Hide file tree
Showing 2 changed files with 8 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: a029db43986e23677498ab4d84bb61b05de83484
refs/heads/master: ee34a37049114303011e154478c63b977bcff24c
13 changes: 7 additions & 6 deletions trunk/kernel/power/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,7 @@ static int enough_swap(unsigned int nr_pages, unsigned int flags)

pr_debug("PM: Free swap pages: %u\n", free_swap);

required = PAGES_FOR_IO + ((flags & SF_NOCOMPRESS_MODE) ?
nr_pages : (nr_pages * LZO_CMP_PAGES) / LZO_UNC_PAGES + 1);
required = PAGES_FOR_IO + nr_pages;
return free_swap > required;
}

Expand Down Expand Up @@ -802,10 +801,12 @@ int swsusp_write(unsigned int flags)
printk(KERN_ERR "PM: Cannot get swap writer\n");
return error;
}
if (!enough_swap(pages, flags)) {
printk(KERN_ERR "PM: Not enough free swap\n");
error = -ENOSPC;
goto out_finish;
if (flags & SF_NOCOMPRESS_MODE) {
if (!enough_swap(pages, flags)) {
printk(KERN_ERR "PM: Not enough free swap\n");
error = -ENOSPC;
goto out_finish;
}
}
memset(&snapshot, 0, sizeof(struct snapshot_handle));
error = snapshot_read_next(&snapshot);
Expand Down

0 comments on commit 086fa00

Please sign in to comment.