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)
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");
VDP_Push(req, &VDP_pesi_buf, pesi);
......@@ -1274,7 +1292,7 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
vped_close_vdp(req, 0, &VDP_pesi_buf);
return;
}
else if (obj_final && !obj_esi) {
else if (obj_final) {
VSLdbg(req, "vped_deliver: T_FINAL");
push_vdps(req, vgzgz, gz);
......@@ -1313,54 +1331,36 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
return;
}
else if (! obj_esi) {
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);
VSLdbg(req, "vped_deliver: T_SUBREQ");
/* our caller, cnt_transmit(), releases the refs to boc and oc
* when we return, so in order to hand this request to the
* topreq thread, we need to gain one more
*/
node->subreq.req = req;
node->subreq.boc = HSH_RefBoc(req->objcore);
HSH_Ref(req->objcore);
node->subreq.oc = req->objcore;
AZ(req->objcore->flags & OC_F_FINAL);
push_vdps(req, vgzgz, gz);
AZ(VDP_Push(req, &vped_to_parent, parent->nexus.req));
AZ(pthread_cond_init(&node->subreq.cond, NULL));
node_mutate_prep(tree, node);
node_mutate_lock(tree, node, T_SUBREQ, ST_DATA);
node_mutate_unlock(tree);
/*
* to be done in the other thread:
* - VDP_DeliverObj()
* - VDP_close()
*
* from vped_task():
* - req_fini()
*/
return;
}
VSLdbg(req, "vped_deliver: ESI");
/* our caller, cnt_transmit(), releases the refs to boc and oc when we
* return, so in order to hand this request to the topreq thread, we
* need to gain one more
*/
node->subreq.req = req;
node->subreq.boc = HSH_RefBoc(req->objcore);
HSH_Ref(req->objcore);
node->subreq.oc = req->objcore;
VDP_Push(req, &VDP_pesi_buf, pesi);
push_vdps(req, vgzgz, gz);
AN(parent);
AZ(VDP_Push(req, &vped_to_parent, parent->nexus.req));
AZ(pthread_cond_init(&node->subreq.cond, NULL));
(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;
}
......
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