diff options
author | Arnd Bergmann <arnd@arndb.de> | 2007-10-09 07:23:55 -0400 |
---|---|---|
committer | Jens Axboe <axboe@carl.home.kernel.dk> | 2007-10-10 03:26:00 -0400 |
commit | 9617db085c119879cd371e3212806a15596e121a (patch) | |
tree | 17db98cd2d195105124f1d8a96f249ca073918cd /fs | |
parent | 171044d449611c6e5040b37210ff6aba47f33ee4 (diff) |
compat_ioctl: move hdio calls to block/compat_ioctl.c
These are common to multiple block drivers, so they should
be handled by the block layer.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/compat_ioctl.c | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index 71065603a581..e6a94714b1b0 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/if.h> | 21 | #include <linux/if.h> |
22 | #include <linux/if_bridge.h> | 22 | #include <linux/if_bridge.h> |
23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
24 | #include <linux/hdreg.h> | ||
25 | #include <linux/raid/md.h> | 24 | #include <linux/raid/md.h> |
26 | #include <linux/kd.h> | 25 | #include <linux/kd.h> |
27 | #include <linux/dirent.h> | 26 | #include <linux/dirent.h> |
@@ -667,53 +666,6 @@ out: | |||
667 | #endif | 666 | #endif |
668 | 667 | ||
669 | #ifdef CONFIG_BLOCK | 668 | #ifdef CONFIG_BLOCK |
670 | struct hd_geometry32 { | ||
671 | unsigned char heads; | ||
672 | unsigned char sectors; | ||
673 | unsigned short cylinders; | ||
674 | u32 start; | ||
675 | }; | ||
676 | |||
677 | static int hdio_getgeo(unsigned int fd, unsigned int cmd, unsigned long arg) | ||
678 | { | ||
679 | mm_segment_t old_fs = get_fs(); | ||
680 | struct hd_geometry geo; | ||
681 | struct hd_geometry32 __user *ugeo; | ||
682 | int err; | ||
683 | |||
684 | set_fs (KERNEL_DS); | ||
685 | err = sys_ioctl(fd, HDIO_GETGEO, (unsigned long)&geo); | ||
686 | set_fs (old_fs); | ||
687 | ugeo = compat_ptr(arg); | ||
688 | if (!err) { | ||
689 | err = copy_to_user (ugeo, &geo, 4); | ||
690 | err |= __put_user (geo.start, &ugeo->start); | ||
691 | if (err) | ||
692 | err = -EFAULT; | ||
693 | } | ||
694 | return err; | ||
695 | } | ||
696 | |||
697 | static int hdio_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) | ||
698 | { | ||
699 | mm_segment_t old_fs = get_fs(); | ||
700 | unsigned long kval; | ||
701 | unsigned int __user *uvp; | ||
702 | int error; | ||
703 | |||
704 | set_fs(KERNEL_DS); | ||
705 | error = sys_ioctl(fd, cmd, (long)&kval); | ||
706 | set_fs(old_fs); | ||
707 | |||
708 | if(error == 0) { | ||
709 | uvp = compat_ptr(arg); | ||
710 | if(put_user(kval, uvp)) | ||
711 | error = -EFAULT; | ||
712 | } | ||
713 | return error; | ||
714 | } | ||
715 | |||
716 | |||
717 | typedef struct sg_io_hdr32 { | 669 | typedef struct sg_io_hdr32 { |
718 | compat_int_t interface_id; /* [i] 'S' for SCSI generic (required) */ | 670 | compat_int_t interface_id; /* [i] 'S' for SCSI generic (required) */ |
719 | compat_int_t dxfer_direction; /* [i] data transfer direction */ | 671 | compat_int_t dxfer_direction; /* [i] data transfer direction */ |
@@ -3208,19 +3160,7 @@ HANDLE_IOCTL(SIOCGSTAMP, do_siocgstamp) | |||
3208 | HANDLE_IOCTL(SIOCGSTAMPNS, do_siocgstampns) | 3160 | HANDLE_IOCTL(SIOCGSTAMPNS, do_siocgstampns) |
3209 | #endif | 3161 | #endif |
3210 | #ifdef CONFIG_BLOCK | 3162 | #ifdef CONFIG_BLOCK |
3211 | HANDLE_IOCTL(HDIO_GETGEO, hdio_getgeo) | ||
3212 | HANDLE_IOCTL(BLKPG, blkpg_ioctl_trans) | 3163 | HANDLE_IOCTL(BLKPG, blkpg_ioctl_trans) |
3213 | HANDLE_IOCTL(HDIO_GET_UNMASKINTR, hdio_ioctl_trans) | ||
3214 | HANDLE_IOCTL(HDIO_GET_MULTCOUNT, hdio_ioctl_trans) | ||
3215 | HANDLE_IOCTL(HDIO_GET_KEEPSETTINGS, hdio_ioctl_trans) | ||
3216 | HANDLE_IOCTL(HDIO_GET_32BIT, hdio_ioctl_trans) | ||
3217 | HANDLE_IOCTL(HDIO_GET_NOWERR, hdio_ioctl_trans) | ||
3218 | HANDLE_IOCTL(HDIO_GET_DMA, hdio_ioctl_trans) | ||
3219 | HANDLE_IOCTL(HDIO_GET_NICE, hdio_ioctl_trans) | ||
3220 | HANDLE_IOCTL(HDIO_GET_WCACHE, hdio_ioctl_trans) | ||
3221 | HANDLE_IOCTL(HDIO_GET_ACOUSTIC, hdio_ioctl_trans) | ||
3222 | HANDLE_IOCTL(HDIO_GET_ADDRESS, hdio_ioctl_trans) | ||
3223 | HANDLE_IOCTL(HDIO_GET_BUSSTATE, hdio_ioctl_trans) | ||
3224 | HANDLE_IOCTL(FDSETPRM32, fd_ioctl_trans) | 3164 | HANDLE_IOCTL(FDSETPRM32, fd_ioctl_trans) |
3225 | HANDLE_IOCTL(FDDEFPRM32, fd_ioctl_trans) | 3165 | HANDLE_IOCTL(FDDEFPRM32, fd_ioctl_trans) |
3226 | HANDLE_IOCTL(FDGETPRM32, fd_ioctl_trans) | 3166 | HANDLE_IOCTL(FDGETPRM32, fd_ioctl_trans) |