Whamcloud - gitweb
LU-11445 obd: remove portals handle from OBD import 50/33250/4
authorJohn L. Hammond <jhammond@whamcloud.com>
Fri, 28 Sep 2018 15:56:29 +0000 (10:56 -0500)
committerOleg Drokin <green@whamcloud.com>
Sat, 10 Nov 2018 05:22:59 +0000 (05:22 +0000)
OBD imports are never looked up using the portals handle (imp_handle)
they contain, so remove it. Also remove the unused functions
class_conn2obd() and class_conn2cliimp().

Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Change-Id: Ib05f91f6dabbd4249769560d443ba69819fc1157
Reviewed-on: https://review.whamcloud.com/33250
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_export.h
lustre/include/lustre_import.h
lustre/include/obd_class.h
lustre/obdclass/genops.c

index 5ead593..33b9aed 100644 (file)
@@ -456,7 +456,6 @@ static inline int exp_connect_lock_convert(struct obd_export *exp)
 }
 
 extern struct obd_export *class_conn2export(struct lustre_handle *conn);
-extern struct obd_device *class_conn2obd(struct lustre_handle *conn);
 
 #define KKUC_CT_DATA_MAGIC     0x092013cea
 struct kkuc_ct_data {
index 9ba6a87..8f52c66 100644 (file)
  *
  * @{
  */
+#include <linux/atomic.h>
+#include <linux/list.h>
+#include <linux/mutex.h>
+#include <linux/spinlock.h>
+#include <linux/time.h>
+#include <linux/types.h>
 #include <linux/workqueue.h>
-
-#include <lustre_handles.h>
+#include <libcfs/libcfs.h>
 #include <uapi/linux/lustre/lustre_idl.h>
 
 /**
@@ -159,8 +164,6 @@ struct import_state_hist {
  * Imports are representing client-side view to remote target.
  */
 struct obd_import {
-       /** Local handle (== id) for this import. */
-       struct portals_handle     imp_handle;
        /** Reference counter */
        atomic_t                  imp_refcount;
        struct lustre_handle      imp_dlm_handle; /* client's ldlm export */
@@ -380,7 +383,6 @@ extern unsigned int at_max;
 /* genops.c */
 struct obd_export;
 extern struct obd_import *class_exp2cliimp(struct obd_export *);
-extern struct obd_import *class_conn2cliimp(struct lustre_handle *);
 
 /** @} import */
 
index ed410a0..1cf3a7a 100644 (file)
@@ -52,7 +52,6 @@
 extern rwlock_t obd_dev_lock;
 
 /* OBD Operations Declarations */
-extern struct obd_device *class_conn2obd(struct lustre_handle *);
 extern struct obd_device *class_exp2obd(struct obd_export *);
 extern int class_handle_ioctl(unsigned int cmd, unsigned long arg);
 int lustre_get_jobid(char *jobid, size_t len);
index 84a8ce1..6d06336 100644 (file)
@@ -952,18 +952,6 @@ struct obd_device *class_exp2obd(struct obd_export *exp)
 }
 EXPORT_SYMBOL(class_exp2obd);
 
-struct obd_device *class_conn2obd(struct lustre_handle *conn)
-{
-        struct obd_export *export;
-        export = class_conn2export(conn);
-        if (export) {
-                struct obd_device *obd = export->exp_obd;
-                class_export_put(export);
-                return obd;
-        }
-        return NULL;
-}
-
 struct obd_import *class_exp2cliimp(struct obd_export *exp)
 {
         struct obd_device *obd = exp->exp_obd;
@@ -973,14 +961,6 @@ struct obd_import *class_exp2cliimp(struct obd_export *exp)
 }
 EXPORT_SYMBOL(class_exp2cliimp);
 
-struct obd_import *class_conn2cliimp(struct lustre_handle *conn)
-{
-        struct obd_device *obd = class_conn2obd(conn);
-        if (obd == NULL)
-                return NULL;
-        return obd->u.cli.cl_import;
-}
-
 /* Export management functions */
 static void class_export_destroy(struct obd_export *exp)
 {
@@ -1236,7 +1216,7 @@ void class_unlink_export(struct obd_export *exp)
 EXPORT_SYMBOL(class_unlink_export);
 
 /* Import management functions */
-static void class_import_destroy(struct obd_import *imp)
+static void obd_zombie_import_free(struct obd_import *imp)
 {
         ENTRY;
 
@@ -1259,20 +1239,10 @@ static void class_import_destroy(struct obd_import *imp)
 
         LASSERT(imp->imp_sec == NULL);
         class_decref(imp->imp_obd, "import", imp);
-        OBD_FREE_RCU(imp, sizeof(*imp), &imp->imp_handle);
-        EXIT;
-}
-
-static void import_handle_addref(void *import)
-{
-        class_import_get(import);
+       OBD_FREE_PTR(imp);
+       EXIT;
 }
 
-static struct portals_handle_ops import_handle_ops = {
-       .hop_addref = import_handle_addref,
-       .hop_free   = NULL,
-};
-
 struct obd_import *class_import_get(struct obd_import *import)
 {
        atomic_inc(&import->imp_refcount);
@@ -1321,7 +1291,7 @@ static void obd_zombie_imp_cull(struct work_struct *ws)
        struct obd_import *import;
 
        import = container_of(ws, struct obd_import, imp_zombie_work);
-       class_import_destroy(import);
+       obd_zombie_import_free(import);
 }
 
 struct obd_import *class_new_import(struct obd_device *obd)
@@ -1360,8 +1330,6 @@ struct obd_import *class_new_import(struct obd_device *obd)
        atomic_set(&imp->imp_replay_inflight, 0);
        atomic_set(&imp->imp_inval_count, 0);
        INIT_LIST_HEAD(&imp->imp_conn_list);
-       INIT_LIST_HEAD_RCU(&imp->imp_handle.h_link);
-       class_handle_hash(&imp->imp_handle, &import_handle_ops);
        init_imp_at(&imp->imp_at);
 
        /* the default magic is V2, will be used in connect RPC, and
@@ -1377,8 +1345,6 @@ void class_destroy_import(struct obd_import *import)
        LASSERT(import != NULL);
        LASSERT(import != LP_POISON);
 
-       class_handle_unhash(&import->imp_handle);
-
        spin_lock(&import->imp_lock);
        import->imp_generation++;
        spin_unlock(&import->imp_lock);