From 6707eddaa5d7fdce16d39c19963911868a2c7fee Mon Sep 17 00:00:00 2001 From: Milind Changire Date: Thu, 19 Oct 2017 11:49:42 +0530 Subject: 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 --- xlators/features/changelog/src/changelog-rpc-common.c | 2 +- xlators/features/quota/src/quotad-aggregator.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'xlators/features') diff --git a/xlators/features/changelog/src/changelog-rpc-common.c b/xlators/features/changelog/src/changelog-rpc-common.c index 08cd41e4f17..7bd5b688fa5 100644 --- a/xlators/features/changelog/src/changelog-rpc-common.c +++ b/xlators/features/changelog/src/changelog-rpc-common.c @@ -324,7 +324,7 @@ changelog_rpc_server_init (xlator_t *this, char *sockfile, void *cbkdata, while (*progs) { prog = *progs; - ret = rpcsvc_program_register (rpc, prog); + ret = rpcsvc_program_register (rpc, prog, _gf_false); if (ret) { gf_msg (this->name, GF_LOG_ERROR, 0, CHANGELOG_MSG_PROGRAM_NAME_REG_FAILED, diff --git a/xlators/features/quota/src/quotad-aggregator.c b/xlators/features/quota/src/quotad-aggregator.c index 428153fa2bd..c27b67136a3 100644 --- a/xlators/features/quota/src/quotad-aggregator.c +++ b/xlators/features/quota/src/quotad-aggregator.c @@ -416,7 +416,8 @@ quotad_aggregator_init (xlator_t *this) priv->quotad_aggregator = "ad_aggregator_prog; quotad_aggregator_prog.options = this->options; - ret = rpcsvc_program_register (priv->rpcsvc, "ad_aggregator_prog); + ret = rpcsvc_program_register (priv->rpcsvc, "ad_aggregator_prog, + _gf_false); if (ret) { gf_msg (this->name, GF_LOG_WARNING, 0, Q_MSG_RPCSVC_REGISTER_FAILED, -- cgit