get lyx to build the lustre-HOWTO.txt from the source file, get the PDF
version from the lustre.org website, or install the lustre-doc RPM for
the formatted text version (or read the somewhat cryptic lustre-HOWTO.lin
-file if you are desparate).
+file if you are desperate).
int class_connect(struct lustre_handle *conn, struct obd_device *obd,
char *cluuid);
int class_disconnect(struct lustre_handle *conn);
+void class_disconnect_all(struct obd_device *obddev);
struct obd_export *class_conn2export(struct lustre_handle *);
/* generic operations shared by various OBD types */
extern kmem_cache_t *ldlm_resource_slab;
extern kmem_cache_t *ldlm_lock_slab;
+extern struct list_head ldlm_namespace_list;
extern int (*mds_reint_p)(int offset, struct ptlrpc_request *req);
extern int (*mds_getattr_name_p)(int offset, struct ptlrpc_request *req);
struct ldlm_obd *ldlm = &obddev->u.ldlm;
ENTRY;
+ if (!list_empty(&ldlm_namespace_list)) {
+ CERROR("ldlm still has namespaces; clean these up first.\n");
+ RETURN(-EBUSY);
+ }
+
ptlrpc_stop_all_threads(ldlm->ldlm_service);
ptlrpc_unregister_service(ldlm->ldlm_service);
ldlm_proc_cleanup(obddev);
return rc;
}
-static int mds_cleanup(struct obd_device * obddev)
+static int mds_cleanup(struct obd_device *obddev)
{
struct super_block *sb;
struct mds_obd *mds = &obddev->u.mds;
ENTRY;
- if ( !list_empty(&obddev->obd_exports) ) {
- CERROR("still has exports!\n");
- RETURN(-EBUSY);
+ if (!list_empty(&obddev->obd_exports)) {
+ CERROR("still has exports; forcing cleanup\n");
+ class_disconnect_all(obddev);
+ if (!list_empty(&obddev->obd_exports)) {
+ CERROR("still has exports after forced cleanup?\n");
+ RETURN(-EBUSY);
+ }
}
ptlrpc_stop_all_threads(mds->mds_service);
EXPORT_SYMBOL(class_rconn2export);
EXPORT_SYMBOL(class_conn2obd);
EXPORT_SYMBOL(class_disconnect);
+EXPORT_SYMBOL(class_disconnect_all);
//EXPORT_SYMBOL(class_multi_setup);
//EXPORT_SYMBOL(class_multi_cleanup);
RETURN(0);
}
+void class_disconnect_all(struct obd_device *obddev)
+{
+ struct list_head *tmp, *next;
+
+ list_for_each_safe(tmp, next, &obddev->obd_exports) {
+ struct obd_export *export;
+ struct lustre_handle conn;
+
+ export = list_entry(tmp, struct obd_export, exp_chain);
+ conn.addr = (__u64) (unsigned long)export;
+ conn.cookie = export->exp_cookie;
+ obd_disconnect(&conn);
+ }
+}
+
#if 0
/* FIXME: Data is a space- or comma-separated list of device IDs. This will