@@ -43,9 +43,15 @@
*
* @{
*/
+#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 <linux/libcfs/libcfs.h>
-#include <lustre_handles.h>
#include <uapi/linux/lustre/lustre_idl.h>
/**
@@ -154,8 +160,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 */
@@ -863,7 +863,6 @@ static struct obd_export *__class_new_export(struct obd_device *obd,
exit_unlock:
spin_unlock(&obd->obd_dev_lock);
- class_handle_unhash(&export->exp_handle);
obd_destroy_export(export);
kfree(export);
return ERR_PTR(rc);
@@ -903,7 +902,7 @@ void class_unlink_export(struct obd_export *exp)
}
/* Import management functions */
-static void class_import_destroy(struct obd_import *imp)
+static void obd_zombie_import_free(struct obd_import *imp)
{
struct obd_import_conn *imp_conn;
@@ -924,19 +923,9 @@ static void class_import_destroy(struct obd_import *imp)
LASSERT(!imp->imp_sec);
class_decref(imp->imp_obd, "import", imp);
- OBD_FREE_RCU(imp, sizeof(*imp), &imp->imp_handle);
+ kfree(imp);
}
-static void import_handle_addref(void *import)
-{
- class_import_get(import);
-}
-
-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);
@@ -985,7 +974,7 @@ static void obd_zombie_imp_cull(struct work_struct *ws)
struct obd_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)
@@ -1018,8 +1007,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
@@ -1036,8 +1023,6 @@ void class_destroy_import(struct obd_import *import)
LASSERT(import);
LASSERT(import != LP_POISON);
- class_handle_unhash(&import->imp_handle);
-
spin_lock(&import->imp_lock);
import->imp_generation++;
spin_unlock(&import->imp_lock);