mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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 <[email protected]> Cc: Neil Brown <[email protected]> Cc: Andre Noll <[email protected]> Cc: [email protected] Signed-off-by: NeilBrown <[email protected]>
This commit is contained in:
parent
93bd89a6d5
commit
aa98aa3198
2 changed files with 23 additions and 18 deletions
|
|
@ -44,6 +44,7 @@
|
|||
#include <linux/random.h>
|
||||
#include <linux/reboot.h>
|
||||
#include <linux/file.h>
|
||||
#include <linux/compat.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/raid/md_p.h>
|
||||
#include <linux/raid/md_u.h>
|
||||
|
|
@ -5691,6 +5692,25 @@ done:
|
|||
abort:
|
||||
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)
|
||||
{
|
||||
|
|
@ -5756,6 +5776,9 @@ static const struct block_device_operations md_fops =
|
|||
.open = md_open,
|
||||
.release = md_release,
|
||||
.ioctl = md_ioctl,
|
||||
#ifdef CONFIG_COMPAT
|
||||
.compat_ioctl = md_compat_ioctl,
|
||||
#endif
|
||||
.getgeo = md_getgeo,
|
||||
.media_changed = md_media_changed,
|
||||
.revalidate_disk= md_revalidate,
|
||||
|
|
|
|||
Loading…
Reference in a new issue