pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
cfs_up(&obt->obt_quotachecking);
+ CDEBUG(D_QUOTA, "%s: quotaon type:master:global:local:flags:rc "
+ "%u:%d:%d:%d:%lu:%d\n",
+ obd->obd_name, oqctl->qc_type, is_master, global, local,
+ obt->obt_qctxt.lqc_flags, rc);
+
return rc;
}
EXIT;
}
-int quota_is_on(struct lustre_quota_ctxt *qctxt, struct obd_quotactl *oqctl)
+inline int quota_is_on(struct lustre_quota_ctxt *qctxt,
+ struct obd_quotactl *oqctl)
{
- unsigned int type;
-
- for (type = USRQUOTA; type < MAXQUOTAS; type++) {
- if (!Q_TYPESET(oqctl, type))
- continue;
- if (!(qctxt->lqc_flags & UGQUOTA2LQC(oqctl->qc_type)))
- return 0;
- }
- return 1;
+ return ((qctxt->lqc_flags & UGQUOTA2LQC(oqctl->qc_type)) ==
+ UGQUOTA2LQC(oqctl->qc_type));
}
-int quota_is_off(struct lustre_quota_ctxt *qctxt, struct obd_quotactl *oqctl)
+inline int quota_is_off(struct lustre_quota_ctxt *qctxt,
+ struct obd_quotactl *oqctl)
{
- unsigned int type;
-
- for (type = USRQUOTA; type < MAXQUOTAS; type++) {
- if (!Q_TYPESET(oqctl, type))
- continue;
- if (qctxt->lqc_flags & UGQUOTA2LQC(oqctl->qc_type))
- return 0;
- }
- return 1;
+ return !(qctxt->lqc_flags & UGQUOTA2LQC(oqctl->qc_type));
}
/**
~UGQUOTA2LQC(oqctl->qc_type);
else if (quota_is_off(qctxt, oqctl))
rc = -EALREADY;
+ CDEBUG(D_QUOTA, "%s: quotaoff type:flags:rc "
+ "%u:%lu:%d\n", obd->obd_name,
+ oqctl->qc_type, qctxt->lqc_flags, rc);
}
cfs_up(&obt->obt_quotachecking);
}
EXIT;
out:
+ CDEBUG(D_QUOTA, "%s: quotaoff type:flags:rc %u:%lu:%d\n",
+ obd->obd_name, oqctl->qc_type, qctxt->lqc_flags, rc);
cfs_up_write(&mds->mds_qonoff_sem);
pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
return rc ? : (rc1 ? : rc2);
# set quota
quota_init() {
+ do_nodes $(comma_list $(nodes_list)) "lctl set_param debug=+quota"
+
+ log "do the quotacheck ..."
$LFS quotacheck -ug $DIR
resetquota -u $TSTUSR
resetquota -g $TSTUSR
-
- do_nodes $(comma_list $(nodes_list)) "lctl set_param debug=+quota"
}
quota_init