diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2015-05-01 17:51:19 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-08 09:23:48 +0200 |
commit | 352f7891711e6d188999b32d8c151992984616ce (patch) | |
tree | a331e923d2d73c5f520bf42d367d82db43201dfc /drivers/staging/lustre/lustre/ldlm/ldlm_lib.c | |
parent | 00c40c169abdee57d81995588b6bc1970c1db3cb (diff) | |
download | op-kernel-dev-352f7891711e6d188999b32d8c151992984616ce.zip op-kernel-dev-352f7891711e6d188999b32d8c151992984616ce.tar.gz |
staging: lustre: ldlm: Use kzalloc and kfree
Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by
kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree.
A simplified version of the semantic patch that makes these changes is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@ 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>
Diffstat (limited to 'drivers/staging/lustre/lustre/ldlm/ldlm_lib.c')
-rw-r--r-- | drivers/staging/lustre/lustre/ldlm/ldlm_lib.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c index c5c86e7..d066771 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c @@ -73,7 +73,7 @@ static int import_set_conn(struct obd_import *imp, struct obd_uuid *uuid, } if (create) { - OBD_ALLOC(imp_conn, sizeof(*imp_conn)); + imp_conn = kzalloc(sizeof(*imp_conn), GFP_NOFS); if (!imp_conn) { rc = -ENOMEM; goto out_put; @@ -120,7 +120,7 @@ static int import_set_conn(struct obd_import *imp, struct obd_uuid *uuid, return 0; out_free: if (imp_conn) - OBD_FREE(imp_conn, sizeof(*imp_conn)); + kfree(imp_conn); out_put: ptlrpc_connection_put(ptlrpc_conn); return rc; @@ -179,7 +179,7 @@ int client_import_del_conn(struct obd_import *imp, struct obd_uuid *uuid) list_del(&imp_conn->oic_item); ptlrpc_connection_put(imp_conn->oic_conn); - OBD_FREE(imp_conn, sizeof(*imp_conn)); + kfree(imp_conn); CDEBUG(D_HA, "imp %p@%s: remove connection %s\n", imp, imp->imp_obd->obd_name, uuid->uuid); rc = 0; |