Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] remove register_ioctl32_conversion and unregister_ioctl32_conversion

All users have been converted.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Adrian Bunk and committed by
Linus Torvalds
5dd42c26 3676347a

-120
-8
Documentation/feature-removal-schedule.txt
··· 51 51 52 52 --------------------------- 53 53 54 - What: register_ioctl32_conversion() / unregister_ioctl32_conversion() 55 - When: April 2005 56 - Why: Replaced by ->compat_ioctl in file_operations and other method 57 - vecors. 58 - Who: Andi Kleen <ak@muc.de>, Christoph Hellwig <hch@lst.de> 59 - 60 - --------------------------- 61 - 62 54 What: RCU API moves to EXPORT_SYMBOL_GPL 63 55 When: April 2006 64 56 Files: include/linux/rcupdate.h, kernel/rcupdate.c
-90
fs/compat.c
··· 310 310 311 311 __initcall(init_sys32_ioctl); 312 312 313 - int register_ioctl32_conversion(unsigned int cmd, 314 - ioctl_trans_handler_t handler) 315 - { 316 - struct ioctl_trans *t; 317 - struct ioctl_trans *new_t; 318 - unsigned long hash = ioctl32_hash(cmd); 319 - 320 - new_t = kmalloc(sizeof(*new_t), GFP_KERNEL); 321 - if (!new_t) 322 - return -ENOMEM; 323 - 324 - down_write(&ioctl32_sem); 325 - for (t = ioctl32_hash_table[hash]; t; t = t->next) { 326 - if (t->cmd == cmd) { 327 - printk(KERN_ERR "Trying to register duplicated ioctl32 " 328 - "handler %x\n", cmd); 329 - up_write(&ioctl32_sem); 330 - kfree(new_t); 331 - return -EINVAL; 332 - } 333 - } 334 - new_t->next = NULL; 335 - new_t->cmd = cmd; 336 - new_t->handler = handler; 337 - ioctl32_insert_translation(new_t); 338 - 339 - up_write(&ioctl32_sem); 340 - return 0; 341 - } 342 - EXPORT_SYMBOL(register_ioctl32_conversion); 343 - 344 - static inline int builtin_ioctl(struct ioctl_trans *t) 345 - { 346 - return t >= ioctl_start && t < (ioctl_start + ioctl_table_size); 347 - } 348 - 349 - /* Problem: 350 - This function cannot unregister duplicate ioctls, because they are not 351 - unique. 352 - When they happen we need to extend the prototype to pass the handler too. */ 353 - 354 - int unregister_ioctl32_conversion(unsigned int cmd) 355 - { 356 - unsigned long hash = ioctl32_hash(cmd); 357 - struct ioctl_trans *t, *t1; 358 - 359 - down_write(&ioctl32_sem); 360 - 361 - t = ioctl32_hash_table[hash]; 362 - if (!t) { 363 - up_write(&ioctl32_sem); 364 - return -EINVAL; 365 - } 366 - 367 - if (t->cmd == cmd) { 368 - if (builtin_ioctl(t)) { 369 - printk("%p tried to unregister builtin ioctl %x\n", 370 - __builtin_return_address(0), cmd); 371 - } else { 372 - ioctl32_hash_table[hash] = t->next; 373 - up_write(&ioctl32_sem); 374 - kfree(t); 375 - return 0; 376 - } 377 - } 378 - while (t->next) { 379 - t1 = t->next; 380 - if (t1->cmd == cmd) { 381 - if (builtin_ioctl(t1)) { 382 - printk("%p tried to unregister builtin " 383 - "ioctl %x\n", 384 - __builtin_return_address(0), cmd); 385 - goto out; 386 - } else { 387 - t->next = t1->next; 388 - up_write(&ioctl32_sem); 389 - kfree(t1); 390 - return 0; 391 - } 392 - } 393 - t = t1; 394 - } 395 - printk(KERN_ERR "Trying to free unknown 32bit ioctl handler %x\n", 396 - cmd); 397 - out: 398 - up_write(&ioctl32_sem); 399 - return -EINVAL; 400 - } 401 - EXPORT_SYMBOL(unregister_ioctl32_conversion); 402 - 403 313 static void compat_ioctl_error(struct file *filp, unsigned int fd, 404 314 unsigned int cmd, unsigned long arg) 405 315 {
-22
include/linux/ioctl32.h
··· 14 14 struct ioctl_trans *next; 15 15 }; 16 16 17 - /* 18 - * Register an 32bit ioctl translation handler for ioctl cmd. 19 - * 20 - * handler == NULL: use 64bit ioctl handler. 21 - * arguments to handler: fd: file descriptor 22 - * cmd: ioctl command. 23 - * arg: ioctl argument 24 - * struct file *file: file descriptor pointer. 25 - */ 26 - 27 - #ifdef CONFIG_COMPAT 28 - extern int __deprecated register_ioctl32_conversion(unsigned int cmd, 29 - ioctl_trans_handler_t handler); 30 - extern int __deprecated unregister_ioctl32_conversion(unsigned int cmd); 31 - 32 - #else 33 - 34 - #define register_ioctl32_conversion(cmd, handler) ({ 0; }) 35 - #define unregister_ioctl32_conversion(cmd) ({ 0; }) 36 - 37 - #endif 38 - 39 17 #endif