diff options
Diffstat (limited to 'kernel/power/disk.c')
-rw-r--r-- | kernel/power/disk.c | 20 |
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 | ||
366 | power_attr(resume); | 366 | power_attr(resume); |
367 | 367 | ||
368 | static ssize_t image_size_show(struct subsystem * subsys, char *buf) | ||
369 | { | ||
370 | return sprintf(buf, "%u\n", image_size); | ||
371 | } | ||
372 | |||
373 | static 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 | |||
385 | power_attr(image_size); | ||
386 | |||
368 | static struct attribute * g[] = { | 387 | static 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 | ||