aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2009-12-13 20:50:05 -0500
committerNeilBrown <neilb@suse.de>2009-12-13 20:51:41 -0500
commitaa98aa31987ad9831711ae71ea2270228ab62532 (patch)
tree736036691f07fe4b7d18064aaa0ace5d76b73cf6
parent93bd89a6d5f268acbdb8d775e40d3a280b07b5bd (diff)
md: move compat_ioctl handling into md.c
The RAID ioctls are only implemented in md.c, so the handling for them should also be moved there from fs/compat_ioctl.c. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Neil Brown <neilb@suse.de> Cc: Andre Noll <maan@systemlinux.org> Cc: linux-raid@vger.kernel.org Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--drivers/md/md.c23
-rw-r--r--fs/compat_ioctl.c18
2 files changed, 23 insertions, 18 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index bcc66680952e..08564375d6b5 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -44,6 +44,7 @@
44#include <linux/random.h> 44#include <linux/random.h>
45#include <linux/reboot.h> 45#include <linux/reboot.h>
46#include <linux/file.h> 46#include <linux/file.h>
47#include <linux/compat.h>
47#include <linux/delay.h> 48#include <linux/delay.h>
48#include <linux/raid/md_p.h> 49#include <linux/raid/md_p.h>
49#include <linux/raid/md_u.h> 50#include <linux/raid/md_u.h>
@@ -5691,6 +5692,25 @@ done:
5691abort: 5692abort:
5692 return err; 5693 return err;
5693} 5694}
5695#ifdef CONFIG_COMPAT
5696static int md_compat_ioctl(struct block_device *bdev, fmode_t mode,
5697 unsigned int cmd, unsigned long arg)
5698{
5699 switch (cmd) {
5700 case HOT_REMOVE_DISK:
5701 case HOT_ADD_DISK:
5702 case SET_DISK_FAULTY:
5703 case SET_BITMAP_FILE:
5704 /* These take in integer arg, do not convert */
5705 break;
5706 default:
5707 arg = (unsigned long)compat_ptr(arg);
5708 break;
5709 }
5710
5711 return md_ioctl(bdev, mode, cmd, arg);
5712}
5713#endif /* CONFIG_COMPAT */
5694 5714
5695static int md_open(struct block_device *bdev, fmode_t mode) 5715static int md_open(struct block_device *bdev, fmode_t mode)
5696{ 5716{
@@ -5756,6 +5776,9 @@ static const struct block_device_operations md_fops =
5756 .open = md_open, 5776 .open = md_open,
5757 .release = md_release, 5777 .release = md_release,
5758 .ioctl = md_ioctl, 5778 .ioctl = md_ioctl,
5779#ifdef CONFIG_COMPAT
5780 .compat_ioctl = md_compat_ioctl,
5781#endif
5759 .getgeo = md_getgeo, 5782 .getgeo = md_getgeo,
5760 .media_changed = md_media_changed, 5783 .media_changed = md_media_changed,
5761 .revalidate_disk= md_revalidate, 5784 .revalidate_disk= md_revalidate,
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 278020d2449c..14cbc831422a 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -979,24 +979,6 @@ COMPATIBLE_IOCTL(FIGETBSZ)
979/* 'X' - originally XFS but some now in the VFS */ 979/* 'X' - originally XFS but some now in the VFS */
980COMPATIBLE_IOCTL(FIFREEZE) 980COMPATIBLE_IOCTL(FIFREEZE)
981COMPATIBLE_IOCTL(FITHAW) 981COMPATIBLE_IOCTL(FITHAW)
982/* RAID */
983COMPATIBLE_IOCTL(RAID_VERSION)
984COMPATIBLE_IOCTL(GET_ARRAY_INFO)
985COMPATIBLE_IOCTL(GET_DISK_INFO)
986COMPATIBLE_IOCTL(PRINT_RAID_DEBUG)
987COMPATIBLE_IOCTL(RAID_AUTORUN)
988COMPATIBLE_IOCTL(CLEAR_ARRAY)
989COMPATIBLE_IOCTL(ADD_NEW_DISK)
990COMPATIBLE_IOCTL(SET_ARRAY_INFO)
991COMPATIBLE_IOCTL(SET_DISK_INFO)
992COMPATIBLE_IOCTL(WRITE_RAID_INFO)
993COMPATIBLE_IOCTL(UNPROTECT_ARRAY)
994COMPATIBLE_IOCTL(PROTECT_ARRAY)
995COMPATIBLE_IOCTL(RUN_ARRAY)
996COMPATIBLE_IOCTL(STOP_ARRAY)
997COMPATIBLE_IOCTL(STOP_ARRAY_RO)
998COMPATIBLE_IOCTL(RESTART_ARRAY_RW)
999COMPATIBLE_IOCTL(GET_BITMAP_FILE)
1000COMPATIBLE_IOCTL(KDGETKEYCODE) 982COMPATIBLE_IOCTL(KDGETKEYCODE)
1001COMPATIBLE_IOCTL(KDSETKEYCODE) 983COMPATIBLE_IOCTL(KDSETKEYCODE)
1002COMPATIBLE_IOCTL(KDGKBTYPE) 984COMPATIBLE_IOCTL(KDGKBTYPE)