Commit 9a0f7f12 authored by Nils Goroll's avatar Nils Goroll

reorder code

parent 0f5f608d
...@@ -1257,7 +1257,25 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody) ...@@ -1257,7 +1257,25 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
gz = NULL; gz = NULL;
} }
if (obj_final && !obj_esi && (pesi->flags & PF_CFG_BLOCK_FINAL) == 0) { if (obj_esi) {
VSLdbg(req, "vped_deliver: ESI");
VDP_Push(req, &VDP_pesi_buf, pesi);
push_vdps(req, vgzgz, gz);
AN(parent);
AZ(VDP_Push(req, &vped_to_parent, parent->nexus.req));
(void)VDP_DeliverObj(req);
/*
* only close the pesi VDPs, the others are to run from topreq
* delivery
*/
vped_close_vdp(req, 0, &VDP_pesi);
vped_close_vdp(req, 0, &VDP_pesi_buf);
return;
}
else if (obj_final && (pesi->flags & PF_CFG_BLOCK_FINAL) == 0) {
VSLdbg(req, "vped_deliver: T_NEXUS buffering no ESI"); VSLdbg(req, "vped_deliver: T_NEXUS buffering no ESI");
VDP_Push(req, &VDP_pesi_buf, pesi); VDP_Push(req, &VDP_pesi_buf, pesi);
...@@ -1274,7 +1292,7 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody) ...@@ -1274,7 +1292,7 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
vped_close_vdp(req, 0, &VDP_pesi_buf); vped_close_vdp(req, 0, &VDP_pesi_buf);
return; return;
} }
else if (obj_final && !obj_esi) { else if (obj_final) {
VSLdbg(req, "vped_deliver: T_FINAL"); VSLdbg(req, "vped_deliver: T_FINAL");
push_vdps(req, vgzgz, gz); push_vdps(req, vgzgz, gz);
...@@ -1313,54 +1331,36 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody) ...@@ -1313,54 +1331,36 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
return; return;
} }
else if (! obj_esi) { VSLdbg(req, "vped_deliver: T_SUBREQ");
VSLdbg(req, "vped_deliver: T_SUBREQ");
AZ(req->objcore->flags & OC_F_FINAL);
push_vdps(req, vgzgz, gz);
AZ(VDP_Push(req, &vped_to_parent, parent->nexus.req));
node_mutate_prep(tree, node);
/* our caller, cnt_transmit(), releases the refs to boc and oc AZ(req->objcore->flags & OC_F_FINAL);
* when we return, so in order to hand this request to the push_vdps(req, vgzgz, gz);
* topreq thread, we need to gain one more AZ(VDP_Push(req, &vped_to_parent, parent->nexus.req));
*/
node->subreq.req = req;
node->subreq.boc = HSH_RefBoc(req->objcore);
HSH_Ref(req->objcore);
node->subreq.oc = req->objcore;
AZ(pthread_cond_init(&node->subreq.cond, NULL)); node_mutate_prep(tree, node);
node_mutate_lock(tree, node, T_SUBREQ, ST_DATA); /* our caller, cnt_transmit(), releases the refs to boc and oc when we
node_mutate_unlock(tree); * return, so in order to hand this request to the topreq thread, we
* need to gain one more
/* */
* to be done in the other thread: node->subreq.req = req;
* - VDP_DeliverObj() node->subreq.boc = HSH_RefBoc(req->objcore);
* - VDP_close() HSH_Ref(req->objcore);
* node->subreq.oc = req->objcore;
* from vped_task():
* - req_fini()
*/
return;
}
VSLdbg(req, "vped_deliver: ESI");
VDP_Push(req, &VDP_pesi_buf, pesi); AZ(pthread_cond_init(&node->subreq.cond, NULL));
push_vdps(req, vgzgz, gz);
AN(parent);
AZ(VDP_Push(req, &vped_to_parent, parent->nexus.req));
(void)VDP_DeliverObj(req); node_mutate_lock(tree, node, T_SUBREQ, ST_DATA);
node_mutate_unlock(tree);
/* /*
* only close the pesi VDPs, the others are to run from topreq delivery * to be done in the other thread:
* - VDP_DeliverObj()
* - VDP_close()
*
* from vped_task():
* - req_fini()
*/ */
vped_close_vdp(req, 0, &VDP_pesi);
vped_close_vdp(req, 0, &VDP_pesi_buf);
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment