aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/lustre/lustre/ldlm/ldlm_lib.c')
-rw-r--r--drivers/staging/lustre/lustre/ldlm/ldlm_lib.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
index c5c86e73ca52..764f98684d74 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;
@@ -119,8 +119,7 @@ static int import_set_conn(struct obd_import *imp, struct obd_uuid *uuid,
spin_unlock(&imp->imp_lock);
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 +178,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;
@@ -668,10 +667,9 @@ int target_send_reply_msg(struct ptlrpc_request *req, int rc, int fail_id)
DEBUG_REQ(D_NET, req, "processing error (%d)", rc);
req->rq_status = rc;
return ptlrpc_send_error(req, 1);
- } else {
- DEBUG_REQ(D_NET, req, "sending reply");
}
+ DEBUG_REQ(D_NET, req, "sending reply");
return ptlrpc_send_reply(req, PTLRPC_REPLY_MAYBE_DIFFICULT);
}