static int seq_handler(struct tgt_session_info *tsi) { struct lu_seq_range *out, *tmp; struct lu_site *site; int rc; __u32 *opc; ENTRY; LASSERT(!(lustre_msg_get_flags(tgt_ses_req(tsi)->rq_reqmsg) & MSG_REPLAY)); site = tsi->tsi_exp->exp_obd->obd_lu_dev->ld_site; LASSERT(site != NULL); opc = req_capsule_client_get(tsi->tsi_pill, &RMF_SEQ_OPC); if (opc != NULL) { out = req_capsule_server_get(tsi->tsi_pill, &RMF_SEQ_RANGE); if (out == NULL) RETURN(err_serious(-EPROTO)); tmp = req_capsule_client_get(tsi->tsi_pill, &RMF_SEQ_RANGE); /* seq client passed mdt id, we need to pass that using out * range parameter */ out->lsr_index = tmp->lsr_index; out->lsr_flags = tmp->lsr_flags; rc = seq_server_handle(site, tsi->tsi_env, *opc, out); } else { rc = err_serious(-EPROTO); } RETURN(rc); }
static int seq_req_handle(struct ptlrpc_request *req, const struct lu_env *env, struct seq_thread_info *info) { struct lu_seq_range *out, *tmp; struct lu_site *site; int rc = -EPROTO; __u32 *opc; ENTRY; LASSERT(!(lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY)); site = req->rq_export->exp_obd->obd_lu_dev->ld_site; LASSERT(site != NULL); rc = req_capsule_server_pack(info->sti_pill); if (rc) RETURN(err_serious(rc)); opc = req_capsule_client_get(info->sti_pill, &RMF_SEQ_OPC); if (opc != NULL) { out = req_capsule_server_get(info->sti_pill, &RMF_SEQ_RANGE); if (out == NULL) RETURN(err_serious(-EPROTO)); tmp = req_capsule_client_get(info->sti_pill, &RMF_SEQ_RANGE); /* seq client passed mdt id, we need to pass that using out * range parameter */ out->lsr_index = tmp->lsr_index; out->lsr_flags = tmp->lsr_flags; rc = seq_server_handle(site, env, *opc, out); } else rc = err_serious(-EPROTO); RETURN(rc); }