From: John L. Hammond Date: Fri, 28 Sep 2018 15:56:29 +0000 (-0500) Subject: LU-11445 obd: remove portals handle from OBD import X-Git-Tag: 2.12.0-RC1~82 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=59729e4c08679061491b47c2adbc5208bbef0e7a LU-11445 obd: remove portals handle from OBD import 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 Change-Id: Ib05f91f6dabbd4249769560d443ba69819fc1157 Reviewed-on: https://review.whamcloud.com/33250 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/lustre_export.h b/lustre/include/lustre_export.h index 5ead593..33b9aed 100644 --- a/lustre/include/lustre_export.h +++ b/lustre/include/lustre_export.h @@ -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 { diff --git a/lustre/include/lustre_import.h b/lustre/include/lustre_import.h index 9ba6a87..8f52c66 100644 --- a/lustre/include/lustre_import.h +++ b/lustre/include/lustre_import.h @@ -42,9 +42,14 @@ * * @{ */ +#include +#include +#include +#include +#include +#include #include - -#include +#include #include /** @@ -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 */ diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index ed410a0..1cf3a7a 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -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); diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index 84a8ce1..6d06336 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -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);