-#endif
-
-int client_quota_adjust_qunit(struct obd_export *exp,
- struct quota_adjust_qunit *oqaq,
- struct lustre_quota_ctxt *qctxt)
-{
- struct ptlrpc_request *req;
- struct quota_adjust_qunit *oqa;
- int rc = 0;
- ENTRY;
-
- /* client don't support this kind of operation, abort it */
- if (!(exp->exp_connect_flags & OBD_CONNECT_CHANGE_QS)) {
- CDEBUG(D_QUOTA, "osc: %s don't support change qunit size\n",
- exp->exp_obd->obd_name);
- RETURN(rc);
- }
- if (strcmp(exp->exp_obd->obd_type->typ_name, LUSTRE_OSC_NAME))
- RETURN(-EINVAL);
-
- req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp),
- &RQF_OST_QUOTA_ADJUST_QUNIT,
- LUSTRE_OST_VERSION,
- OST_QUOTA_ADJUST_QUNIT);
- if (req == NULL)
- RETURN(-ENOMEM);
-
- oqa = req_capsule_client_get(&req->rq_pill, &RMF_QUOTA_ADJUST_QUNIT);
- *oqa = *oqaq;
-
- ptlrpc_request_set_replen(req);
-
- rc = ptlrpc_queue_wait(req);
- if (rc)
- CERROR("%s: %s failed: rc = %d\n", exp->exp_obd->obd_name,
- __FUNCTION__, rc);
- ptlrpc_req_finished(req);
- RETURN (rc);
-}
-
-int lov_quota_adjust_qunit(struct obd_export *exp,
- struct quota_adjust_qunit *oqaq,
- struct lustre_quota_ctxt *qctxt)
-{
- struct obd_device *obd = class_exp2obd(exp);
- struct lov_obd *lov = &obd->u.lov;
- int i, rc = 0;
- ENTRY;
-
- if (!QAQ_IS_ADJBLK(oqaq)) {
- CERROR("bad qaq_flags %x for lov obd.\n", oqaq->qaq_flags);
- RETURN(-EFAULT);
- }
-
- for (i = 0; i < lov->desc.ld_tgt_count; i++) {
- int err;
-
- if (!lov->lov_tgts[i]->ltd_active) {
- CDEBUG(D_HA, "ost %d is inactive\n", i);
- continue;
- }
-
- err = obd_quota_adjust_qunit(lov->lov_tgts[i]->ltd_exp, oqaq,
- NULL);
- if (err) {
- if (lov->lov_tgts[i]->ltd_active && !rc)
- rc = err;
- continue;
- }
- }
- RETURN(rc);
-}