summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-lib/src/rpc-clnt.c
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2018-11-08 07:50:48 +0200
committerAmar Tumballi <amarts@redhat.com>2018-11-12 03:25:02 +0000
commite134ef2493e8517a6f341416c11230c2bb5bcd6c (patch)
treefefc23b571bef6521f2d0eb14e840ea447c79ec3 /rpc/rpc-lib/src/rpc-clnt.c
parentcac2dba48bf8029b2b0421850fcc4598e33569f6 (diff)
rpc-clnt*: several code changes to reduce conn lock times
Assorted code refactoring to reduce lock contention. Also, took the opportunity to reorder structs more properly. Removed dead code. Hopefully, no functional changes. Compile-tested only! updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I5de6124ad071fd5e2c31832364d602b5f6d6fe28
Diffstat (limited to 'rpc/rpc-lib/src/rpc-clnt.c')
-rw-r--r--rpc/rpc-lib/src/rpc-clnt.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c
index 9b8e79070ec..56bde4ed8ab 100644
--- a/rpc/rpc-lib/src/rpc-clnt.c
+++ b/rpc/rpc-lib/src/rpc-clnt.c
@@ -67,13 +67,13 @@ __saved_frames_put(struct saved_frames *frames, void *frame,
}
/* THIS should be saved and set back */
- memset(saved_frame, 0, sizeof(*saved_frame));
INIT_LIST_HEAD(&saved_frame->list);
saved_frame->capital_this = THIS;
saved_frame->frame = frame;
saved_frame->rpcreq = rpcreq;
gettimeofday(&saved_frame->saved_at, NULL);
+ memset(&saved_frame->rsp, 0, sizeof(rpc_transport_rsp_t));
if (_is_lock_fop(saved_frame))
list_add_tail(&saved_frame->list, &frames->lk_sf.list);
@@ -780,8 +780,7 @@ is_rpc_clnt_disconnected(rpc_clnt_connection_t *conn)
pthread_mutex_lock(&conn->lock);
{
- if (conn->disconnected == _gf_false)
- disconnected = _gf_false;
+ disconnected = conn->disconnected;
}
pthread_mutex_unlock(&conn->lock);
@@ -1849,28 +1848,6 @@ rpc_clnt_unref(struct rpc_clnt *rpc)
return rpc;
}
-char
-rpc_clnt_is_disabled(struct rpc_clnt *rpc)
-{
- rpc_clnt_connection_t *conn = NULL;
- char disabled = 0;
-
- if (!rpc) {
- goto out;
- }
-
- conn = &rpc->conn;
-
- pthread_mutex_lock(&conn->lock);
- {
- disabled = rpc->disabled;
- }
- pthread_mutex_unlock(&conn->lock);
-
-out:
- return disabled;
-}
-
void
rpc_clnt_disable(struct rpc_clnt *rpc)
{