s390: use normal switch statement for ioctls in dasd_ioctl.c.
Subsystems (2)
PATCH 9/24 s390: use normal switch statement for ioctls in dasd_ioctl.c.
From: Christoph Hellwig <[email protected]>
[patch 9/24] s390: use normal switch statement for ioctls in dasd_ioctl.c.
Handle ioctls implemented in dasd_ioctl through the normal switch statement that most drivers use instead of the awkwarddasd_ioctl_no_register routine. This avoids searching a linear list
on every call to dasd_ioctl(), and allows to give the various ioctl implementation functions sane prototypes, aswell as moving the check for bdev->bd_disk->private_data from the individual functions to dasd_ioctl. (I think it can't actually every be NULL, but let's keep that for later)
Signed-off-by Christoph Hellwig <[email protected]>
Signed-off-by Martin Schwidefsky <[email protected]>
---
drivers/s390/block/dasd.c | 4 drivers/s390/block/dasd_int.h | 2 drivers/s390/block/dasd_ioctl.c | 241 ++++++++++++++-------------------------- 3 files changed, 86 insertions(+), 161 deletions(-)
drivers/s390/block/dasd.c +0 -4
@@ -1807,7 +1807,6 @@ dasd_exit(void)#ifdef CONFIG_PROC_FS dasd_proc_exit ();#endif -dasd_ioctl_exit ();if (dasd_page_cache !=NULL ) {kmem_cache_destroy (dasd_page_cache); dasd_page_cache =NULL ;
@@ -2093,9 +2092,6 @@ dasd_init(void) rc =dasd_parse ();if (rc) goto failed; - rc =dasd_ioctl_init (); -if (rc) - goto failed;#ifdef CONFIG_PROC_FS rc =dasd_proc_init ();if (rc)
drivers/s390/block/dasd_int.h +0 -2
@@ -523,8 +523,6 @@ int dasd_scan_partitions(struct dasd_devvoid dasd_destroy_partitions (struct dasd_device *);/* externals in dasd_ioctl.c */ -int dasd_ioctl_init (void ); -void dasd_ioctl_exit (void );int dasd_ioctl_no_register (struct module *,int ,dasd_ioctl_fn_t );int dasd_ioctl_no_unregister (struct module *,int ,dasd_ioctl_fn_t );int dasd_ioctl (struct inode *,struct file *,unsigned int ,unsigned long );
drivers/s390/block/dasd_ioctl.c +86 -155
381 lines not on this page · raw message