+ /* set up and start rebalance thread */
+ thread_set_flags(&qmt->qmt_reba_thread, SVC_STOPPED);
+ cfs_waitq_init(&qmt->qmt_reba_thread.t_ctl_waitq);
+ CFS_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);
+ if (IS_ERR(qmt->qmt_proc)) {
+ rc = PTR_ERR(qmt->qmt_proc);
+ CERROR("%s: failed to create qmt proc entry (%d)\n",
+ qmt->qmt_svname, rc);
+ GOTO(out, rc);
+ }
+
+ /* initialize pool configuration */
+ rc = qmt_pool_init(env, qmt);
+ if (rc)
+ GOTO(out, rc);