staging: lustre: uapi: remove obd_ioctl_freedata() wrapper

Replace obd_ioctl_freedata() with direct kvfree() 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:
James Simmons 2017-08-19 22:26:02 -04:00 committed by Greg Kroah-Hartman
parent d014786271
commit bb44b987c8
5 changed files with 9 additions and 16 deletions

View File

@ -211,11 +211,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_getdata(char **buf, int *len, void __user *arg);
int obd_ioctl_popdata(void __user *arg, void *data, int len); int obd_ioctl_popdata(void __user *arg, void *data, int len);
static inline void obd_ioctl_freedata(char *buf, size_t len)
{
kvfree(buf);
}
/* /*
* OBD_IOC_DATA_TYPE is only for compatibility reasons with older * OBD_IOC_DATA_TYPE is only for compatibility reasons with older
* Linux Lustre user tools. New ioctls should NOT use this macro as * Linux Lustre user tools. New ioctls should NOT use this macro as

View File

@ -1097,7 +1097,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
goto out_free; goto out_free;
} }
out_free: out_free:
obd_ioctl_freedata(buf, len); kvfree(buf);
return rc; return rc;
} }
case LL_IOC_LMV_SETSTRIPE: { case LL_IOC_LMV_SETSTRIPE: {
@ -1147,7 +1147,7 @@ out_free:
#endif #endif
rc = ll_dir_setdirstripe(inode, lum, filename, mode); rc = ll_dir_setdirstripe(inode, lum, filename, mode);
lmv_out_free: lmv_out_free:
obd_ioctl_freedata(buf, len); kvfree(buf);
return rc; return rc;
} }
case LL_IOC_LMV_SET_DEFAULT_STRIPE: { case LL_IOC_LMV_SET_DEFAULT_STRIPE: {
@ -1626,7 +1626,7 @@ out_quotactl:
rc = ll_migrate(inode, file, mdtidx, filename, namelen - 1); rc = ll_migrate(inode, file, mdtidx, filename, namelen - 1);
migrate_free: migrate_free:
obd_ioctl_freedata(buf, len); kvfree(buf);
return rc; return rc;
} }

View File

@ -2231,8 +2231,7 @@ int ll_obd_statfs(struct inode *inode, void __user *arg)
if (rc) if (rc)
goto out_statfs; goto out_statfs;
out_statfs: out_statfs:
if (buf) kvfree(buf);
obd_ioctl_freedata(buf, len);
return rc; return rc;
} }

View File

@ -1087,17 +1087,17 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
data = (struct obd_ioctl_data *)buf; data = (struct obd_ioctl_data *)buf;
if (sizeof(*desc) > data->ioc_inllen1) { if (sizeof(*desc) > data->ioc_inllen1) {
obd_ioctl_freedata(buf, len); kvfree(buf);
return -EINVAL; return -EINVAL;
} }
if (sizeof(uuidp->uuid) * count > data->ioc_inllen2) { if (sizeof(uuidp->uuid) * count > data->ioc_inllen2) {
obd_ioctl_freedata(buf, len); kvfree(buf);
return -EINVAL; return -EINVAL;
} }
if (sizeof(__u32) * count > data->ioc_inllen3) { if (sizeof(__u32) * count > data->ioc_inllen3) {
obd_ioctl_freedata(buf, len); kvfree(buf);
return -EINVAL; return -EINVAL;
} }
@ -1116,7 +1116,7 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
if (copy_to_user(uarg, buf, len)) if (copy_to_user(uarg, buf, len))
rc = -EFAULT; rc = -EFAULT;
obd_ioctl_freedata(buf, len); kvfree(buf);
break; break;
} }
case OBD_IOC_QUOTACTL: { case OBD_IOC_QUOTACTL: {

View File

@ -369,8 +369,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)
} }
out: out:
if (buf) kvfree(buf);
obd_ioctl_freedata(buf, len);
return err; return err;
} /* class_handle_ioctl */ } /* class_handle_ioctl */