Commit b694e52ebdd439e4591d4a6651658026196174f6
Committed by
Rafael J. Wysocki
1 parent
f8824cee40
Exists in
master
and in
7 other branches
PM / Hibernate: Really deprecate deprecated user ioctls
They were deprecated and removed from exported headers more than 2 years ago. Inform users about their removal in the future now. (Switch cases needed to be reorderded for an easy fall through.) And add an entry to feature-removal-schedule. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Showing 2 changed files with 30 additions and 4 deletions Side-by-side Diff
Documentation/feature-removal-schedule.txt
... | ... | @@ -64,6 +64,17 @@ |
64 | 64 | |
65 | 65 | --------------------------- |
66 | 66 | |
67 | +What: Deprecated snapshot ioctls | |
68 | +When: 2.6.36 | |
69 | + | |
70 | +Why: The ioctls in kernel/power/user.c were marked as deprecated long time | |
71 | + ago. Now they notify users about that so that they need to replace | |
72 | + their userspace. After some more time, remove them completely. | |
73 | + | |
74 | +Who: Jiri Slaby <jirislaby@gmail.com> | |
75 | + | |
76 | +--------------------------- | |
77 | + | |
67 | 78 | What: The ieee80211_regdom module parameter |
68 | 79 | When: March 2010 / desktop catchup |
69 | 80 |
kernel/power/user.c
... | ... | @@ -195,6 +195,15 @@ |
195 | 195 | return res; |
196 | 196 | } |
197 | 197 | |
198 | +static void snapshot_deprecated_ioctl(unsigned int cmd) | |
199 | +{ | |
200 | + if (printk_ratelimit()) | |
201 | + printk(KERN_NOTICE "%pf: ioctl '%.8x' is deprecated and will " | |
202 | + "be removed soon, update your suspend-to-disk " | |
203 | + "utilities\n", | |
204 | + __builtin_return_address(0), cmd); | |
205 | +} | |
206 | + | |
198 | 207 | static long snapshot_ioctl(struct file *filp, unsigned int cmd, |
199 | 208 | unsigned long arg) |
200 | 209 | { |
201 | 210 | |
... | ... | @@ -246,8 +255,9 @@ |
246 | 255 | data->frozen = 0; |
247 | 256 | break; |
248 | 257 | |
249 | - case SNAPSHOT_CREATE_IMAGE: | |
250 | 258 | case SNAPSHOT_ATOMIC_SNAPSHOT: |
259 | + snapshot_deprecated_ioctl(cmd); | |
260 | + case SNAPSHOT_CREATE_IMAGE: | |
251 | 261 | if (data->mode != O_RDONLY || !data->frozen || data->ready) { |
252 | 262 | error = -EPERM; |
253 | 263 | break; |
254 | 264 | |
... | ... | @@ -275,8 +285,9 @@ |
275 | 285 | data->ready = 0; |
276 | 286 | break; |
277 | 287 | |
278 | - case SNAPSHOT_PREF_IMAGE_SIZE: | |
279 | 288 | case SNAPSHOT_SET_IMAGE_SIZE: |
289 | + snapshot_deprecated_ioctl(cmd); | |
290 | + case SNAPSHOT_PREF_IMAGE_SIZE: | |
280 | 291 | image_size = arg; |
281 | 292 | break; |
282 | 293 | |
283 | 294 | |
284 | 295 | |
285 | 296 | |
... | ... | @@ -290,15 +301,17 @@ |
290 | 301 | error = put_user(size, (loff_t __user *)arg); |
291 | 302 | break; |
292 | 303 | |
293 | - case SNAPSHOT_AVAIL_SWAP_SIZE: | |
294 | 304 | case SNAPSHOT_AVAIL_SWAP: |
305 | + snapshot_deprecated_ioctl(cmd); | |
306 | + case SNAPSHOT_AVAIL_SWAP_SIZE: | |
295 | 307 | size = count_swap_pages(data->swap, 1); |
296 | 308 | size <<= PAGE_SHIFT; |
297 | 309 | error = put_user(size, (loff_t __user *)arg); |
298 | 310 | break; |
299 | 311 | |
300 | - case SNAPSHOT_ALLOC_SWAP_PAGE: | |
301 | 312 | case SNAPSHOT_GET_SWAP_PAGE: |
313 | + snapshot_deprecated_ioctl(cmd); | |
314 | + case SNAPSHOT_ALLOC_SWAP_PAGE: | |
302 | 315 | if (data->swap < 0 || data->swap >= MAX_SWAPFILES) { |
303 | 316 | error = -ENODEV; |
304 | 317 | break; |
... | ... | @@ -321,6 +334,7 @@ |
321 | 334 | break; |
322 | 335 | |
323 | 336 | case SNAPSHOT_SET_SWAP_FILE: /* This ioctl is deprecated */ |
337 | + snapshot_deprecated_ioctl(cmd); | |
324 | 338 | if (!swsusp_swap_in_use()) { |
325 | 339 | /* |
326 | 340 | * User space encodes device types as two-byte values, |
... | ... | @@ -362,6 +376,7 @@ |
362 | 376 | break; |
363 | 377 | |
364 | 378 | case SNAPSHOT_PMOPS: /* This ioctl is deprecated */ |
379 | + snapshot_deprecated_ioctl(cmd); | |
365 | 380 | error = -EINVAL; |
366 | 381 | |
367 | 382 | switch (arg) { |