diff options
author | Christoph Hellwig <hch@lst.de> | 2006-03-24 06:15:22 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-24 10:33:17 -0500 |
commit | 82814dbafdeef53e13e07134eb3b7be3c975fd21 (patch) | |
tree | c54dded7519743b678b73fabffea6108fb456eb6 /drivers/s390 | |
parent | 8b2eb664ce9dcba8b54ececf5e057470c47e57f7 (diff) |
[PATCH] s390: remove dynamic dasd ioctls
Now that there are no more users of the awkward dynamic ioctl hack we can
remove the code to support it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/block/dasd_int.h | 11 | ||||
-rw-r--r-- | drivers/s390/block/dasd_ioctl.c | 69 |
2 files changed, 0 insertions, 80 deletions
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h index e9485559e22e..6d7fa30fa0b8 100644 --- a/drivers/s390/block/dasd_int.h +++ b/drivers/s390/block/dasd_int.h | |||
@@ -69,15 +69,6 @@ | |||
69 | */ | 69 | */ |
70 | struct dasd_device; | 70 | struct dasd_device; |
71 | 71 | ||
72 | typedef int (*dasd_ioctl_fn_t) (struct block_device *bdev, int no, long args); | ||
73 | |||
74 | struct dasd_ioctl { | ||
75 | struct list_head list; | ||
76 | struct module *owner; | ||
77 | int no; | ||
78 | dasd_ioctl_fn_t handler; | ||
79 | }; | ||
80 | |||
81 | typedef enum { | 72 | typedef enum { |
82 | dasd_era_fatal = -1, /* no chance to recover */ | 73 | dasd_era_fatal = -1, /* no chance to recover */ |
83 | dasd_era_none = 0, /* don't recover, everything alright */ | 74 | dasd_era_none = 0, /* don't recover, everything alright */ |
@@ -524,8 +515,6 @@ int dasd_scan_partitions(struct dasd_device *); | |||
524 | void dasd_destroy_partitions(struct dasd_device *); | 515 | void dasd_destroy_partitions(struct dasd_device *); |
525 | 516 | ||
526 | /* externals in dasd_ioctl.c */ | 517 | /* externals in dasd_ioctl.c */ |
527 | int dasd_ioctl_no_register(struct module *, int, dasd_ioctl_fn_t); | ||
528 | int dasd_ioctl_no_unregister(struct module *, int, dasd_ioctl_fn_t); | ||
529 | int dasd_ioctl(struct inode *, struct file *, unsigned int, unsigned long); | 518 | int dasd_ioctl(struct inode *, struct file *, unsigned int, unsigned long); |
530 | long dasd_compat_ioctl(struct file *, unsigned int, unsigned long); | 519 | long dasd_compat_ioctl(struct file *, unsigned int, unsigned long); |
531 | 520 | ||
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c index c8319bef2730..e1dc0ffee027 100644 --- a/drivers/s390/block/dasd_ioctl.c +++ b/drivers/s390/block/dasd_ioctl.c | |||
@@ -24,59 +24,6 @@ | |||
24 | 24 | ||
25 | #include "dasd_int.h" | 25 | #include "dasd_int.h" |
26 | 26 | ||
27 | /* | ||
28 | * SECTION: ioctl functions. | ||
29 | */ | ||
30 | static struct list_head dasd_ioctl_list = LIST_HEAD_INIT(dasd_ioctl_list); | ||
31 | |||
32 | /* | ||
33 | * Find the ioctl with number no. | ||
34 | */ | ||
35 | static struct dasd_ioctl * | ||
36 | dasd_find_ioctl(int no) | ||
37 | { | ||
38 | struct dasd_ioctl *ioctl; | ||
39 | |||
40 | list_for_each_entry (ioctl, &dasd_ioctl_list, list) | ||
41 | if (ioctl->no == no) | ||
42 | return ioctl; | ||
43 | return NULL; | ||
44 | } | ||
45 | |||
46 | /* | ||
47 | * Register ioctl with number no. | ||
48 | */ | ||
49 | int | ||
50 | dasd_ioctl_no_register(struct module *owner, int no, dasd_ioctl_fn_t handler) | ||
51 | { | ||
52 | struct dasd_ioctl *new; | ||
53 | if (dasd_find_ioctl(no)) | ||
54 | return -EBUSY; | ||
55 | new = kmalloc(sizeof (struct dasd_ioctl), GFP_KERNEL); | ||
56 | if (new == NULL) | ||
57 | return -ENOMEM; | ||
58 | new->owner = owner; | ||
59 | new->no = no; | ||
60 | new->handler = handler; | ||
61 | list_add(&new->list, &dasd_ioctl_list); | ||
62 | return 0; | ||
63 | } | ||
64 | |||
65 | /* | ||
66 | * Deregister ioctl with number no. | ||
67 | */ | ||
68 | int | ||
69 | dasd_ioctl_no_unregister(struct module *owner, int no, dasd_ioctl_fn_t handler) | ||
70 | { | ||
71 | struct dasd_ioctl *old = dasd_find_ioctl(no); | ||
72 | if (old == NULL) | ||
73 | return -ENOENT; | ||
74 | if (old->no != no || old->handler != handler || owner != old->owner) | ||
75 | return -EINVAL; | ||
76 | list_del(&old->list); | ||
77 | kfree(old); | ||
78 | return 0; | ||
79 | } | ||
80 | 27 | ||
81 | static int | 28 | static int |
82 | dasd_ioctl_api_version(void __user *argp) | 29 | dasd_ioctl_api_version(void __user *argp) |
@@ -429,8 +376,6 @@ dasd_ioctl(struct inode *inode, struct file *file, | |||
429 | struct block_device *bdev = inode->i_bdev; | 376 | struct block_device *bdev = inode->i_bdev; |
430 | struct dasd_device *device = bdev->bd_disk->private_data; | 377 | struct dasd_device *device = bdev->bd_disk->private_data; |
431 | void __user *argp = (void __user *)arg; | 378 | void __user *argp = (void __user *)arg; |
432 | struct dasd_ioctl *ioctl; | ||
433 | int rc; | ||
434 | 379 | ||
435 | if (!device) | 380 | if (!device) |
436 | return -ENODEV; | 381 | return -ENODEV; |
@@ -477,17 +422,6 @@ dasd_ioctl(struct inode *inode, struct file *file, | |||
477 | return rval; | 422 | return rval; |
478 | } | 423 | } |
479 | 424 | ||
480 | /* else resort to the deprecated dynamic ioctl list */ | ||
481 | list_for_each_entry(ioctl, &dasd_ioctl_list, list) { | ||
482 | if (ioctl->no == cmd) { | ||
483 | /* Found a matching ioctl. Call it. */ | ||
484 | if (!try_module_get(ioctl->owner)) | ||
485 | continue; | ||
486 | rc = ioctl->handler(bdev, cmd, arg); | ||
487 | module_put(ioctl->owner); | ||
488 | return rc; | ||
489 | } | ||
490 | } | ||
491 | return -EINVAL; | 425 | return -EINVAL; |
492 | } | 426 | } |
493 | } | 427 | } |
@@ -503,6 +437,3 @@ dasd_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
503 | 437 | ||
504 | return (rval == -EINVAL) ? -ENOIOCTLCMD : rval; | 438 | return (rval == -EINVAL) ? -ENOIOCTLCMD : rval; |
505 | } | 439 | } |
506 | |||
507 | EXPORT_SYMBOL(dasd_ioctl_no_register); | ||
508 | EXPORT_SYMBOL(dasd_ioctl_no_unregister); | ||