diff options
| author | Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> | 2011-12-08 17:42:53 -0500 |
|---|---|---|
| committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-12-09 17:37:07 -0500 |
| commit | cf007e3526a785a95a738d5a8fba44f1f4fe33e0 (patch) | |
| tree | 0b36d8a1568c4579e439dda5fa8e079723589769 /kernel/power | |
| parent | b298d289c79211508f11cb50749b0d1d54eb244a (diff) | |
PM / Hibernate: Remove deprecated hibernation snapshot ioctls
Several snapshot ioctls were marked for removal quite some time ago,
since they were deprecated. Remove them.
Suggested-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'kernel/power')
| -rw-r--r-- | kernel/power/user.c | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/kernel/power/user.c b/kernel/power/user.c index 98ade217da6..78bdb4404aa 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c | |||
| @@ -30,28 +30,6 @@ | |||
| 30 | 30 | ||
| 31 | #include "power.h" | 31 | #include "power.h" |
| 32 | 32 | ||
| 33 | /* | ||
| 34 | * NOTE: The SNAPSHOT_SET_SWAP_FILE and SNAPSHOT_PMOPS ioctls are obsolete and | ||
| 35 | * will be removed in the future. They are only preserved here for | ||
| 36 | * compatibility with existing userland utilities. | ||
| 37 | */ | ||
| 38 | #define SNAPSHOT_SET_SWAP_FILE _IOW(SNAPSHOT_IOC_MAGIC, 10, unsigned int) | ||
| 39 | #define SNAPSHOT_PMOPS _IOW(SNAPSHOT_IOC_MAGIC, 12, unsigned int) | ||
| 40 | |||
| 41 | #define PMOPS_PREPARE 1 | ||
| 42 | #define PMOPS_ENTER 2 | ||
| 43 | #define PMOPS_FINISH 3 | ||
| 44 | |||
| 45 | /* | ||
| 46 | * NOTE: The following ioctl definitions are wrong and have been replaced with | ||
| 47 | * correct ones. They are only preserved here for compatibility with existing | ||
| 48 | * userland utilities and will be removed in the future. | ||
| 49 | */ | ||
| 50 | #define SNAPSHOT_ATOMIC_SNAPSHOT _IOW(SNAPSHOT_IOC_MAGIC, 3, void *) | ||
| 51 | #define SNAPSHOT_SET_IMAGE_SIZE _IOW(SNAPSHOT_IOC_MAGIC, 6, unsigned long) | ||
| 52 | #define SNAPSHOT_AVAIL_SWAP _IOR(SNAPSHOT_IOC_MAGIC, 7, void *) | ||
| 53 | #define SNAPSHOT_GET_SWAP_PAGE _IOR(SNAPSHOT_IOC_MAGIC, 8, void *) | ||
| 54 | |||
| 55 | 33 | ||
| 56 | #define SNAPSHOT_MINOR 231 | 34 | #define SNAPSHOT_MINOR 231 |
| 57 | 35 | ||
| @@ -213,15 +191,6 @@ unlock: | |||
| 213 | return res; | 191 | return res; |
| 214 | } | 192 | } |
| 215 | 193 | ||
| 216 | static void snapshot_deprecated_ioctl(unsigned int cmd) | ||
| 217 | { | ||
| 218 | if (printk_ratelimit()) | ||
| 219 | printk(KERN_NOTICE "%pf: ioctl '%.8x' is deprecated and will " | ||
| 220 | "be removed soon, update your suspend-to-disk " | ||
| 221 | "utilities\n", | ||
| 222 | __builtin_return_address(0), cmd); | ||
| 223 | } | ||
| 224 | |||
| 225 | static long snapshot_ioctl(struct file *filp, unsigned int cmd, | 194 | static long snapshot_ioctl(struct file *filp, unsigned int cmd, |
| 226 | unsigned long arg) | 195 | unsigned long arg) |
| 227 | { | 196 | { |
| @@ -272,8 +241,6 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd, | |||
| 272 | data->frozen = 0; | 241 | data->frozen = 0; |
| 273 | break; | 242 | break; |
| 274 | 243 | ||
| 275 | case SNAPSHOT_ATOMIC_SNAPSHOT: | ||
| 276 | snapshot_deprecated_ioctl(cmd); | ||
| 277 | case SNAPSHOT_CREATE_IMAGE: | 244 | case SNAPSHOT_CREATE_IMAGE: |
| 278 | if (data->mode != O_RDONLY || !data->frozen || data->ready) { | 245 | if (data->mode != O_RDONLY || !data->frozen || data->ready) { |
| 279 | error = -EPERM; | 246 | error = -EPERM; |
| @@ -308,8 +275,6 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd, | |||
| 308 | data->ready = 0; | 275 | data->ready = 0; |
| 309 | break; | 276 | break; |
| 310 | 277 | ||
| 311 | case SNAPSHOT_SET_IMAGE_SIZE: | ||
| 312 | snapshot_deprecated_ioctl(cmd); | ||
| 313 | case SNAPSHOT_PREF_IMAGE_SIZE: | 278 | case SNAPSHOT_PREF_IMAGE_SIZE: |
| 314 | image_size = arg; | 279 | image_size = arg; |
| 315 | break; | 280 | break; |
| @@ -324,16 +289,12 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd, | |||
| 324 | error = put_user(size, (loff_t __user *)arg); | 289 | error = put_user(size, (loff_t __user *)arg); |
| 325 | break; | 290 | break; |
| 326 | 291 | ||
| 327 | case SNAPSHOT_AVAIL_SWAP: | ||
| 328 | snapshot_deprecated_ioctl(cmd); | ||
| 329 | case SNAPSHOT_AVAIL_SWAP_SIZE: | 292 | case SNAPSHOT_AVAIL_SWAP_SIZE: |
| 330 | size = count_swap_pages(data->swap, 1); | 293 | size = count_swap_pages(data->swap, 1); |
| 331 | size <<= PAGE_SHIFT; | 294 | size <<= PAGE_SHIFT; |
| 332 | error = put_user(size, (loff_t __user *)arg); | 295 | error = put_user(size, (loff_t __user *)arg); |
| 333 | break; | 296 | break; |
| 334 | 297 | ||
| 335 | case SNAPSHOT_GET_SWAP_PAGE: | ||
| 336 | snapshot_deprecated_ioctl(cmd); | ||
| 337 | case SNAPSHOT_ALLOC_SWAP_PAGE: | 298 | case SNAPSHOT_ALLOC_SWAP_PAGE: |
| 338 | if (data->swap < 0 || data->swap >= MAX_SWAPFILES) { | 299 | if (data->swap < 0 || data->swap >= MAX_SWAPFILES) { |
| 339 | error = -ENODEV; | 300 | error = -ENODEV; |
| @@ -356,27 +317,6 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd, | |||
| 356 | free_all_swap_pages(data->swap); | 317 | free_all_swap_pages(data->swap); |
| 357 | break; | 318 | break; |
| 358 | 319 | ||
| 359 | case SNAPSHOT_SET_SWAP_FILE: /* This ioctl is deprecated */ | ||
| 360 | snapshot_deprecated_ioctl(cmd); | ||
| 361 | if (!swsusp_swap_in_use()) { | ||
| 362 | /* | ||
| 363 | * User space encodes device types as two-byte values, | ||
| 364 | * so we need to recode them | ||
| 365 | */ | ||
| 366 | if (old_decode_dev(arg)) { | ||
| 367 | data->swap = swap_type_of(old_decode_dev(arg), | ||
| 368 | 0, NULL); | ||
| 369 | if (data->swap < 0) | ||
| 370 | error = -ENODEV; | ||
| 371 | } else { | ||
| 372 | data->swap = -1; | ||
| 373 | error = -EINVAL; | ||
| 374 | } | ||
| 375 | } else { | ||
| 376 | error = -EPERM; | ||
| 377 | } | ||
| 378 | break; | ||
| 379 | |||
| 380 | case SNAPSHOT_S2RAM: | 320 | case SNAPSHOT_S2RAM: |
| 381 | if (!data->frozen) { | 321 | if (!data->frozen) { |
| 382 | error = -EPERM; | 322 | error = -EPERM; |
| @@ -399,33 +339,6 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd, | |||
| 399 | error = hibernation_platform_enter(); | 339 | error = hibernation_platform_enter(); |
| 400 | break; | 340 | break; |
| 401 | 341 | ||
| 402 | case SNAPSHOT_PMOPS: /* This ioctl is deprecated */ | ||
| 403 | snapshot_deprecated_ioctl(cmd); | ||
| 404 | error = -EINVAL; | ||
| 405 | |||
| 406 | switch (arg) { | ||
| 407 | |||
| 408 | case PMOPS_PREPARE: | ||
| 409 | data->platform_support = 1; | ||
| 410 | error = 0; | ||
| 411 | break; | ||
| 412 | |||
| 413 | case PMOPS_ENTER: | ||
| 414 | if (data->platform_support) | ||
| 415 | error = hibernation_platform_enter(); | ||
| 416 | break; | ||
| 417 | |||
| 418 | case PMOPS_FINISH: | ||
| 419 | if (data->platform_support) | ||
| 420 | error = 0; | ||
| 421 | break; | ||
| 422 | |||
| 423 | default: | ||
| 424 | printk(KERN_ERR "SNAPSHOT_PMOPS: invalid argument %ld\n", arg); | ||
| 425 | |||
| 426 | } | ||
| 427 | break; | ||
| 428 | |||
| 429 | case SNAPSHOT_SET_SWAP_AREA: | 342 | case SNAPSHOT_SET_SWAP_AREA: |
| 430 | if (swsusp_swap_in_use()) { | 343 | if (swsusp_swap_in_use()) { |
| 431 | error = -EPERM; | 344 | error = -EPERM; |
