Re: [RFC/PATCH] PM / Hibernate : Add wait for disk detection if resume_fileis MAJOR:MINOR style

From: Srivatsa S. Bhat
Date: Wed May 09 2012 - 02:13:44 EST


On 05/07/2012 01:56 PM, Minho Ban wrote:

> name_to_dev_t is not enough to check device detection when the resume_file is
> MAJOR:MINOR format. get_gendisk is needed in that case.
>
> Signed-off-by: Minho Ban <mhban@xxxxxxxxxxx>
> ---
> kernel/power/hibernate.c | 10 ++++++++++
> 1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
> index e09dfbf..27efaef 100644
> --- a/kernel/power/hibernate.c
> +++ b/kernel/power/hibernate.c
> @@ -25,6 +25,8 @@
> #include <linux/freezer.h>
> #include <linux/gfp.h>
> #include <linux/syscore_ops.h>
> +#include <linux/ctype.h>
> +#include <linux/genhd.h>
> #include <scsi/scsi_scan.h>
>
> #include "power.h"
> @@ -749,6 +751,14 @@ static int software_resume(void)
> }
> }
>
> + /* name_to_dev_t is ineffective if resume_file comes in major:minor
> + * format */


Nitpick: Multi-line comments should be of the form:

/*
* name_to_dev_t is ineffective....
* ....... major:minor format
*/

Regards,
Srivatsa S. Bhat

> + if (isdigit(resume_file[0]) && resume_wait) {
> + int partno;
> + while (!get_gendisk(swsusp_resume_device, &partno))
> + msleep(10);
> + }
> +
> Check_image:
> pr_debug("PM: Hibernation image partition %d:%d present\n",
> MAJOR(swsusp_resume_device), MINOR(swsusp_resume_device));

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/