summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server.c
diff options
context:
space:
mode:
authorMilind Changire <mchangir@redhat.com>2017-10-19 11:49:42 +0530
committerJeff Darcy <jeff@pl.atyp.us>2017-11-06 16:46:33 +0000
commit6707eddaa5d7fdce16d39c19963911868a2c7fee (patch)
tree42bfa718a33a13007d967e4a70242afc7f986c1b /xlators/protocol/server/src/server.c
parented5e7b48f9255a57e0a691c102a207eb2445e8b7 (diff)
rpc: optimize fop program lookup
Ensure that the fop program is the first in the program list so that there's minimum amount of time spent to search the program for the most frequently needed use case. Change-Id: I45c3dcdbf39ec90ba39d914432d13a2ace00a5ee BUG: 1509647 Signed-off-by: Milind Changire <mchangir@redhat.com>
Diffstat (limited to 'xlators/protocol/server/src/server.c')
-rw-r--r--xlators/protocol/server/src/server.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
index 344046aabec..b408c10b0a0 100644
--- a/xlators/protocol/server/src/server.c
+++ b/xlators/protocol/server/src/server.c
@@ -1187,7 +1187,11 @@ init (xlator_t *this)
}
glusterfs3_3_fop_prog.options = this->options;
- ret = rpcsvc_program_register (conf->rpc, &glusterfs3_3_fop_prog);
+ /* make sure we register the fop prgram at the head to optimize
+ * lookup
+ */
+ ret = rpcsvc_program_register (conf->rpc, &glusterfs3_3_fop_prog,
+ _gf_true);
if (ret) {
gf_msg (this->name, GF_LOG_WARNING, 0, PS_MSG_PGM_REG_FAILED,
"registration of program (name:%s, prognum:%d, "
@@ -1198,7 +1202,8 @@ init (xlator_t *this)
}
gluster_handshake_prog.options = this->options;
- ret = rpcsvc_program_register (conf->rpc, &gluster_handshake_prog);
+ ret = rpcsvc_program_register (conf->rpc, &gluster_handshake_prog,
+ _gf_false);
if (ret) {
gf_msg (this->name, GF_LOG_WARNING, 0, PS_MSG_PGM_REG_FAILED,
"registration of program (name:%s, prognum:%d, "