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