* GPL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
struct lvfs_run_ctxt saved;
int rc;
- ptlrpc_daemonize("quotacheck");
+ cfs_daemonize_ctxt("quotacheck");
exp = qta->qta_exp;
obd = qta->qta_obd;
rc = target_quotacheck_callback(exp, oqctl);
class_export_put(exp);
- up(qta->qta_sem);
+ cfs_up(qta->qta_sem);
OBD_FREE_PTR(qta);
return rc;
}
if (!qta)
RETURN(ENOMEM);
- down(&obt->obt_quotachecking);
+ cfs_down(&obt->obt_quotachecking);
qta->qta_exp = exp;
qta->qta_obd = obd;
/* we get ref for exp because target_quotacheck_callback() will use this
* export later b=18126 */
class_export_get(exp);
- rc = kernel_thread(target_quotacheck_thread, qta, CLONE_VM|CLONE_FILES);
+ rc = cfs_kernel_thread(target_quotacheck_thread, qta,
+ CLONE_VM|CLONE_FILES);
if (rc >= 0) {
+ /* target_quotacheck_thread will drop the ref on exp and release
+ * obt_quotachecking */
CDEBUG(D_INFO, "%s: target_quotacheck_thread: %d\n",
obd->obd_name, rc);
RETURN(0);
}
out:
- up(&obt->obt_quotachecking);
+ cfs_up(&obt->obt_quotachecking);
OBD_FREE_PTR(qta);
return rc;
}
int i, rc = 0;
ENTRY;
+ obd_getref(obd);
+
for (i = 0; i < lov->desc.ld_tgt_count; i++) {
- if (!lov->lov_tgts[i] || !lov->lov_tgts[i]->ltd_active) {
+ if (!lov->lov_tgts[i])
+ continue;
+
+ if (!lov->lov_tgts[i]->ltd_active) {
CERROR("lov idx %d inactive\n", i);
- RETURN(-EIO);
+ rc = -EIO;
+ goto out;
}
}
for (i = 0; i < lov->desc.ld_tgt_count; i++) {
int err;
+ if (!lov->lov_tgts[i])
+ continue;
+
err = obd_quotacheck(lov->lov_tgts[i]->ltd_exp, oqctl);
if (err && !rc)
rc = err;
}
+out:
+ obd_putref(obd);
+
RETURN(rc);
}