]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] propagate mode through swsusp_close()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 8 Oct 2007 17:21:10 +0000 (13:21 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 21 Oct 2008 11:49:02 +0000 (07:49 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
kernel/power/disk.c
kernel/power/power.h
kernel/power/swap.c

index 331f9836383feaba687c89c3e4596edff76fb2fe..c9d74083746f8839f96a5a37888302c41245797e 100644 (file)
@@ -651,7 +651,7 @@ static int software_resume(void)
        pr_debug("PM: Preparing processes for restore.\n");
        error = prepare_processes();
        if (error) {
-               swsusp_close();
+               swsusp_close(FMODE_READ);
                goto Done;
        }
 
index acc0c101dbd54a510049a329260434d56b3c12f9..46b5ec7a3afb243050d04816990780966bab69bc 100644 (file)
@@ -153,7 +153,7 @@ extern int swsusp_shrink_memory(void);
 extern void swsusp_free(void);
 extern int swsusp_read(unsigned int *flags_p);
 extern int swsusp_write(unsigned int flags);
-extern void swsusp_close(void);
+extern void swsusp_close(fmode_t);
 
 struct timeval;
 /* kernel/power/swsusp.c */
index 7b9d611c1106828c34c00dd7f4496b2fb2c1c5c4..178b001a4f17b44e39756fb241236c2d08b507c6 100644 (file)
@@ -426,7 +426,7 @@ int swsusp_write(unsigned int flags)
 
        release_swap_writer(&handle);
  out:
-       swsusp_close();
+       swsusp_close(FMODE_WRITE);
        return error;
 }
 
@@ -626,14 +626,14 @@ int swsusp_check(void)
  *     swsusp_close - close swap device.
  */
 
-void swsusp_close(void)
+void swsusp_close(fmode_t mode)
 {
        if (IS_ERR(resume_bdev)) {
                pr_debug("PM: Image device not initialised\n");
                return;
        }
 
-       blkdev_put(resume_bdev, 0); /* move up */
+       blkdev_put(resume_bdev, mode); /* move up */
 }
 
 static int swsusp_header_init(void)