50dc83
From 1864a4f382f3031915e8126440a1561035487e49 Mon Sep 17 00:00:00 2001
50dc83
From: Mohammed Rafi KC <rkavunga@redhat.com>
50dc83
Date: Thu, 11 Jul 2019 12:53:20 +0530
50dc83
Subject: [PATCH 249/255] Revert "client/fini: return fini after rpc cleanup"
50dc83
50dc83
This reverts commit d79cb2cdff6fe8d962c9ac095a7541ddf500302b.
50dc83
50dc83
BUG: 1471742
50dc83
Change-Id: I15e6544d47fb7b6002c3b44de3fe0b2a13c84f51
50dc83
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
50dc83
Reviewed-on: https://code.engineering.redhat.com/gerrit/175958
50dc83
Tested-by: RHGS Build Bot <nigelb@redhat.com>
50dc83
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
50dc83
---
50dc83
 xlators/protocol/client/src/client.c | 25 +++++--------------------
50dc83
 xlators/protocol/client/src/client.h |  6 ------
50dc83
 2 files changed, 5 insertions(+), 26 deletions(-)
50dc83
50dc83
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
50dc83
index 95e4be5..532ef35 100644
50dc83
--- a/xlators/protocol/client/src/client.c
50dc83
+++ b/xlators/protocol/client/src/client.c
50dc83
@@ -49,12 +49,11 @@ client_fini_complete(xlator_t *this)
50dc83
     if (!conf->destroy)
50dc83
         return 0;
50dc83
 
50dc83
-    pthread_mutex_lock(&conf->lock);
50dc83
-    {
50dc83
-        conf->fini_completed = _gf_true;
50dc83
-        pthread_cond_broadcast(&conf->fini_complete_cond);
50dc83
-    }
50dc83
-    pthread_mutex_unlock(&conf->lock);
50dc83
+    this->private = NULL;
50dc83
+
50dc83
+    pthread_spin_destroy(&conf->fd_lock);
50dc83
+    pthread_mutex_destroy(&conf->lock);
50dc83
+    GF_FREE(conf);
50dc83
 
50dc83
 out:
50dc83
     return 0;
50dc83
@@ -2730,7 +2729,6 @@ init(xlator_t *this)
50dc83
         goto out;
50dc83
 
50dc83
     pthread_mutex_init(&conf->lock, NULL);
50dc83
-    pthread_cond_init(&conf->fini_complete_cond, NULL);
50dc83
     pthread_spin_init(&conf->fd_lock, 0);
50dc83
     INIT_LIST_HEAD(&conf->saved_fds);
50dc83
 
50dc83
@@ -2789,7 +2787,6 @@ fini(xlator_t *this)
50dc83
     if (!conf)
50dc83
         return;
50dc83
 
50dc83
-    conf->fini_completed = _gf_false;
50dc83
     conf->destroy = 1;
50dc83
     if (conf->rpc) {
50dc83
         /* cleanup the saved-frames before last unref */
50dc83
@@ -2797,18 +2794,6 @@ fini(xlator_t *this)
50dc83
         rpc_clnt_unref(conf->rpc);
50dc83
     }
50dc83
 
50dc83
-    pthread_mutex_lock(&conf->lock);
50dc83
-    {
50dc83
-        while (!conf->fini_completed)
50dc83
-            pthread_cond_wait(&conf->fini_complete_cond, &conf->lock);
50dc83
-    }
50dc83
-    pthread_mutex_unlock(&conf->lock);
50dc83
-
50dc83
-    pthread_spin_destroy(&conf->fd_lock);
50dc83
-    pthread_mutex_destroy(&conf->lock);
50dc83
-    pthread_cond_destroy(&conf->fini_complete_cond);
50dc83
-    GF_FREE(conf);
50dc83
-
50dc83
     /* Saved Fds */
50dc83
     /* TODO: */
50dc83
 
50dc83
diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h
50dc83
index 8dcd72f..f12fa61 100644
50dc83
--- a/xlators/protocol/client/src/client.h
50dc83
+++ b/xlators/protocol/client/src/client.h
50dc83
@@ -235,12 +235,6 @@ typedef struct clnt_conf {
50dc83
                                       * up, disconnects can be
50dc83
                                       * logged
50dc83
                                       */
50dc83
-
50dc83
-    gf_boolean_t old_protocol;         /* used only for old-protocol testing */
50dc83
-    pthread_cond_t fini_complete_cond; /* Used to wait till we finsh the fini
50dc83
-                                          compltely, ie client_fini_complete
50dc83
-                                          to return*/
50dc83
-    gf_boolean_t fini_completed;
50dc83
 } clnt_conf_t;
50dc83
 
50dc83
 typedef struct _client_fd_ctx {
50dc83
-- 
50dc83
1.8.3.1
50dc83