aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2007-10-09 07:23:55 -0400
committerJens Axboe <axboe@carl.home.kernel.dk>2007-10-10 03:26:00 -0400
commit9617db085c119879cd371e3212806a15596e121a (patch)
tree17db98cd2d195105124f1d8a96f249ca073918cd /fs
parent171044d449611c6e5040b37210ff6aba47f33ee4 (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.c60
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
670struct hd_geometry32 {
671 unsigned char heads;
672 unsigned char sectors;
673 unsigned short cylinders;
674 u32 start;
675};
676
677static 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
697static 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
717typedef struct sg_io_hdr32 { 669typedef 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)
3208HANDLE_IOCTL(SIOCGSTAMPNS, do_siocgstampns) 3160HANDLE_IOCTL(SIOCGSTAMPNS, do_siocgstampns)
3209#endif 3161#endif
3210#ifdef CONFIG_BLOCK 3162#ifdef CONFIG_BLOCK
3211HANDLE_IOCTL(HDIO_GETGEO, hdio_getgeo)
3212HANDLE_IOCTL(BLKPG, blkpg_ioctl_trans) 3163HANDLE_IOCTL(BLKPG, blkpg_ioctl_trans)
3213HANDLE_IOCTL(HDIO_GET_UNMASKINTR, hdio_ioctl_trans)
3214HANDLE_IOCTL(HDIO_GET_MULTCOUNT, hdio_ioctl_trans)
3215HANDLE_IOCTL(HDIO_GET_KEEPSETTINGS, hdio_ioctl_trans)
3216HANDLE_IOCTL(HDIO_GET_32BIT, hdio_ioctl_trans)
3217HANDLE_IOCTL(HDIO_GET_NOWERR, hdio_ioctl_trans)
3218HANDLE_IOCTL(HDIO_GET_DMA, hdio_ioctl_trans)
3219HANDLE_IOCTL(HDIO_GET_NICE, hdio_ioctl_trans)
3220HANDLE_IOCTL(HDIO_GET_WCACHE, hdio_ioctl_trans)
3221HANDLE_IOCTL(HDIO_GET_ACOUSTIC, hdio_ioctl_trans)
3222HANDLE_IOCTL(HDIO_GET_ADDRESS, hdio_ioctl_trans)
3223HANDLE_IOCTL(HDIO_GET_BUSSTATE, hdio_ioctl_trans)
3224HANDLE_IOCTL(FDSETPRM32, fd_ioctl_trans) 3164HANDLE_IOCTL(FDSETPRM32, fd_ioctl_trans)
3225HANDLE_IOCTL(FDDEFPRM32, fd_ioctl_trans) 3165HANDLE_IOCTL(FDDEFPRM32, fd_ioctl_trans)
3226HANDLE_IOCTL(FDGETPRM32, fd_ioctl_trans) 3166HANDLE_IOCTL(FDGETPRM32, fd_ioctl_trans)