Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181858
b: refs/heads/master
c: b694e52
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Slaby authored and Rafael J. Wysocki committed Feb 26, 2010
1 parent c80f120 commit 90624df
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f8824cee405c62ba465b85365201166d9cf86a14
refs/heads/master: b694e52ebdd439e4591d4a6651658026196174f6
11 changes: 11 additions & 0 deletions trunk/Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ Who: Robin Getz <rgetz@blackfin.uclinux.org> & Matt Mackall <mpm@selenic.com>

---------------------------

What: Deprecated snapshot ioctls
When: 2.6.36

Why: The ioctls in kernel/power/user.c were marked as deprecated long time
ago. Now they notify users about that so that they need to replace
their userspace. After some more time, remove them completely.

Who: Jiri Slaby <jirislaby@gmail.com>

---------------------------

What: The ieee80211_regdom module parameter
When: March 2010 / desktop catchup

Expand Down
23 changes: 19 additions & 4 deletions trunk/kernel/power/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,15 @@ static ssize_t snapshot_write(struct file *filp, const char __user *buf,
return res;
}

static void snapshot_deprecated_ioctl(unsigned int cmd)
{
if (printk_ratelimit())
printk(KERN_NOTICE "%pf: ioctl '%.8x' is deprecated and will "
"be removed soon, update your suspend-to-disk "
"utilities\n",
__builtin_return_address(0), cmd);
}

static long snapshot_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg)
{
Expand Down Expand Up @@ -246,8 +255,9 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
data->frozen = 0;
break;

case SNAPSHOT_CREATE_IMAGE:
case SNAPSHOT_ATOMIC_SNAPSHOT:
snapshot_deprecated_ioctl(cmd);
case SNAPSHOT_CREATE_IMAGE:
if (data->mode != O_RDONLY || !data->frozen || data->ready) {
error = -EPERM;
break;
Expand Down Expand Up @@ -275,8 +285,9 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
data->ready = 0;
break;

case SNAPSHOT_PREF_IMAGE_SIZE:
case SNAPSHOT_SET_IMAGE_SIZE:
snapshot_deprecated_ioctl(cmd);
case SNAPSHOT_PREF_IMAGE_SIZE:
image_size = arg;
break;

Expand All @@ -290,15 +301,17 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
error = put_user(size, (loff_t __user *)arg);
break;

case SNAPSHOT_AVAIL_SWAP_SIZE:
case SNAPSHOT_AVAIL_SWAP:
snapshot_deprecated_ioctl(cmd);
case SNAPSHOT_AVAIL_SWAP_SIZE:
size = count_swap_pages(data->swap, 1);
size <<= PAGE_SHIFT;
error = put_user(size, (loff_t __user *)arg);
break;

case SNAPSHOT_ALLOC_SWAP_PAGE:
case SNAPSHOT_GET_SWAP_PAGE:
snapshot_deprecated_ioctl(cmd);
case SNAPSHOT_ALLOC_SWAP_PAGE:
if (data->swap < 0 || data->swap >= MAX_SWAPFILES) {
error = -ENODEV;
break;
Expand All @@ -321,6 +334,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
break;

case SNAPSHOT_SET_SWAP_FILE: /* This ioctl is deprecated */
snapshot_deprecated_ioctl(cmd);
if (!swsusp_swap_in_use()) {
/*
* User space encodes device types as two-byte values,
Expand Down Expand Up @@ -362,6 +376,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
break;

case SNAPSHOT_PMOPS: /* This ioctl is deprecated */
snapshot_deprecated_ioctl(cmd);
error = -EINVAL;

switch (arg) {
Expand Down

0 comments on commit 90624df

Please sign in to comment.