/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2011, 2012, Whamcloud, Inc.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
ping_evictor_start();
- LCONSOLE_INFO("MGS %s started\n", obd->obd_name);
+ CDEBUG(D_INFO, "MGS %s started\n", obd->obd_name);
RETURN(0);
static int mgs_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
{
+ struct mgs_obd *mgs = &obd->u.mgs;
int rc = 0;
ENTRY;
switch (stage) {
case OBD_CLEANUP_EARLY:
+ break;
case OBD_CLEANUP_EXPORTS:
+ ping_evictor_stop();
+ ptlrpc_unregister_service(mgs->mgs_service);
+ mgs_cleanup_fsdb_list(obd);
rc = obd_llog_finish(obd, 0);
+ lproc_mgs_cleanup(obd);
break;
}
RETURN(rc);
if (mgs->mgs_sb == NULL)
RETURN(0);
- ping_evictor_stop();
-
- ptlrpc_unregister_service(mgs->mgs_service);
-
- mgs_cleanup_fsdb_list(obd);
- lproc_mgs_cleanup(obd);
mgs_fs_cleanup(obd);
server_put_mount(obd->obd_name, mgs->mgs_vfsmnt);
RETURN(0);
}
+/*
+ * For old clients there is no direct way of knowing which filesystems
+ * a client is operating at the MGS side. But we need to pick up those
+ * clients so that the MGS can mark the corresponding filesystem as
+ * non-IR capable because old clients are not ready to be notified.
+ *
+ * This is why we have this _hack_ function. We detect the filesystem's
+ * name by hacking llog operation which is currently used by the clients
+ * to fetch configuration logs. At present this is fine because this is
+ * the ONLY llog operation between mgc and the MGS.
+ *
+ * If extra llog operation is going to be added, this function needs fixing.
+ *
+ * If releases prior than 2.0 are not supported, we can remove this function.
+ */
static int mgs_handle_fslog_hack(struct ptlrpc_request *req)
{
char *logname;
if (opc != MGS_CONNECT) {
if (!class_connected_export(req->rq_export)) {
- CERROR("lustre_mgs: operation %d on unconnected MGS\n",
- opc);
+ DEBUG_REQ(D_MGS, req, "operation on unconnected MGS\n");
req->rq_status = -ENOTCONN;
GOTO(out, rc = -ENOTCONN);
}
cfs_spin_unlock(&exp->exp_lock);
/* self-export doesn't need client data and ldlm initialization */
- if (unlikely(exp == exp->exp_obd->obd_self_export))
+ if (unlikely(obd_uuid_equals(&exp->exp_obd->obd_uuid,
+ &exp->exp_client_uuid)))
return 0;
return ldlm_init_export(exp);
}
target_destroy_export(exp);
mgs_client_free(exp);
- if (unlikely(exp == exp->exp_obd->obd_self_export))
+ if (unlikely(obd_uuid_equals(&exp->exp_obd->obd_uuid,
+ &exp->exp_client_uuid)))
RETURN(0);
ldlm_destroy_export(exp);