staging: lustre: drop uses of some OBD alloc and free functions
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sun, 12 Apr 2015 21:34:20 +0000 (23:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Apr 2015 14:24:04 +0000 (16:24 +0200)
commit840c94d574a8bb5fb03cad0b5aa1bd0e2984b01a
treee8f542881e2fdb4c4f3d1b619e9eb7a28b05dfc1
parent97903a26fcfc84b93a9cdb09d649c1b748383c24
staging: lustre: drop uses of some OBD alloc and free functions

Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by
kzalloc or calloc, as appropriate.

Replace OBD_FREE and OBD_FREE_PTR by kfree.

A simplified version of the semantic patch that makes these changes in the
OBD_ALLOC/FREE case is as follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression ptr,e1,e2;
@@
- OBD_ALLOC(ptr,sizeof e1 * e2)
+ ptr = kcalloc(e2, sizeof e1, GFP_NOFS)

@@
expression ptr,size;
@@
- OBD_ALLOC(ptr,size)
+ ptr = kzalloc(size, GFP_NOFS)

@@
expression ptr, size;
@@
- OBD_FREE(ptr, size);
+ kfree(ptr);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/lov/lov_dev.c
drivers/staging/lustre/lustre/lov/lov_io.c
drivers/staging/lustre/lustre/lov/lov_obd.c
drivers/staging/lustre/lustre/lov/lov_pool.c
drivers/staging/lustre/lustre/lov/lov_request.c
drivers/staging/lustre/lustre/lov/lovsub_dev.c