staging: lustre: uapi: remove obd_ioctl_freedata() wrapper
authorJames Simmons <jsimmons@infradead.org>
Sun, 20 Aug 2017 02:26:02 +0000 (22:26 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Aug 2017 01:36:47 +0000 (18:36 -0700)
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>
drivers/staging/lustre/lustre/include/lustre/lustre_ioctl.h
drivers/staging/lustre/lustre/llite/dir.c
drivers/staging/lustre/lustre/llite/llite_lib.c
drivers/staging/lustre/lustre/lov/lov_obd.c
drivers/staging/lustre/lustre/obdclass/class_obd.c

index 84654affa617c0452b846f527dec97b9cac94974..7a61a0084d5f95e231ec90d2c330e41755bdf510 100644 (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_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
  * Linux Lustre user tools. New ioctls should NOT use this macro as
index 03a72c07f57c4fa71990db78f354c00b9a5b0864..dd592d9d773a129d31958f4352ee4345dd028e15 100644 (file)
@@ -1097,7 +1097,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                        goto out_free;
                }
 out_free:
-               obd_ioctl_freedata(buf, len);
+               kvfree(buf);
                return rc;
        }
        case LL_IOC_LMV_SETSTRIPE: {
@@ -1147,7 +1147,7 @@ out_free:
 #endif
                rc = ll_dir_setdirstripe(inode, lum, filename, mode);
 lmv_out_free:
-               obd_ioctl_freedata(buf, len);
+               kvfree(buf);
                return rc;
        }
        case LL_IOC_LMV_SET_DEFAULT_STRIPE: {
@@ -1626,7 +1626,7 @@ out_quotactl:
 
                rc = ll_migrate(inode, file, mdtidx, filename, namelen - 1);
 migrate_free:
-               obd_ioctl_freedata(buf, len);
+               kvfree(buf);
 
                return rc;
        }
index 5c8405c71e4b2123ec1ed0c400244a1e1788077b..451e4faa24e293e5fabb33a61a2114bb17fb9fac 100644 (file)
@@ -2231,8 +2231,7 @@ int ll_obd_statfs(struct inode *inode, void __user *arg)
        if (rc)
                goto out_statfs;
 out_statfs:
-       if (buf)
-               obd_ioctl_freedata(buf, len);
+       kvfree(buf);
        return rc;
 }
 
index f27b11fdee3f33c1d057c74606d7a208963a0ab1..88716246abb90f748b211879af130f7e9795486a 100644 (file)
@@ -1087,17 +1087,17 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
                data = (struct obd_ioctl_data *)buf;
 
                if (sizeof(*desc) > data->ioc_inllen1) {
-                       obd_ioctl_freedata(buf, len);
+                       kvfree(buf);
                        return -EINVAL;
                }
 
                if (sizeof(uuidp->uuid) * count > data->ioc_inllen2) {
-                       obd_ioctl_freedata(buf, len);
+                       kvfree(buf);
                        return -EINVAL;
                }
 
                if (sizeof(__u32) * count > data->ioc_inllen3) {
-                       obd_ioctl_freedata(buf, len);
+                       kvfree(buf);
                        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))
                        rc = -EFAULT;
-               obd_ioctl_freedata(buf, len);
+               kvfree(buf);
                break;
        }
        case OBD_IOC_QUOTACTL: {
index 76e1ee83a723c64cf2b47ac5849f188adf18e611..8cc1fdcfcf777d97aa21a007ee48bb5d26f33d52 100644 (file)
@@ -369,8 +369,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)
        }
 
  out:
-       if (buf)
-               obd_ioctl_freedata(buf, len);
+       kvfree(buf);
        return err;
 } /* class_handle_ioctl */