Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7339
b: refs/heads/master
c: 5dd42c2
h: refs/heads/master
i:
  7337: 15b0671
  7335: ad3986a
v: v3
  • Loading branch information
Adrian Bunk authored and Linus Torvalds committed Sep 7, 2005
1 parent 6d7d221 commit 85c4921
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 121 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: 3676347a5e216a7fec7f8eedbbcf8bed6b9c4e40
refs/heads/master: 5dd42c262bd742fa3602180bbe5550b4828de8f3
8 changes: 0 additions & 8 deletions trunk/Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@ Who: Adrian Bunk <bunk@stusta.de>

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

What: register_ioctl32_conversion() / unregister_ioctl32_conversion()
When: April 2005
Why: Replaced by ->compat_ioctl in file_operations and other method
vecors.
Who: Andi Kleen <ak@muc.de>, Christoph Hellwig <hch@lst.de>

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

What: RCU API moves to EXPORT_SYMBOL_GPL
When: April 2006
Files: include/linux/rcupdate.h, kernel/rcupdate.c
Expand Down
90 changes: 0 additions & 90 deletions trunk/fs/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,96 +310,6 @@ static int __init init_sys32_ioctl(void)

__initcall(init_sys32_ioctl);

int register_ioctl32_conversion(unsigned int cmd,
ioctl_trans_handler_t handler)
{
struct ioctl_trans *t;
struct ioctl_trans *new_t;
unsigned long hash = ioctl32_hash(cmd);

new_t = kmalloc(sizeof(*new_t), GFP_KERNEL);
if (!new_t)
return -ENOMEM;

down_write(&ioctl32_sem);
for (t = ioctl32_hash_table[hash]; t; t = t->next) {
if (t->cmd == cmd) {
printk(KERN_ERR "Trying to register duplicated ioctl32 "
"handler %x\n", cmd);
up_write(&ioctl32_sem);
kfree(new_t);
return -EINVAL;
}
}
new_t->next = NULL;
new_t->cmd = cmd;
new_t->handler = handler;
ioctl32_insert_translation(new_t);

up_write(&ioctl32_sem);
return 0;
}
EXPORT_SYMBOL(register_ioctl32_conversion);

static inline int builtin_ioctl(struct ioctl_trans *t)
{
return t >= ioctl_start && t < (ioctl_start + ioctl_table_size);
}

/* Problem:
This function cannot unregister duplicate ioctls, because they are not
unique.
When they happen we need to extend the prototype to pass the handler too. */

int unregister_ioctl32_conversion(unsigned int cmd)
{
unsigned long hash = ioctl32_hash(cmd);
struct ioctl_trans *t, *t1;

down_write(&ioctl32_sem);

t = ioctl32_hash_table[hash];
if (!t) {
up_write(&ioctl32_sem);
return -EINVAL;
}

if (t->cmd == cmd) {
if (builtin_ioctl(t)) {
printk("%p tried to unregister builtin ioctl %x\n",
__builtin_return_address(0), cmd);
} else {
ioctl32_hash_table[hash] = t->next;
up_write(&ioctl32_sem);
kfree(t);
return 0;
}
}
while (t->next) {
t1 = t->next;
if (t1->cmd == cmd) {
if (builtin_ioctl(t1)) {
printk("%p tried to unregister builtin "
"ioctl %x\n",
__builtin_return_address(0), cmd);
goto out;
} else {
t->next = t1->next;
up_write(&ioctl32_sem);
kfree(t1);
return 0;
}
}
t = t1;
}
printk(KERN_ERR "Trying to free unknown 32bit ioctl handler %x\n",
cmd);
out:
up_write(&ioctl32_sem);
return -EINVAL;
}
EXPORT_SYMBOL(unregister_ioctl32_conversion);

static void compat_ioctl_error(struct file *filp, unsigned int fd,
unsigned int cmd, unsigned long arg)
{
Expand Down
22 changes: 0 additions & 22 deletions trunk/include/linux/ioctl32.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,4 @@ struct ioctl_trans {
struct ioctl_trans *next;
};

/*
* Register an 32bit ioctl translation handler for ioctl cmd.
*
* handler == NULL: use 64bit ioctl handler.
* arguments to handler: fd: file descriptor
* cmd: ioctl command.
* arg: ioctl argument
* struct file *file: file descriptor pointer.
*/

#ifdef CONFIG_COMPAT
extern int __deprecated register_ioctl32_conversion(unsigned int cmd,
ioctl_trans_handler_t handler);
extern int __deprecated unregister_ioctl32_conversion(unsigned int cmd);

#else

#define register_ioctl32_conversion(cmd, handler) ({ 0; })
#define unregister_ioctl32_conversion(cmd) ({ 0; })

#endif

#endif

0 comments on commit 85c4921

Please sign in to comment.