aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/disk.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2006-01-06 03:15:56 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 11:33:42 -0500
commitca0aec0f7a94bf9f07fefa8bfd23282d4e8ceb8a (patch)
tree5f31f11eba908545d5e02698fe9c163a8612dd26 /kernel/power/disk.c
parentb3a93a255ec33a04776ec50efb30b7a99168dda2 (diff)
[PATCH] swsusp: make image size limit tunable
Make the suspend image size limit tunable via /sys/power/image_size. It is necessary for systems on which there is a limited amount of swap available for suspend. It can also be useful for optimizing performance of swsusp on systems with 1 GB of RAM or more. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/power/disk.c')
-rw-r--r--kernel/power/disk.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index 9e51cdf7b78d..e24446f8d8cd 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -365,9 +365,29 @@ out:
365 365
366power_attr(resume); 366power_attr(resume);
367 367
368static ssize_t image_size_show(struct subsystem * subsys, char *buf)
369{
370 return sprintf(buf, "%u\n", image_size);
371}
372
373static ssize_t image_size_store(struct subsystem * subsys, const char * buf, size_t n)
374{
375 unsigned int size;
376
377 if (sscanf(buf, "%u", &size) == 1) {
378 image_size = size;
379 return n;
380 }
381
382 return -EINVAL;
383}
384
385power_attr(image_size);
386
368static struct attribute * g[] = { 387static struct attribute * g[] = {
369 &disk_attr.attr, 388 &disk_attr.attr,
370 &resume_attr.attr, 389 &resume_attr.attr,
390 &image_size_attr.attr,
371 NULL, 391 NULL,
372}; 392};
373 393