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