/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2012, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
srpc_send_rpc (swi_workitem_t *wi)
{
int rc = 0;
- srpc_client_rpc_t *rpc = wi->swi_workitem.wi_data;
- srpc_msg_t *reply = &rpc->crpc_replymsg;
- int do_bulk = rpc->crpc_bulk.bk_niov > 0;
+ srpc_client_rpc_t *rpc;
+ srpc_msg_t *reply;
+ int do_bulk;
+
+ LASSERT(wi != NULL);
+
+ rpc = wi->swi_workitem.wi_data;
LASSERT (rpc != NULL);
LASSERT (wi == &rpc->crpc_wi);
+ reply = &rpc->crpc_replymsg;
+ do_bulk = rpc->crpc_bulk.bk_niov > 0;
+
spin_lock(&rpc->crpc_lock);
if (rpc->crpc_aborted) {