Commit aa98aa31 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by NeilBrown

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: default avatarArnd 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: default avatarNeilBrown <neilb@suse.de>
parent 93bd89a6
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <linux/random.h> #include <linux/random.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/file.h> #include <linux/file.h>
#include <linux/compat.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/raid/md_p.h> #include <linux/raid/md_p.h>
#include <linux/raid/md_u.h> #include <linux/raid/md_u.h>
...@@ -5691,6 +5692,25 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode, ...@@ -5691,6 +5692,25 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
abort: abort:
return err; return err;
} }
#ifdef CONFIG_COMPAT
static int md_compat_ioctl(struct block_device *bdev, fmode_t mode,
unsigned int cmd, unsigned long arg)
{
switch (cmd) {
case HOT_REMOVE_DISK:
case HOT_ADD_DISK:
case SET_DISK_FAULTY:
case SET_BITMAP_FILE:
/* These take in integer arg, do not convert */
break;
default:
arg = (unsigned long)compat_ptr(arg);
break;
}
return md_ioctl(bdev, mode, cmd, arg);
}
#endif /* CONFIG_COMPAT */
static int md_open(struct block_device *bdev, fmode_t mode) static int md_open(struct block_device *bdev, fmode_t mode)
{ {
...@@ -5756,6 +5776,9 @@ static const struct block_device_operations md_fops = ...@@ -5756,6 +5776,9 @@ static const struct block_device_operations md_fops =
.open = md_open, .open = md_open,
.release = md_release, .release = md_release,
.ioctl = md_ioctl, .ioctl = md_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = md_compat_ioctl,
#endif
.getgeo = md_getgeo, .getgeo = md_getgeo,
.media_changed = md_media_changed, .media_changed = md_media_changed,
.revalidate_disk= md_revalidate, .revalidate_disk= md_revalidate,
......
...@@ -979,24 +979,6 @@ COMPATIBLE_IOCTL(FIGETBSZ) ...@@ -979,24 +979,6 @@ COMPATIBLE_IOCTL(FIGETBSZ)
/* 'X' - originally XFS but some now in the VFS */ /* 'X' - originally XFS but some now in the VFS */
COMPATIBLE_IOCTL(FIFREEZE) COMPATIBLE_IOCTL(FIFREEZE)
COMPATIBLE_IOCTL(FITHAW) COMPATIBLE_IOCTL(FITHAW)
/* RAID */
COMPATIBLE_IOCTL(RAID_VERSION)
COMPATIBLE_IOCTL(GET_ARRAY_INFO)
COMPATIBLE_IOCTL(GET_DISK_INFO)
COMPATIBLE_IOCTL(PRINT_RAID_DEBUG)
COMPATIBLE_IOCTL(RAID_AUTORUN)
COMPATIBLE_IOCTL(CLEAR_ARRAY)
COMPATIBLE_IOCTL(ADD_NEW_DISK)
COMPATIBLE_IOCTL(SET_ARRAY_INFO)
COMPATIBLE_IOCTL(SET_DISK_INFO)
COMPATIBLE_IOCTL(WRITE_RAID_INFO)
COMPATIBLE_IOCTL(UNPROTECT_ARRAY)
COMPATIBLE_IOCTL(PROTECT_ARRAY)
COMPATIBLE_IOCTL(RUN_ARRAY)
COMPATIBLE_IOCTL(STOP_ARRAY)
COMPATIBLE_IOCTL(STOP_ARRAY_RO)
COMPATIBLE_IOCTL(RESTART_ARRAY_RW)
COMPATIBLE_IOCTL(GET_BITMAP_FILE)
COMPATIBLE_IOCTL(KDGETKEYCODE) COMPATIBLE_IOCTL(KDGETKEYCODE)
COMPATIBLE_IOCTL(KDSETKEYCODE) COMPATIBLE_IOCTL(KDSETKEYCODE)
COMPATIBLE_IOCTL(KDGKBTYPE) COMPATIBLE_IOCTL(KDGKBTYPE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment