|
|
a3470f |
From 9fc6e38ec39cfeb58d1b0fa0c2878c608d49f8e8 Mon Sep 17 00:00:00 2001
|
|
|
a3470f |
From: Milind Changire <mchangir@redhat.com>
|
|
|
a3470f |
Date: Mon, 21 May 2018 19:04:37 +0530
|
|
|
a3470f |
Subject: [PATCH 281/282] Revert "program/GF-DUMP: Shield ping processing from
|
|
|
a3470f |
traffic to Glusterfs"
|
|
|
a3470f |
|
|
|
a3470f |
This reverts commit 2e72b24707f1886833db0b09e48b3f48b8d68d37.
|
|
|
a3470f |
|
|
|
a3470f |
> Reviewed-on: https://review.gluster.org/17105
|
|
|
a3470f |
|
|
|
a3470f |
Change-Id: Iad5dc50d24f7ab2c8261d1d44afd04b67c24c96d
|
|
|
a3470f |
BUG: 1558989
|
|
|
a3470f |
Signed-off-by: Milind Changire <mchangir@redhat.com>
|
|
|
a3470f |
Reviewed-on: https://code.engineering.redhat.com/gerrit/139309
|
|
|
a3470f |
Reviewed-by: Raghavendra Gowdappa <rgowdapp@redhat.com>
|
|
|
a3470f |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
a3470f |
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
|
|
a3470f |
---
|
|
|
a3470f |
rpc/rpc-lib/src/rpcsvc.c | 89 +--------------------------
|
|
|
a3470f |
rpc/rpc-lib/src/rpcsvc.h | 17 +----
|
|
|
a3470f |
xlators/protocol/server/src/server-rpc-fops.c | 1 -
|
|
|
a3470f |
3 files changed, 3 insertions(+), 104 deletions(-)
|
|
|
a3470f |
|
|
|
a3470f |
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c
|
|
|
a3470f |
index 68e27ab..9938b8f 100644
|
|
|
a3470f |
--- a/rpc/rpc-lib/src/rpcsvc.c
|
|
|
a3470f |
+++ b/rpc/rpc-lib/src/rpcsvc.c
|
|
|
a3470f |
@@ -303,7 +303,6 @@ rpcsvc_program_actor (rpcsvc_request_t *req)
|
|
|
a3470f |
goto err;
|
|
|
a3470f |
}
|
|
|
a3470f |
|
|
|
a3470f |
- req->ownthread = program->ownthread;
|
|
|
a3470f |
req->synctask = program->synctask;
|
|
|
a3470f |
|
|
|
a3470f |
err = SUCCESS;
|
|
|
a3470f |
@@ -426,7 +425,6 @@ rpcsvc_request_init (rpcsvc_t *svc, rpc_transport_t *trans,
|
|
|
a3470f |
req->trans_private = msg->private;
|
|
|
a3470f |
|
|
|
a3470f |
INIT_LIST_HEAD (&req->txlist);
|
|
|
a3470f |
- INIT_LIST_HEAD (&req->request_list);
|
|
|
a3470f |
req->payloadsize = 0;
|
|
|
a3470f |
|
|
|
a3470f |
/* By this time, the data bytes for the auth scheme would have already
|
|
|
a3470f |
@@ -577,7 +575,7 @@ rpcsvc_handle_rpc_call (rpcsvc_t *svc, rpc_transport_t *trans,
|
|
|
a3470f |
rpcsvc_request_t *req = NULL;
|
|
|
a3470f |
int ret = -1;
|
|
|
a3470f |
uint16_t port = 0;
|
|
|
a3470f |
- gf_boolean_t is_unix = _gf_false, empty = _gf_false;
|
|
|
a3470f |
+ gf_boolean_t is_unix = _gf_false;
|
|
|
a3470f |
gf_boolean_t unprivileged = _gf_false;
|
|
|
a3470f |
drc_cached_op_t *reply = NULL;
|
|
|
a3470f |
rpcsvc_drc_globals_t *drc = NULL;
|
|
|
a3470f |
@@ -693,20 +691,6 @@ rpcsvc_handle_rpc_call (rpcsvc_t *svc, rpc_transport_t *trans,
|
|
|
a3470f |
(synctask_fn_t) actor_fn,
|
|
|
a3470f |
rpcsvc_check_and_reply_error, NULL,
|
|
|
a3470f |
req);
|
|
|
a3470f |
- } else if (req->ownthread) {
|
|
|
a3470f |
- pthread_mutex_lock (&req->prog->queue_lock);
|
|
|
a3470f |
- {
|
|
|
a3470f |
- empty = list_empty (&req->prog->request_queue);
|
|
|
a3470f |
-
|
|
|
a3470f |
- list_add_tail (&req->request_list,
|
|
|
a3470f |
- &req->prog->request_queue);
|
|
|
a3470f |
-
|
|
|
a3470f |
- if (empty)
|
|
|
a3470f |
- pthread_cond_signal (&req->prog->queue_cond);
|
|
|
a3470f |
- }
|
|
|
a3470f |
- pthread_mutex_unlock (&req->prog->queue_lock);
|
|
|
a3470f |
-
|
|
|
a3470f |
- ret = 0;
|
|
|
a3470f |
} else {
|
|
|
a3470f |
ret = actor_fn (req);
|
|
|
a3470f |
}
|
|
|
a3470f |
@@ -1586,12 +1570,6 @@ rpcsvc_program_unregister (rpcsvc_t *svc, rpcsvc_program_t *program)
|
|
|
a3470f |
" Ver: %d, Port: %d", prog->progname, prog->prognum,
|
|
|
a3470f |
prog->progver, prog->progport);
|
|
|
a3470f |
|
|
|
a3470f |
- if (prog->ownthread) {
|
|
|
a3470f |
- prog->alive = _gf_false;
|
|
|
a3470f |
- ret = 0;
|
|
|
a3470f |
- goto out;
|
|
|
a3470f |
- }
|
|
|
a3470f |
-
|
|
|
a3470f |
pthread_mutex_lock (&svc->rpclock);
|
|
|
a3470f |
{
|
|
|
a3470f |
list_del_init (&prog->program);
|
|
|
a3470f |
@@ -1856,56 +1834,6 @@ out:
|
|
|
a3470f |
return ret;
|
|
|
a3470f |
}
|
|
|
a3470f |
|
|
|
a3470f |
-void *
|
|
|
a3470f |
-rpcsvc_request_handler (void *arg)
|
|
|
a3470f |
-{
|
|
|
a3470f |
- rpcsvc_program_t *program = arg;
|
|
|
a3470f |
- rpcsvc_request_t *req = NULL;
|
|
|
a3470f |
- rpcsvc_actor_t *actor = NULL;
|
|
|
a3470f |
- gf_boolean_t done = _gf_false;
|
|
|
a3470f |
- int ret = 0;
|
|
|
a3470f |
-
|
|
|
a3470f |
- if (!program)
|
|
|
a3470f |
- return NULL;
|
|
|
a3470f |
-
|
|
|
a3470f |
- while (1) {
|
|
|
a3470f |
- pthread_mutex_lock (&program->queue_lock);
|
|
|
a3470f |
- {
|
|
|
a3470f |
- if (!program->alive
|
|
|
a3470f |
- && list_empty (&program->request_queue)) {
|
|
|
a3470f |
- done = 1;
|
|
|
a3470f |
- goto unlock;
|
|
|
a3470f |
- }
|
|
|
a3470f |
-
|
|
|
a3470f |
- while (list_empty (&program->request_queue))
|
|
|
a3470f |
- pthread_cond_wait (&program->queue_cond,
|
|
|
a3470f |
- &program->queue_lock);
|
|
|
a3470f |
-
|
|
|
a3470f |
- req = list_entry (program->request_queue.next,
|
|
|
a3470f |
- typeof (*req), request_list);
|
|
|
a3470f |
-
|
|
|
a3470f |
- list_del_init (&req->request_list);
|
|
|
a3470f |
- }
|
|
|
a3470f |
- unlock:
|
|
|
a3470f |
- pthread_mutex_unlock (&program->queue_lock);
|
|
|
a3470f |
-
|
|
|
a3470f |
- if (done)
|
|
|
a3470f |
- break;
|
|
|
a3470f |
-
|
|
|
a3470f |
- THIS = req->svc->xl;
|
|
|
a3470f |
-
|
|
|
a3470f |
- actor = rpcsvc_program_actor (req);
|
|
|
a3470f |
-
|
|
|
a3470f |
- ret = actor->actor (req);
|
|
|
a3470f |
-
|
|
|
a3470f |
- if (ret != 0) {
|
|
|
a3470f |
- rpcsvc_check_and_reply_error (ret, NULL, req);
|
|
|
a3470f |
- }
|
|
|
a3470f |
- }
|
|
|
a3470f |
-
|
|
|
a3470f |
- return NULL;
|
|
|
a3470f |
-}
|
|
|
a3470f |
-
|
|
|
a3470f |
int
|
|
|
a3470f |
rpcsvc_program_register (rpcsvc_t *svc, rpcsvc_program_t *program)
|
|
|
a3470f |
{
|
|
|
a3470f |
@@ -1946,21 +1874,6 @@ rpcsvc_program_register (rpcsvc_t *svc, rpcsvc_program_t *program)
|
|
|
a3470f |
memcpy (newprog, program, sizeof (*program));
|
|
|
a3470f |
|
|
|
a3470f |
INIT_LIST_HEAD (&newprog->program);
|
|
|
a3470f |
- INIT_LIST_HEAD (&newprog->request_queue);
|
|
|
a3470f |
- pthread_mutex_init (&newprog->queue_lock, NULL);
|
|
|
a3470f |
- pthread_cond_init (&newprog->queue_cond, NULL);
|
|
|
a3470f |
-
|
|
|
a3470f |
- newprog->alive = _gf_true;
|
|
|
a3470f |
-
|
|
|
a3470f |
- /* make sure synctask gets priority over ownthread */
|
|
|
a3470f |
- if (newprog->synctask)
|
|
|
a3470f |
- newprog->ownthread = _gf_false;
|
|
|
a3470f |
-
|
|
|
a3470f |
- if (newprog->ownthread) {
|
|
|
a3470f |
- gf_thread_create (&newprog->thread, NULL,
|
|
|
a3470f |
- rpcsvc_request_handler,
|
|
|
a3470f |
- newprog, "rpcsvcrh");
|
|
|
a3470f |
- }
|
|
|
a3470f |
|
|
|
a3470f |
pthread_mutex_lock (&svc->rpclock);
|
|
|
a3470f |
{
|
|
|
a3470f |
diff --git a/rpc/rpc-lib/src/rpcsvc.h b/rpc/rpc-lib/src/rpcsvc.h
|
|
|
a3470f |
index 73507b6..34429b4 100644
|
|
|
a3470f |
--- a/rpc/rpc-lib/src/rpcsvc.h
|
|
|
a3470f |
+++ b/rpc/rpc-lib/src/rpcsvc.h
|
|
|
a3470f |
@@ -233,9 +233,7 @@ struct rpcsvc_request {
|
|
|
a3470f |
*/
|
|
|
a3470f |
rpcsvc_auth_data_t verf;
|
|
|
a3470f |
|
|
|
a3470f |
- /* Execute this request's actor function in ownthread of program?*/
|
|
|
a3470f |
- gf_boolean_t ownthread;
|
|
|
a3470f |
-
|
|
|
a3470f |
+ /* Execute this request's actor function as a synctask?*/
|
|
|
a3470f |
gf_boolean_t synctask;
|
|
|
a3470f |
/* Container for a RPC program wanting to store a temp
|
|
|
a3470f |
* request-specific item.
|
|
|
a3470f |
@@ -247,9 +245,6 @@ struct rpcsvc_request {
|
|
|
a3470f |
|
|
|
a3470f |
/* pointer to cached reply for use in DRC */
|
|
|
a3470f |
drc_cached_op_t *reply;
|
|
|
a3470f |
-
|
|
|
a3470f |
- /* request queue in rpcsvc */
|
|
|
a3470f |
- struct list_head request_list;
|
|
|
a3470f |
};
|
|
|
a3470f |
|
|
|
a3470f |
#define rpcsvc_request_program(req) ((rpcsvc_program_t *)((req)->prog))
|
|
|
a3470f |
@@ -400,18 +395,10 @@ struct rpcsvc_program {
|
|
|
a3470f |
*/
|
|
|
a3470f |
int min_auth;
|
|
|
a3470f |
|
|
|
a3470f |
- /* Execute actor function in program's own thread? This will reduce */
|
|
|
a3470f |
- /* the workload on poller threads */
|
|
|
a3470f |
- gf_boolean_t ownthread;
|
|
|
a3470f |
- gf_boolean_t alive;
|
|
|
a3470f |
-
|
|
|
a3470f |
+ /* Execute actor function as a synctask? */
|
|
|
a3470f |
gf_boolean_t synctask;
|
|
|
a3470f |
/* list member to link to list of registered services with rpcsvc */
|
|
|
a3470f |
struct list_head program;
|
|
|
a3470f |
- struct list_head request_queue;
|
|
|
a3470f |
- pthread_mutex_t queue_lock;
|
|
|
a3470f |
- pthread_cond_t queue_cond;
|
|
|
a3470f |
- pthread_t thread;
|
|
|
a3470f |
};
|
|
|
a3470f |
|
|
|
a3470f |
typedef struct rpcsvc_cbk_program {
|
|
|
a3470f |
diff --git a/xlators/protocol/server/src/server-rpc-fops.c b/xlators/protocol/server/src/server-rpc-fops.c
|
|
|
a3470f |
index 91d5c03..0bf41d8 100644
|
|
|
a3470f |
--- a/xlators/protocol/server/src/server-rpc-fops.c
|
|
|
a3470f |
+++ b/xlators/protocol/server/src/server-rpc-fops.c
|
|
|
a3470f |
@@ -6160,5 +6160,4 @@ struct rpcsvc_program glusterfs3_3_fop_prog = {
|
|
|
a3470f |
.progver = GLUSTER_FOP_VERSION,
|
|
|
a3470f |
.numactors = GLUSTER_FOP_PROCCNT,
|
|
|
a3470f |
.actors = glusterfs3_3_fop_actors,
|
|
|
a3470f |
- .ownthread = _gf_true,
|
|
|
a3470f |
};
|
|
|
a3470f |
--
|
|
|
a3470f |
1.8.3.1
|
|
|
a3470f |
|