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