Whamcloud - gitweb
LU-4257 obdclass: Get rid of cl_env hash table
[fs/lustre-release.git] / lustre / obdecho / echo_client.c
index c29bb65..ea82f26 100644 (file)
@@ -639,16 +639,10 @@ static void echo_thread_key_fini(const struct lu_context *ctx,
         OBD_SLAB_FREE_PTR(info, echo_thread_kmem);
 }
 
-static void echo_thread_key_exit(const struct lu_context *ctx,
-                         struct lu_context_key *key, void *data)
-{
-}
-
 static struct lu_context_key echo_thread_key = {
         .lct_tags = LCT_CL_THREAD,
         .lct_init = echo_thread_key_init,
         .lct_fini = echo_thread_key_fini,
-        .lct_exit = echo_thread_key_exit
 };
 
 static void *echo_session_key_init(const struct lu_context *ctx,
@@ -669,16 +663,10 @@ static void echo_session_key_fini(const struct lu_context *ctx,
         OBD_SLAB_FREE_PTR(session, echo_session_kmem);
 }
 
-static void echo_session_key_exit(const struct lu_context *ctx,
-                                 struct lu_context_key *key, void *data)
-{
-}
-
 static struct lu_context_key echo_session_key = {
         .lct_tags = LCT_SESSION,
         .lct_init = echo_session_key_init,
         .lct_fini = echo_session_key_fini,
-        .lct_exit = echo_session_key_exit
 };
 
 LU_TYPE_INIT_FINI(echo, &echo_thread_key, &echo_session_key);
@@ -1068,12 +1056,14 @@ static struct lu_device *echo_device_free(const struct lu_env *env,
        while (next && !ed->ed_next_ismd)
                next = next->ld_type->ldt_ops->ldto_device_free(env, next);
 
-        LASSERT(ed->ed_site == d->ld_site);
-        echo_site_fini(env, ed);
-        cl_device_fini(&ed->ed_cl);
-        OBD_FREE_PTR(ed);
+       LASSERT(ed->ed_site == d->ld_site);
+       echo_site_fini(env, ed);
+       cl_device_fini(&ed->ed_cl);
+       OBD_FREE_PTR(ed);
 
-        return NULL;
+       cl_env_cache_purge(~0);
+
+       return NULL;
 }
 
 static const struct lu_device_type_operations echo_device_type_ops = {