Skip to content

Commit 96f7374

Browse files
rjwysockilenb
authored andcommitted
Hibernation: Mark SNAPSHOT_SET_SWAP_FILE ioctl as deprecated (rev. 2)
Mark the SNAPSHOT_SET_SWAP_FILE ioctl belonging to the hibernation userland interface as deprecated. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Len Brown <len.brown@intel.com>
1 parent eb57c1c commit 96f7374

3 files changed

Lines changed: 7 additions & 17 deletions

File tree

‎Documentation/power/userland-swsusp.txt‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,23 +67,13 @@ SNAPSHOT_GET_SWAP_PAGE - allocate a swap page from the resume partition
6767
SNAPSHOT_FREE_SWAP_PAGES - free all swap pages allocated with
6868
SNAPSHOT_GET_SWAP_PAGE
6969

70-
SNAPSHOT_SET_SWAP_FILE - set the resume partition (the last ioctl() argument
71-
should specify the device's major and minor numbers in the old
72-
two-byte format, as returned by the stat() function in the .st_rdev
73-
member of the stat structure)
74-
7570
SNAPSHOT_SET_SWAP_AREA - set the resume partition and the offset (in <PAGE_SIZE>
7671
units) from the beginning of the partition at which the swap header is
7772
located (the last ioctl() argument should point to a struct
7873
resume_swap_area, as defined in kernel/power/power.h, containing the
79-
resume device specification, as for the SNAPSHOT_SET_SWAP_FILE ioctl(),
80-
and the offset); for swap partitions the offset is always 0, but it is
81-
different to zero for swap files (please see
74+
resume device specification and the offset); for swap partitions the
75+
offset is always 0, but it is different from zero for swap files (see
8276
Documentation/swsusp-and-swap-files.txt for details).
83-
The SNAPSHOT_SET_SWAP_AREA ioctl() is considered as a replacement for
84-
SNAPSHOT_SET_SWAP_FILE which is regarded as obsolete. It is
85-
recommended to always use this call, because the code to set the resume
86-
partition may be removed from future kernels
8777

8878
SNAPSHOT_PLATFORM_SUPPORT - enable/disable the hibernation platform support,
8979
depending on the argument value (enable, if the argument is nonzero)

‎kernel/power/power.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ struct resume_swap_area {
154154
#define SNAPSHOT_AVAIL_SWAP _IOR(SNAPSHOT_IOC_MAGIC, 7, void *)
155155
#define SNAPSHOT_GET_SWAP_PAGE _IOR(SNAPSHOT_IOC_MAGIC, 8, void *)
156156
#define SNAPSHOT_FREE_SWAP_PAGES _IO(SNAPSHOT_IOC_MAGIC, 9)
157-
#define SNAPSHOT_SET_SWAP_FILE _IOW(SNAPSHOT_IOC_MAGIC, 10, unsigned int)
158157
#define SNAPSHOT_S2RAM _IO(SNAPSHOT_IOC_MAGIC, 11)
159158
#define SNAPSHOT_SET_SWAP_AREA _IOW(SNAPSHOT_IOC_MAGIC, 13, \
160159
struct resume_swap_area)

‎kernel/power/user.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@
2929
#include "power.h"
3030

3131
/*
32-
* NOTE: The SNAPSHOT_PMOPS ioctl is obsolete and will be removed in the
33-
* future. It is only preserved here for compatibility with existing userland
34-
* utilities.
32+
* NOTE: The SNAPSHOT_SET_SWAP_FILE and SNAPSHOT_PMOPS ioctls are obsolete and
33+
* will be removed in the future. They are only preserved here for
34+
* compatibility with existing userland utilities.
3535
*/
36+
#define SNAPSHOT_SET_SWAP_FILE _IOW(SNAPSHOT_IOC_MAGIC, 10, unsigned int)
3637
#define SNAPSHOT_PMOPS _IOW(SNAPSHOT_IOC_MAGIC, 12, unsigned int)
3738

3839
#define PMOPS_PREPARE 1
@@ -260,7 +261,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
260261
free_all_swap_pages(data->swap);
261262
break;
262263

263-
case SNAPSHOT_SET_SWAP_FILE:
264+
case SNAPSHOT_SET_SWAP_FILE: /* This ioctl is deprecated */
264265
if (!swsusp_swap_in_use()) {
265266
/*
266267
* User space encodes device types as two-byte values,

0 commit comments

Comments
 (0)