mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-27 14:43:58 +08:00
staging: lustre: uapi: remove obd_ioctl_popdata() wrapper
Replace obd_ioctl_popdata() with direct copy_to_user() call. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401 Reviewed-on: https://review.whamcloud.com/24568 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Ben Evans <bevans@cray.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
bb44b987c8
commit
b03679f6a4
@ -209,7 +209,6 @@ static inline int obd_ioctl_is_invalid(struct obd_ioctl_data *data)
|
||||
}
|
||||
|
||||
int obd_ioctl_getdata(char **buf, int *len, void __user *arg);
|
||||
int obd_ioctl_popdata(void __user *arg, void *data, int len);
|
||||
|
||||
/*
|
||||
* OBD_IOC_DATA_TYPE is only for compatibility reasons with older
|
||||
|
@ -206,8 +206,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)
|
||||
memcpy(data->ioc_bulk, LUSTRE_VERSION_STRING,
|
||||
strlen(LUSTRE_VERSION_STRING) + 1);
|
||||
|
||||
err = obd_ioctl_popdata((void __user *)arg, data, len);
|
||||
if (err)
|
||||
if (copy_to_user((void __user *)arg, data, len))
|
||||
err = -EFAULT;
|
||||
goto out;
|
||||
|
||||
@ -225,9 +224,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)
|
||||
goto out;
|
||||
}
|
||||
|
||||
err = obd_ioctl_popdata((void __user *)arg, data,
|
||||
sizeof(*data));
|
||||
if (err)
|
||||
if (copy_to_user((void __user *)arg, data, sizeof(*data)))
|
||||
err = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
@ -263,8 +260,8 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)
|
||||
|
||||
CDEBUG(D_IOCTL, "device name %s, dev %d\n", data->ioc_inlbuf1,
|
||||
dev);
|
||||
err = obd_ioctl_popdata((void __user *)arg, data,
|
||||
sizeof(*data));
|
||||
|
||||
if (copy_to_user((void __user *)arg, data, sizeof(*data)))
|
||||
if (err)
|
||||
err = -EFAULT;
|
||||
goto out;
|
||||
@ -304,9 +301,9 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)
|
||||
(int)index, status, obd->obd_type->typ_name,
|
||||
obd->obd_name, obd->obd_uuid.uuid,
|
||||
atomic_read(&obd->obd_refcount));
|
||||
err = obd_ioctl_popdata((void __user *)arg, data, len);
|
||||
|
||||
err = 0;
|
||||
if (copy_to_user((void __user *)arg, data, len))
|
||||
err = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@ -361,8 +358,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
err = obd_ioctl_popdata((void __user *)arg, data, len);
|
||||
if (err)
|
||||
if (copy_to_user((void __user *)arg, data, len))
|
||||
err = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
|
@ -151,14 +151,6 @@ free_buf:
|
||||
}
|
||||
EXPORT_SYMBOL(obd_ioctl_getdata);
|
||||
|
||||
int obd_ioctl_popdata(void __user *arg, void *data, int len)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = copy_to_user(arg, data, len) ? -EFAULT : 0;
|
||||
return err;
|
||||
}
|
||||
|
||||
/* opening /dev/obd */
|
||||
static int obd_class_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user