aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/swap.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2007-01-05 19:36:28 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2007-01-06 02:55:22 -0500
commit7bf236874292fd073c6bdd27f89c3d9e81a79cbc (patch)
tree27e4196e4b720c113010d544567f76f181c11428 /kernel/power/swap.c
parent3223ea8cca5936b8e78450dd5b8ba88372e9c0a8 (diff)
[PATCH] swsusp: Do not fail if resume device is not set
In the kernels later than 2.6.19 there is a regression that makes swsusp fail if the resume device is not explicitly specified. It can be fixed by adding an additional parameter to mm/swapfile.c:swap_type_of() allowing us to pass the (struct block_device *) corresponding to the first available swap back to the caller. 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/swap.c')
-rw-r--r--kernel/power/swap.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index f133d4a6d817..3581f8f86acd 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -165,14 +165,15 @@ static int swsusp_swap_check(void) /* This is called before saving image */
165{ 165{
166 int res; 166 int res;
167 167
168 res = swap_type_of(swsusp_resume_device, swsusp_resume_block); 168 res = swap_type_of(swsusp_resume_device, swsusp_resume_block,
169 &resume_bdev);
169 if (res < 0) 170 if (res < 0)
170 return res; 171 return res;
171 172
172 root_swap = res; 173 root_swap = res;
173 resume_bdev = open_by_devnum(swsusp_resume_device, FMODE_WRITE); 174 res = blkdev_get(resume_bdev, FMODE_WRITE, O_RDWR);
174 if (IS_ERR(resume_bdev)) 175 if (res)
175 return PTR_ERR(resume_bdev); 176 return res;
176 177
177 res = set_blocksize(resume_bdev, PAGE_SIZE); 178 res = set_blocksize(resume_bdev, PAGE_SIZE);
178 if (res < 0) 179 if (res < 0)