summaryrefslogtreecommitdiff
path: root/drivers/staging/lustre/lnet/libcfs
diff options
context:
space:
mode:
authorParinay Kondekar <parinay.kondekar@seagate.com>2016-03-22 23:04:07 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-28 14:30:36 (GMT)
commitae272a48a16b53f77215749a68777c6c89ec9925 (patch)
tree2fd4e26d6018eeb1ca2c9be1b86237df6cdf9c9d /drivers/staging/lustre/lnet/libcfs
parent4678d183caf1b8a68860ca07fad95d9c6de14cc3 (diff)
downloadlinux-ae272a48a16b53f77215749a68777c6c89ec9925.tar.xz
staging:lustre: call libcfs_ioctl directly
No reason to go through the cfs_psdev_ops abstract to call libcfs_ioctl. Just call libcfs_ioctl directly. Signed-off-by: Parinay Kondekar <parinay.kondekar@seagate.com> Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844 Reviewed-on: http://review.whamcloud.com/17492 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lnet/libcfs')
-rw-r--r--drivers/staging/lustre/lnet/libcfs/linux/linux-module.c13
-rw-r--r--drivers/staging/lustre/lnet/libcfs/module.c5
2 files changed, 6 insertions, 12 deletions
diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c
index 633d76b..6f35a80 100644
--- a/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c
+++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-module.c
@@ -95,11 +95,10 @@ int libcfs_ioctl_getdata(struct libcfs_ioctl_hdr **hdr_pp,
return err;
}
-static long libcfs_ioctl(struct file *file,
- unsigned int cmd, unsigned long arg)
+static long
+libcfs_psdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
struct cfs_psdev_file pfile;
- int rc = 0;
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
@@ -112,16 +111,12 @@ static long libcfs_ioctl(struct file *file,
return -EINVAL;
}
- if (libcfs_psdev_ops.p_ioctl)
- rc = libcfs_psdev_ops.p_ioctl(&pfile, cmd, (void __user *)arg);
- else
- rc = -EPERM;
- return rc;
+ return libcfs_ioctl(&pfile, cmd, (void __user *)arg);
}
static const struct file_operations libcfs_fops = {
.owner = THIS_MODULE,
- .unlocked_ioctl = libcfs_ioctl,
+ .unlocked_ioctl = libcfs_psdev_ioctl,
};
struct miscdevice libcfs_dev = {
diff --git a/drivers/staging/lustre/lnet/libcfs/module.c b/drivers/staging/lustre/lnet/libcfs/module.c
index 4d38aaf..4af4557 100644
--- a/drivers/staging/lustre/lnet/libcfs/module.c
+++ b/drivers/staging/lustre/lnet/libcfs/module.c
@@ -98,8 +98,8 @@ int libcfs_deregister_ioctl(struct libcfs_ioctl_handler *hand)
}
EXPORT_SYMBOL(libcfs_deregister_ioctl);
-static int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd,
- void __user *uparam)
+int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd,
+ void __user *uparam)
{
struct libcfs_ioctl_data *data = NULL;
struct libcfs_ioctl_hdr *hdr;
@@ -168,7 +168,6 @@ out:
struct cfs_psdev_ops libcfs_psdev_ops = {
NULL,
NULL,
- libcfs_ioctl
};
int lprocfs_call_handler(void *data, int write, loff_t *ppos,