aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/md.c')
-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,