提交 3efa147a 编写于 作者: P Pavel Machek 提交者: Linus Torvalds

[PATCH] pm: Fix resume from initrd

Move device name resolution code around so that it is not called from
resume-from-initrd.  name_to_dev_t may be unavailable at that point.
Signed-off-by: NPavel Machek <pavel@suse.cz>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 e00d9967
......@@ -234,6 +234,16 @@ static int software_resume(void)
{
int error;
if (!swsusp_resume_device) {
if (!strlen(resume_file))
return -ENOENT;
swsusp_resume_device = name_to_dev_t(resume_file);
pr_debug("swsusp: Resume From Partition %s\n", resume_file);
} else {
pr_debug("swsusp: Resume From Partition %d:%d\n",
MAJOR(swsusp_resume_device), MINOR(swsusp_resume_device));
}
if (noresume) {
/**
* FIXME: If noresume is specified, we need to find the partition
......
......@@ -1356,16 +1356,6 @@ int swsusp_check(void)
{
int error;
if (!swsusp_resume_device) {
if (!strlen(resume_file))
return -ENOENT;
swsusp_resume_device = name_to_dev_t(resume_file);
pr_debug("swsusp: Resume From Partition %s\n", resume_file);
} else {
pr_debug("swsusp: Resume From Partition %d:%d\n",
MAJOR(swsusp_resume_device), MINOR(swsusp_resume_device));
}
resume_bdev = open_by_devnum(swsusp_resume_device, FMODE_READ);
if (!IS_ERR(resume_bdev)) {
set_blocksize(resume_bdev, PAGE_SIZE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册