aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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 /drivers
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/md.c23
1 files changed, 23 insertions, 0 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,