CDEBUG(D_QUOTA, "%s: initiating QMT shutdown\n", qmt->qmt_svname);
qmt->qmt_stopping = true;
+ if (qmt_lvbo_free_wq) {
+ destroy_workqueue(qmt_lvbo_free_wq);
+ qmt_lvbo_free_wq = NULL;
+ }
+
/* kill pool instances, if any */
qmt_pool_fini(env, qmt);
RETURN(-EINVAL);
/* record who i am, it might be useful ... */
- rc = strlcpy(qmt->qmt_svname, svname, sizeof(qmt->qmt_svname));
- if (rc >= sizeof(qmt->qmt_svname))
- RETURN(-E2BIG);
+ rc = strscpy(qmt->qmt_svname, svname, sizeof(qmt->qmt_svname));
+ if (rc < 0)
+ RETURN(rc);
/* look-up the obd_device associated with the qmt */
obd = class_name2obd(qmt->qmt_svname);
if (rc)
GOTO(out, rc);
+ qmt_lvbo_free_wq = alloc_workqueue("qmt_lvbo_free", WQ_UNBOUND, 0);
+ if (!qmt_lvbo_free_wq) {
+ rc = -ENOMEM;
+ CERROR("%s: failed to start qmt_lvbo_free workqueue: rc = %d\n",
+ qmt->qmt_svname, rc);
+ goto out;
+ }
+
EXIT;
out:
if (rc)
/*
* lu device type operations associated with the master target.
*/
-static struct lu_device_type_operations qmt_device_type_ops = {
+static const struct lu_device_type_operations qmt_device_type_ops = {
.ldto_init = qmt_type_init,
.ldto_fini = qmt_type_fini,
int rc;
ENTRY;
- rc = class_register_type(&qmt_obd_ops, NULL, true, NULL,
+ rc = class_register_type(&qmt_obd_ops, NULL, true,
LUSTRE_QMT_NAME, &qmt_device_type);
RETURN(rc);
}