X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fquota%2Fqsd_request.c;h=50bf8db9a055a07ba4ee9c5783e3000ed32db1e2;hb=929ec628e6fef5609e55d519a1eb9e2cbbf1f1e8;hp=fa98b568c63d8def36bb4fe52636b8a4ee05b229;hpb=b2cb6fd1095f9c483b7bc1ebbbfdaef719aea87c;p=fs%2Flustre-release.git diff --git a/lustre/quota/qsd_request.c b/lustre/quota/qsd_request.c index fa98b56..50bf8db 100644 --- a/lustre/quota/qsd_request.c +++ b/lustre/quota/qsd_request.c @@ -45,7 +45,7 @@ struct qsd_async_args { struct obd_export *aa_exp; struct qsd_qtype_info *aa_qqi; void *aa_arg; - union ldlm_wire_lvb *aa_lvb; + struct lquota_lvb *aa_lvb; struct lustre_handle aa_lockh; qsd_req_completion_t aa_completion; }; @@ -110,6 +110,7 @@ int qsd_send_dqacq(const struct lu_env *env, struct obd_export *exp, GOTO(out, rc = -ENOMEM); req->rq_no_resend = req->rq_no_delay = 1; + req->rq_no_retry_einprogress = 1; rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, QUOTA_DQACQ); if (rc) { ptlrpc_request_free(req); @@ -162,7 +163,7 @@ static int qsd_intent_interpret(const struct lu_env *env, struct quota_body *rep_qbody = NULL, *req_qbody; struct ldlm_intent *lit; struct qsd_async_args *aa = (struct qsd_async_args *)arg; - int flags = LDLM_FL_HAS_INTENT; + __u64 flags = LDLM_FL_HAS_INTENT; ENTRY; LASSERT(aa->aa_exp); @@ -172,7 +173,7 @@ static int qsd_intent_interpret(const struct lu_env *env, rc = ldlm_cli_enqueue_fini(aa->aa_exp, req, LDLM_PLAIN, 0, LCK_CR, &flags, (void *)aa->aa_lvb, - sizeof(union ldlm_wire_lvb), lockh, rc); + sizeof(struct lquota_lvb), lockh, rc); if (rc < 0) /* the lock has been destroyed, forget about the lock handle */ memset(lockh, 0, sizeof(*lockh)); @@ -207,14 +208,15 @@ static int qsd_intent_interpret(const struct lu_env *env, int qsd_intent_lock(const struct lu_env *env, struct obd_export *exp, struct quota_body *qbody, bool sync, int it_op, qsd_req_completion_t completion, struct qsd_qtype_info *qqi, - union ldlm_wire_lvb *lvb, void *arg) + struct lquota_lvb *lvb, void *arg) { struct qsd_thread_info *qti = qsd_info(env); struct ptlrpc_request *req; struct qsd_async_args *aa = NULL; struct ldlm_intent *lit; struct quota_body *req_qbody; - int rc, flags = LDLM_FL_HAS_INTENT; + __u64 flags = LDLM_FL_HAS_INTENT; + int rc; ENTRY; LASSERT(exp != NULL); @@ -227,7 +229,7 @@ int qsd_intent_lock(const struct lu_env *env, struct obd_export *exp, if (req == NULL) GOTO(out, rc = -ENOMEM); - req->rq_no_resend = req->rq_no_delay = 1; + req->rq_no_retry_einprogress = 1; rc = ldlm_prep_enqueue_req(exp, req, NULL, 0); if (rc) { ptlrpc_request_free(req); @@ -240,6 +242,8 @@ int qsd_intent_lock(const struct lu_env *env, struct obd_export *exp, req_qbody = req_capsule_client_get(&req->rq_pill, &RMF_QUOTA_BODY); *req_qbody = *qbody; + req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER, + sizeof(*lvb)); ptlrpc_request_set_replen(req); switch(it_op) { @@ -269,8 +273,8 @@ int qsd_intent_lock(const struct lu_env *env, struct obd_export *exp, /* build lock enqueue request */ rc = ldlm_cli_enqueue(exp, &req, &qti->qti_einfo, &qti->qti_resid, NULL, - &flags, (void *)lvb, sizeof(*lvb), &qti->qti_lockh, - 1); + &flags, (void *)lvb, sizeof(*lvb), LVB_T_LQUOTA, + &qti->qti_lockh, 1); if (rc < 0) { ptlrpc_req_finished(req); GOTO(out, rc); @@ -296,6 +300,9 @@ int qsd_intent_lock(const struct lu_env *env, struct obd_export *exp, case IT_QUOTA_DQACQ: /* grab reference on lqe for new lock */ lqe_getref((struct lquota_entry *)arg); + /* all acquire/release request are sent with no_resend and + * no_delay flag */ + req->rq_no_resend = req->rq_no_delay = 1; break; default: break; @@ -323,7 +330,7 @@ int qsd_intent_lock(const struct lu_env *env, struct obd_export *exp, RETURN(rc); out: - completion(env, qqi, qbody, NULL, &qti->qti_lockh, NULL, arg, rc); + completion(env, qqi, qbody, NULL, &qti->qti_lockh, lvb, arg, rc); return rc; } @@ -376,7 +383,7 @@ int qsd_fetch_index(const struct lu_env *env, struct obd_export *exp, /* req now owns desc and will free it when it gets freed */ for (i = 0; i < npages; i++) - ptlrpc_prep_bulk_page(desc, pages[i], 0, CFS_PAGE_SIZE); + ptlrpc_prep_bulk_page_pin(desc, pages[i], 0, CFS_PAGE_SIZE); /* pack index information in request */ req_ii = req_capsule_client_get(&req->rq_pill, &RMF_IDX_INFO);