Skip to content

Commit 40d84e1

Browse files
yu-chen-surfrafaeljw
authored andcommitted
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: Chen Yu <yu.c.chen@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 0bb80ec commit 40d84e1

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

kernel/power/power.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ extern int swsusp_swap_in_use(void);
168168
#define SF_HW_SIG 8
169169

170170
/* kernel/power/hibernate.c */
171-
int swsusp_check(bool snapshot_test);
171+
int swsusp_check(bool exclusive);
172172
extern void swsusp_free(void);
173173
extern int swsusp_read(unsigned int *flags_p);
174174
extern int swsusp_write(unsigned int flags);
175-
void swsusp_close(bool snapshot_test);
175+
void swsusp_close(bool exclusive);
176176
#ifdef CONFIG_SUSPEND
177177
extern int swsusp_unmark(void);
178178
#endif

kernel/power/swap.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,12 +1513,13 @@ int swsusp_read(unsigned int *flags_p)
15131513
static void *swsusp_holder;
15141514

15151515
/**
1516-
* swsusp_check - Check for swsusp signature in the resume device
1516+
* swsusp_check - Check for swsusp signature in the resume device
1517+
* @exclusive: Open the resume device exclusively.
15171518
*/
15181519

1519-
int swsusp_check(bool snapshot_test)
1520+
int swsusp_check(bool exclusive)
15201521
{
1521-
void *holder = snapshot_test ? &swsusp_holder : NULL;
1522+
void *holder = exclusive ? &swsusp_holder : NULL;
15221523
int error;
15231524

15241525
hib_resume_bdev = blkdev_get_by_dev(swsusp_resume_device, BLK_OPEN_READ,
@@ -1563,17 +1564,18 @@ int swsusp_check(bool snapshot_test)
15631564
}
15641565

15651566
/**
1566-
* swsusp_close - close swap device.
1567+
* swsusp_close - close swap device.
1568+
* @exclusive: Close the resume device which is exclusively opened.
15671569
*/
15681570

1569-
void swsusp_close(bool snapshot_test)
1571+
void swsusp_close(bool exclusive)
15701572
{
15711573
if (IS_ERR(hib_resume_bdev)) {
15721574
pr_debug("Image device not initialised\n");
15731575
return;
15741576
}
15751577

1576-
blkdev_put(hib_resume_bdev, snapshot_test ? &swsusp_holder : NULL);
1578+
blkdev_put(hib_resume_bdev, exclusive ? &swsusp_holder : NULL);
15771579
}
15781580

15791581
/**

0 commit comments

Comments
 (0)