- LASSERT(type == USRQUOTA || type == GRPQUOTA || type == UGQUOTA);
-
- obt = &obd->u.obt;
-
- OBD_ALLOC_PTR(oqctl);
- if (!oqctl)
- RETURN(-ENOMEM);
-
- if (!atomic_dec_and_test(&obt->obt_quotachecking)) {
- CDEBUG(D_INFO, "other people are doing quotacheck\n");
- atomic_inc(&obt->obt_quotachecking);
- RETURN(-EBUSY);
- }
-
- id = UGQUOTA2LQC(type);
- /* quota already turned on */
- if ((obt->obt_qctxt.lqc_flags & id) == id) {
- rc = 0;
- goto out;
- }
- if (obt->obt_qctxt.lqc_immutable) {
- LCONSOLE_ERROR("Failed to turn Quota on, immutable mode "
- "(is SOM enabled?)\n");
- goto out;
- }
+ cfs_down(&obt->obt_quotachecking);
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
+ id = UGQUOTA2LQC(oqctl->qc_type);
+ local = (obt->obt_qctxt.lqc_flags & id) != id;