summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2015-05-01 17:51:22 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-08 09:23:47 +0200
commit5a56474a51cee4aad56f6b2225ed5828e2dc3b84 (patch)
tree282aafb27d8e800661ecba526b637685fbc3dd07 /drivers/staging
parentfd5e2fd053e1042b12343fb6649449081ec1bab4 (diff)
downloadop-kernel-dev-5a56474a51cee4aad56f6b2225ed5828e2dc3b84.zip
op-kernel-dev-5a56474a51cee4aad56f6b2225ed5828e2dc3b84.tar.gz
staging: lustre: fid: 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')
-rw-r--r--drivers/staging/lustre/lustre/fid/fid_request.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c b/drivers/staging/lustre/lustre/fid/fid_request.c
index 063441a..7aee393 100644
--- a/drivers/staging/lustre/lustre/fid/fid_request.c
+++ b/drivers/staging/lustre/lustre/fid/fid_request.c
@@ -505,11 +505,11 @@ int client_fid_init(struct obd_device *obd,
char *prefix;
int rc;
- OBD_ALLOC_PTR(cli->cl_seq);
+ cli->cl_seq = kzalloc(sizeof(*cli->cl_seq), GFP_NOFS);
if (cli->cl_seq == NULL)
return -ENOMEM;
- OBD_ALLOC(prefix, MAX_OBD_NAME + 5);
+ prefix = kzalloc(MAX_OBD_NAME + 5, GFP_NOFS);
if (prefix == NULL) {
rc = -ENOMEM;
goto out_free_seq;
@@ -519,13 +519,13 @@ int client_fid_init(struct obd_device *obd,
/* Init client side sequence-manager */
rc = seq_client_init(cli->cl_seq, exp, type, prefix, NULL);
- OBD_FREE(prefix, MAX_OBD_NAME + 5);
+ kfree(prefix);
if (rc)
goto out_free_seq;
return rc;
out_free_seq:
- OBD_FREE_PTR(cli->cl_seq);
+ kfree(cli->cl_seq);
cli->cl_seq = NULL;
return rc;
}
@@ -537,7 +537,7 @@ int client_fid_fini(struct obd_device *obd)
if (cli->cl_seq != NULL) {
seq_client_fini(cli->cl_seq);
- OBD_FREE_PTR(cli->cl_seq);
+ kfree(cli->cl_seq);
cli->cl_seq = NULL;
}
OpenPOWER on IntegriCloud