Commit 40d84e19 authored by Chen Yu's avatar Chen Yu Committed by Rafael J. Wysocki

PM: hibernate: Rename function parameter from snapshot_test to exclusive

Several functions reply on snapshot_test to decide whether to
open the resume device exclusively. However there is no strict
connection between the snapshot_test and the open mode. Rename
the 'snapshot_test' input parameter to 'exclusive' to better reflect
the use case.

No functional change is expected.
Signed-off-by: default avatarChen Yu <yu.c.chen@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 0bb80ecc
...@@ -168,11 +168,11 @@ extern int swsusp_swap_in_use(void); ...@@ -168,11 +168,11 @@ extern int swsusp_swap_in_use(void);
#define SF_HW_SIG 8 #define SF_HW_SIG 8
/* kernel/power/hibernate.c */ /* kernel/power/hibernate.c */
int swsusp_check(bool snapshot_test); int swsusp_check(bool exclusive);
extern void swsusp_free(void); extern void swsusp_free(void);
extern int swsusp_read(unsigned int *flags_p); extern int swsusp_read(unsigned int *flags_p);
extern int swsusp_write(unsigned int flags); extern int swsusp_write(unsigned int flags);
void swsusp_close(bool snapshot_test); void swsusp_close(bool exclusive);
#ifdef CONFIG_SUSPEND #ifdef CONFIG_SUSPEND
extern int swsusp_unmark(void); extern int swsusp_unmark(void);
#endif #endif
......
...@@ -1514,11 +1514,12 @@ static void *swsusp_holder; ...@@ -1514,11 +1514,12 @@ static void *swsusp_holder;
/** /**
* swsusp_check - Check for swsusp signature in the resume device * swsusp_check - Check for swsusp signature in the resume device
* @exclusive: Open the resume device exclusively.
*/ */
int swsusp_check(bool snapshot_test) int swsusp_check(bool exclusive)
{ {
void *holder = snapshot_test ? &swsusp_holder : NULL; void *holder = exclusive ? &swsusp_holder : NULL;
int error; int error;
hib_resume_bdev = blkdev_get_by_dev(swsusp_resume_device, BLK_OPEN_READ, hib_resume_bdev = blkdev_get_by_dev(swsusp_resume_device, BLK_OPEN_READ,
...@@ -1564,16 +1565,17 @@ int swsusp_check(bool snapshot_test) ...@@ -1564,16 +1565,17 @@ int swsusp_check(bool snapshot_test)
/** /**
* swsusp_close - close swap device. * swsusp_close - close swap device.
* @exclusive: Close the resume device which is exclusively opened.
*/ */
void swsusp_close(bool snapshot_test) void swsusp_close(bool exclusive)
{ {
if (IS_ERR(hib_resume_bdev)) { if (IS_ERR(hib_resume_bdev)) {
pr_debug("Image device not initialised\n"); pr_debug("Image device not initialised\n");
return; return;
} }
blkdev_put(hib_resume_bdev, snapshot_test ? &swsusp_holder : NULL); blkdev_put(hib_resume_bdev, exclusive ? &swsusp_holder : NULL);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment