* GPL HEADER END
*/
/*
- * Copyright (c) 2012 Intel, Inc.
+ * Copyright (c) 2012, Intel Corporation.
* Use is subject to license terms.
*
* Author: Johann Lombardi <johann.lombardi@intel.com>
* The QMT device is currently set up by the MDT and should probably be moved
* to a separate target in the future. Meanwhile, the MDT forwards all quota
* requests to the QMT via a list of request handlers (see struct qmt_handlers
- * in lquota.h). The QMT also borrows the LDLM namespace from the MDT.
+ * in lustre_quota.h). The QMT also borrows the LDLM namespace from the MDT.
*
* To bring up a QMT device, the following steps must be completed:
*
* mdt_quota_init() for more details.
*/
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
-
#define DEBUG_SUBSYSTEM S_LQUOTA
#include <obd_class.h>
qmt->qmt_proc = NULL;
}
+ /* stop rebalance thread */
+ qmt_stop_reba_thread(qmt);
+
/* disconnect from OSD */
if (qmt->qmt_child_exp != NULL) {
obd_disconnect(qmt->qmt_child_exp);
qmt->qmt_child = NULL;
}
- /* release reference on MDT namespace */
- if (ld->ld_obd->obd_namespace != NULL) {
- ldlm_namespace_put(ld->ld_obd->obd_namespace);
- ld->ld_obd->obd_namespace = NULL;
- qmt->qmt_ns = NULL;
- }
+ /* clear references to MDT namespace */
+ ld->ld_obd->obd_namespace = NULL;
+ qmt->qmt_ns = NULL;
RETURN(NULL);
}
if (mdt_obd == NULL)
RETURN(-ENOENT);
- /* grab reference on MDT namespace. kind of a hack until we have our
- * own namespace & service threads */
+ /* borrow MDT namespace. kind of a hack until we have our own namespace
+ * & service threads */
LASSERT(mdt_obd->obd_namespace != NULL);
- ldlm_namespace_get(mdt_obd->obd_namespace);
obd->obd_namespace = mdt_obd->obd_namespace;
qmt->qmt_ns = obd->obd_namespace;
if (rc)
GOTO(out, rc);
+ /* set up and start rebalance thread */
+ thread_set_flags(&qmt->qmt_reba_thread, SVC_STOPPED);
+ init_waitqueue_head(&qmt->qmt_reba_thread.t_ctl_waitq);
+ INIT_LIST_HEAD(&qmt->qmt_reba_list);
+ spin_lock_init(&qmt->qmt_reba_lock);
+ rc = qmt_start_reba_thread(qmt);
+ if (rc) {
+ CERROR("%s: failed to start rebalance thread (%d)\n",
+ qmt->qmt_svname, rc);
+ GOTO(out, rc);
+ }
+
/* at the moment there is no linkage between lu_type and obd_type, so
* we lookup obd_type this way */
type = class_search_type(LUSTRE_QMT_NAME);
LASSERT(type != NULL);
/* register proc directory associated with this qmt */
- qmt->qmt_proc = lprocfs_register(qmt->qmt_svname, type->typ_procroot,
- NULL, NULL);
+ qmt->qmt_proc = lprocfs_seq_register(qmt->qmt_svname, type->typ_procroot,
+ NULL, NULL);
if (IS_ERR(qmt->qmt_proc)) {
rc = PTR_ERR(qmt->qmt_proc);
CERROR("%s: failed to create qmt proc entry (%d)\n",
int rc;
ENTRY;
- rc = class_register_type(&qmt_obd_ops, NULL, NULL, LUSTRE_QMT_NAME,
- &qmt_device_type);
+ rc = class_register_type(&qmt_obd_ops, NULL, true, NULL,
+#ifndef HAVE_ONLY_PROCFS_SEQ
+ NULL,
+#endif
+ LUSTRE_QMT_NAME, &qmt_device_type);
RETURN(rc);
}