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>
}
extern struct obd_export *class_conn2export(struct lustre_handle *conn);
}
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 {
#define KKUC_CT_DATA_MAGIC 0x092013cea
struct kkuc_ct_data {
+#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/workqueue.h>
-
-#include <lustre_handles.h>
+#include <libcfs/libcfs.h>
#include <uapi/linux/lustre/lustre_idl.h>
/**
#include <uapi/linux/lustre/lustre_idl.h>
/**
* Imports are representing client-side view to remote target.
*/
struct obd_import {
* 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 */
/** Reference counter */
atomic_t imp_refcount;
struct lustre_handle imp_dlm_handle; /* client's ldlm export */
/* genops.c */
struct obd_export;
extern struct obd_import *class_exp2cliimp(struct obd_export *);
/* genops.c */
struct obd_export;
extern struct obd_import *class_exp2cliimp(struct obd_export *);
-extern struct obd_import *class_conn2cliimp(struct lustre_handle *);
extern rwlock_t obd_dev_lock;
/* OBD Operations Declarations */
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);
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);
}
EXPORT_SYMBOL(class_exp2obd);
}
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;
struct obd_import *class_exp2cliimp(struct obd_export *exp)
{
struct obd_device *obd = exp->exp_obd;
}
EXPORT_SYMBOL(class_exp2cliimp);
}
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)
{
/* Export management functions */
static void class_export_destroy(struct obd_export *exp)
{
EXPORT_SYMBOL(class_unlink_export);
/* Import management functions */
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)
LASSERT(imp->imp_sec == NULL);
class_decref(imp->imp_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);
struct obd_import *class_import_get(struct obd_import *import)
{
atomic_inc(&import->imp_refcount);
struct obd_import *import;
import = container_of(ws, struct obd_import, imp_zombie_work);
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)
}
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);
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
init_imp_at(&imp->imp_at);
/* the default magic is V2, will be used in connect RPC, and
LASSERT(import != NULL);
LASSERT(import != LP_POISON);
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);
spin_lock(&import->imp_lock);
import->imp_generation++;
spin_unlock(&import->imp_lock);