Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6b0e43db authored by Julia Lawall's avatar Julia Lawall Committed by Greg Kroah-Hartman
Browse files

lustre: obdclass: linux: Replace uses of OBD_{ALLOC, FREE}_LARGE

Replace uses of OBD_ALLOC_LARGE by libcfs_kvzalloc and OBD_FREE_LARGE by
kvfree.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/

)

// <smpl>
@@
expression ptr,size;
@@

- OBD_ALLOC_LARGE(ptr,size)
+ ptr = libcfs_kvzalloc(size, GFP_NOFS)

@@
expression ptr,size;
@@

- OBD_FREE_LARGE(ptr, size);
+ kvfree(ptr);
// </smpl>

Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fea2e68e
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -107,7 +107,7 @@ int obd_ioctl_getdata(char **buf, int *len, void *arg)
	 * system, the high lock contention will hurt performance badly,
	 * system, the high lock contention will hurt performance badly,
	 * obdfilter-survey is an example, which relies on ioctl. So we'd
	 * obdfilter-survey is an example, which relies on ioctl. So we'd
	 * better avoid vmalloc on ioctl path. LU-66 */
	 * better avoid vmalloc on ioctl path. LU-66 */
	OBD_ALLOC_LARGE(*buf, hdr.ioc_len);
	*buf = libcfs_kvzalloc(hdr.ioc_len, GFP_NOFS);
	if (*buf == NULL) {
	if (*buf == NULL) {
		CERROR("Cannot allocate control buffer of len %d\n",
		CERROR("Cannot allocate control buffer of len %d\n",
		       hdr.ioc_len);
		       hdr.ioc_len);
@@ -153,7 +153,7 @@ int obd_ioctl_getdata(char **buf, int *len, void *arg)
	return 0;
	return 0;


free_buf:
free_buf:
	OBD_FREE_LARGE(*buf, hdr.ioc_len);
	kvfree(*buf);
	return err;
	return err;
}
}
EXPORT_SYMBOL(obd_ioctl_getdata);
EXPORT_SYMBOL(obd_ioctl_getdata);