* 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.
*/
/*
~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);
}
req->rq_no_resend = 1;
rc = ptlrpc_queue_wait(req);
- if (rc) {
+ if (rc)
CERROR("ptlrpc_queue_wait failed, rc: %d\n", rc);
- GOTO(out, rc);
- }
- oqc = NULL;
- if (req->rq_repmsg)
- oqc = req_capsule_server_get(&req->rq_pill, &RMF_OBD_QUOTACTL);
-
- if (oqc == NULL) {
+ if (req->rq_repmsg &&
+ (oqc = req_capsule_server_get(&req->rq_pill, &RMF_OBD_QUOTACTL))) {
+ *oqctl = *oqc;
+ } else if (!rc) {
CERROR ("Can't unpack obd_quotactl\n");
- GOTO(out, rc = -EPROTO);
+ rc = -EPROTO;
}
- *oqctl = *oqc;
EXIT;
-out:
+
ptlrpc_req_finished(req);
return rc;
int err;
tgt = lov->lov_tgts[i];
- if (!tgt || !tgt->ltd_active || tgt->ltd_reap) {
- if (oqctl->qc_cmd == Q_GETOQUOTA) {
+
+ if (!tgt)
+ continue;
+
+ if (!tgt->ltd_active || tgt->ltd_reap) {
+ if (oqctl->qc_cmd == Q_GETOQUOTA &&
+ lov->lov_tgts[i]->ltd_activate) {
rc = -EREMOTEIO;
CERROR("ost %d is inactive\n", i);
} else {