Commit b03679f6 authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

staging: lustre: uapi: remove obd_ioctl_popdata() wrapper

Replace obd_ioctl_popdata() with direct copy_to_user() call.
Signed-off-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: https://review.whamcloud.com/24568Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarBen Evans <bevans@cray.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bb44b987
......@@ -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 @@ int obd_ioctl_getdata(char **buf, int *len, void __user *arg)
}
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)
{
......
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