diff options
-rw-r--r-- | drivers/md/md.c | 23 | ||||
-rw-r--r-- | fs/compat_ioctl.c | 18 |
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: | |||
5691 | abort: | 5692 | abort: |
5692 | return err; | 5693 | return err; |
5693 | } | 5694 | } |
5695 | #ifdef CONFIG_COMPAT | ||
5696 | static 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 | ||
5695 | static int md_open(struct block_device *bdev, fmode_t mode) | 5715 | static 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 */ |
980 | COMPATIBLE_IOCTL(FIFREEZE) | 980 | COMPATIBLE_IOCTL(FIFREEZE) |
981 | COMPATIBLE_IOCTL(FITHAW) | 981 | COMPATIBLE_IOCTL(FITHAW) |
982 | /* RAID */ | ||
983 | COMPATIBLE_IOCTL(RAID_VERSION) | ||
984 | COMPATIBLE_IOCTL(GET_ARRAY_INFO) | ||
985 | COMPATIBLE_IOCTL(GET_DISK_INFO) | ||
986 | COMPATIBLE_IOCTL(PRINT_RAID_DEBUG) | ||
987 | COMPATIBLE_IOCTL(RAID_AUTORUN) | ||
988 | COMPATIBLE_IOCTL(CLEAR_ARRAY) | ||
989 | COMPATIBLE_IOCTL(ADD_NEW_DISK) | ||
990 | COMPATIBLE_IOCTL(SET_ARRAY_INFO) | ||
991 | COMPATIBLE_IOCTL(SET_DISK_INFO) | ||
992 | COMPATIBLE_IOCTL(WRITE_RAID_INFO) | ||
993 | COMPATIBLE_IOCTL(UNPROTECT_ARRAY) | ||
994 | COMPATIBLE_IOCTL(PROTECT_ARRAY) | ||
995 | COMPATIBLE_IOCTL(RUN_ARRAY) | ||
996 | COMPATIBLE_IOCTL(STOP_ARRAY) | ||
997 | COMPATIBLE_IOCTL(STOP_ARRAY_RO) | ||
998 | COMPATIBLE_IOCTL(RESTART_ARRAY_RW) | ||
999 | COMPATIBLE_IOCTL(GET_BITMAP_FILE) | ||
1000 | COMPATIBLE_IOCTL(KDGETKEYCODE) | 982 | COMPATIBLE_IOCTL(KDGETKEYCODE) |
1001 | COMPATIBLE_IOCTL(KDSETKEYCODE) | 983 | COMPATIBLE_IOCTL(KDSETKEYCODE) |
1002 | COMPATIBLE_IOCTL(KDGKBTYPE) | 984 | COMPATIBLE_IOCTL(KDGKBTYPE) |