Commit 6aa6d311 authored by claes's avatar claes

Added a parameter to qdb_Get to make multible pool-buffered get's possible if...

Added a parameter to qdb_Get to make multible pool-buffered get's possible if needed without freeing previous buffer
parent 2e6884c1
/* /*
* Proview $Id: rt_cmvolc.c,v 1.8 2006-02-10 07:03:44 claes Exp $ * Proview $Id: rt_cmvolc.c,v 1.9 2006-02-10 14:40:45 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -229,7 +229,7 @@ cmvolc_GetCachedClass ( ...@@ -229,7 +229,7 @@ cmvolc_GetCachedClass (
smp->time = time; smp->time = time;
smp->aidx = nextIdx; smp->aidx = nextIdx;
rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_getCclassR); rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_getCclassR, NO);
if (rmp == NULL || EVEN(rmp->sts)) if (rmp == NULL || EVEN(rmp->sts))
goto netError; goto netError;
...@@ -393,7 +393,7 @@ cmvolc_GetNonExistingClass ( ...@@ -393,7 +393,7 @@ cmvolc_GetNonExistingClass (
smp->cid = cid; smp->cid = cid;
smp->aidx = nextIdx; smp->aidx = nextIdx;
rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_getGclassR); rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_getGclassR, YES);
if (rmp == NULL || EVEN(rmp->sts)) if (rmp == NULL || EVEN(rmp->sts))
goto netError; goto netError;
......
/* /*
* Proview $Id: rt_cvolc.c,v 1.5 2005-12-13 15:14:27 claes Exp $ * Proview $Id: rt_cvolc.c,v 1.6 2006-02-10 14:40:45 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -75,7 +75,7 @@ fetch ( ...@@ -75,7 +75,7 @@ fetch (
gdb_Unlock; gdb_Unlock;
rsp = net_Request(&lsts, &tgt, put, &get, net_eMsg_objectR); rsp = net_Request(&lsts, &tgt, put, &get, net_eMsg_objectR, NO);
gdb_Lock; gdb_Lock;
...@@ -146,7 +146,7 @@ cvolc_GetObjectInfo ( ...@@ -146,7 +146,7 @@ cvolc_GetObjectInfo (
tgt.qix = net_cProcHandler; tgt.qix = net_cProcHandler;
smp->aref = *rarp; smp->aref = *rarp;
rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_getObjectInfoR); rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_getObjectInfoR, NO);
if (rmp == NULL) { if (rmp == NULL) {
return NULL; return NULL;
...@@ -240,7 +240,7 @@ cvolc_GetObjectInfo ( ...@@ -240,7 +240,7 @@ cvolc_GetObjectInfo (
tgt.qix = net_cProcHandler; tgt.qix = net_cProcHandler;
smp->aref = *arp; smp->aref = *arp;
rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_getObjectInfoR); rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_getObjectInfoR, NO);
if (rmp == NULL) { if (rmp == NULL) {
return NULL; return NULL;
...@@ -441,7 +441,7 @@ cvolc_SetObjectInfo ( ...@@ -441,7 +441,7 @@ cvolc_SetObjectInfo (
} }
} }
rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_setObjectInfoR); rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_setObjectInfoR, NO);
if (rmp == NULL) { if (rmp == NULL) {
return NO; return NO;
......
/* /*
* Proview $Id: rt_mh_appl.c,v 1.5 2006-01-13 16:32:39 claes Exp $ * Proview $Id: rt_mh_appl.c,v 1.6 2006-02-10 14:40:45 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB. * Copyright (C) 2005 SSAB Oxelösund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -361,7 +361,7 @@ sendAndReceive ( ...@@ -361,7 +361,7 @@ sendAndReceive (
get.data = NULL; get.data = NULL;
rvoid = qcom_Request(&sts, &lAppl.handler, &put, &lAppl.head.qid, &get, 1000*3600); rvoid = qcom_Request(&sts, &lAppl.handler, &put, &lAppl.head.qid, &get, 1000*3600, NO);
if (EVEN(sts)) { if (EVEN(sts)) {
errh_Error("mhAppl, sendAndReceive, qcom_Get failed\n%m", sts); errh_Error("mhAppl, sendAndReceive, qcom_Get failed\n%m", sts);
qcom_Free(NULL, put.data); qcom_Free(NULL, put.data);
......
/* /*
* Proview $Id: rt_net.c,v 1.5 2005-09-01 14:57:56 claes Exp $ * Proview $Id: rt_net.c,v 1.6 2006-02-10 14:40:45 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -146,7 +146,8 @@ Request ( ...@@ -146,7 +146,8 @@ Request (
qcom_sQid *tgt, qcom_sQid *tgt,
qcom_sPut *put, qcom_sPut *put,
qcom_sGet *get, qcom_sGet *get,
net_eMsg subtype net_eMsg subtype,
pwr_tBoolean multipleReq
); );
typedef bool_t (*tFuncXdr)(XDR*, void*); typedef bool_t (*tFuncXdr)(XDR*, void*);
...@@ -484,7 +485,8 @@ Request ( ...@@ -484,7 +485,8 @@ Request (
qcom_sQid *tgt, qcom_sQid *tgt,
qcom_sPut *put, qcom_sPut *put,
qcom_sGet *get, qcom_sGet *get,
net_eMsg subtype net_eMsg subtype,
pwr_tBoolean multipleReq
) )
{ {
void *gmp; void *gmp;
...@@ -503,7 +505,7 @@ Request ( ...@@ -503,7 +505,7 @@ Request (
if (!ConvertPut(sts, tgt, put, put->data)) if (!ConvertPut(sts, tgt, put, put->data))
return NULL; return NULL;
gmp = qcom_Request(sts, tgt, put, &gdbroot->my_qid, get, net_cSendRcvTmo); gmp = qcom_Request(sts, tgt, put, &gdbroot->my_qid, get, net_cSendRcvTmo, multipleReq);
if (gmp == NULL) if (gmp == NULL)
return NULL; return NULL;
...@@ -663,7 +665,8 @@ net_Request ( ...@@ -663,7 +665,8 @@ net_Request (
qcom_sQid *tgt, qcom_sQid *tgt,
qcom_sPut *put, qcom_sPut *put,
qcom_sGet *get, qcom_sGet *get,
net_eMsg gtype net_eMsg gtype,
pwr_tBoolean multipleReq
) )
{ {
void *p; void *p;
...@@ -675,7 +678,7 @@ net_Request ( ...@@ -675,7 +678,7 @@ net_Request (
((net_sMessage *)put->data)->nid = gdbroot->db->nid; ((net_sMessage *)put->data)->nid = gdbroot->db->nid;
NET_LOCK; NET_LOCK;
p = Request(sts, tgt, put, get, gtype); p = Request(sts, tgt, put, get, gtype, multipleReq);
NET_UNLOCK; NET_UNLOCK;
return p; return p;
......
#ifdef RPC_HDR #ifdef RPC_HDR
%/* %/*
% * Proview $Id: rt_net.x,v 1.7 2005-09-01 14:57:56 claes Exp $ % * Proview $Id: rt_net.x,v 1.8 2006-02-10 14:40:45 claes Exp $
% * Copyright (C) 2005 SSAB Oxelsund AB. % * Copyright (C) 2005 SSAB Oxelsund AB.
% * % *
% * This program is free software; you can redistribute it and/or % * This program is free software; you can redistribute it and/or
...@@ -1300,11 +1300,12 @@ struct net_sGetCclass { ...@@ -1300,11 +1300,12 @@ struct net_sGetCclass {
% %
%void * %void *
%net_Request ( %net_Request (
% pwr_tStatus *sts, % pwr_tStatus *sts,
% qcom_sQid *tgt, % qcom_sQid *tgt,
% qcom_sPut *put, % qcom_sPut *put,
% qcom_sGet *get, % qcom_sGet *get,
% net_eMsg gtype % net_eMsg gtype,
% pwr_tBoolean multipleReq
%); %);
% %
%pwr_tBoolean %pwr_tBoolean
......
/* /*
* Proview $Id: rt_qcom.c,v 1.5 2005-12-13 15:14:27 claes Exp $ * Proview $Id: rt_qcom.c,v 1.6 2006-02-10 14:40:45 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -404,7 +404,7 @@ qcom_Get ( ...@@ -404,7 +404,7 @@ qcom_Get (
if (qp->aid.aix != qdb->my_aix) pwr_StatusBreak(*sts, QCOM__NOTOWNED); if (qp->aid.aix != qdb->my_aix) pwr_StatusBreak(*sts, QCOM__NOTOWNED);
if (qp->type != qdb_eQue_private) pwr_StatusBreak(*sts, QCOM__NOTOWNED); if (qp->type != qdb_eQue_private) pwr_StatusBreak(*sts, QCOM__NOTOWNED);
bp = qdb_Get(sts, qp, tmo, gp); bp = qdb_Get(sts, qp, tmo, gp, NO);
if (bp != NULL) { if (bp != NULL) {
qdb->ap->get_count++; qdb->ap->get_count++;
...@@ -948,7 +948,8 @@ qcom_Request ( ...@@ -948,7 +948,8 @@ qcom_Request (
qcom_sPut *pp, qcom_sPut *pp,
const qcom_sQid *gqid, const qcom_sQid *gqid,
qcom_sGet *gp, qcom_sGet *gp,
int tmo int tmo,
pwr_tBoolean multipleReq
) )
{ {
qdb_sBuffer *pbp; qdb_sBuffer *pbp;
...@@ -1008,7 +1009,7 @@ qcom_Request ( ...@@ -1008,7 +1009,7 @@ qcom_Request (
pbp->b.noderef = pool_Reference(sts, &qdb->pool, np); pbp->b.noderef = pool_Reference(sts, &qdb->pool, np);
} }
gbp = qdb_Request(sts, pbp, pqp, gqp, tmo, gp); gbp = qdb_Request(sts, pbp, pqp, gqp, tmo, gp, multipleReq);
if (ODD(sts)) qdb->ap->request_count++; if (ODD(sts)) qdb->ap->request_count++;
} qdb_ScopeUnlock; } qdb_ScopeUnlock;
......
/* /*
* Proview $Id: rt_qcom.h,v 1.6 2006-01-13 16:32:39 claes Exp $ * Proview $Id: rt_qcom.h,v 1.7 2006-02-10 14:40:45 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -413,7 +413,8 @@ void* qcom_Request ( ...@@ -413,7 +413,8 @@ void* qcom_Request (
qcom_sPut *put, qcom_sPut *put,
const qcom_sQid *myQ, const qcom_sQid *myQ,
qcom_sGet *get, qcom_sGet *get,
int tmo_ms int tmo_ms,
pwr_tBoolean multipleReq
); );
pwr_tBoolean qcom_Unbind ( pwr_tBoolean qcom_Unbind (
......
/* /*
* Proview $Id: rt_qdb.c,v 1.8 2006-02-10 07:02:41 claes Exp $ * Proview $Id: rt_qdb.c,v 1.9 2006-02-10 14:40:45 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -929,7 +929,8 @@ qdb_Get ( ...@@ -929,7 +929,8 @@ qdb_Get (
pwr_tStatus *status, pwr_tStatus *status,
qdb_sQue *qp, qdb_sQue *qp,
int tmo, int tmo,
qcom_sGet *gp qcom_sGet *gp,
pwr_tBoolean multipleGet
) )
{ {
pwr_tStatus csts; pwr_tStatus csts;
...@@ -940,8 +941,8 @@ qdb_Get ( ...@@ -940,8 +941,8 @@ qdb_Get (
qdb_AssumeLocked; qdb_AssumeLocked;
// if (!pool_QisEmpty(sts, &qdb->pool, &qp->read_lh)) if (!multipleGet && !pool_QisEmpty(sts, &qdb->pool, &qp->read_lh))
// pwr_Return(NULL, sts, QCOM__ALLOCQUOTA); pwr_Return(NULL, sts, QCOM__ALLOCQUOTA);
bp = qdb_Deque(sts, qp, tmo); bp = qdb_Deque(sts, qp, tmo);
if (bp == NULL) return NULL; if (bp == NULL) return NULL;
...@@ -1161,7 +1162,8 @@ qdb_Request ( ...@@ -1161,7 +1162,8 @@ qdb_Request (
qdb_sQue *pqp, qdb_sQue *pqp,
qdb_sQue *gqp, qdb_sQue *gqp,
int tmo, int tmo,
qcom_sGet *gp qcom_sGet *gp,
pwr_tBoolean multipleReq
) )
{ {
qdb_sBuffer *gbp = NULL; qdb_sBuffer *gbp = NULL;
...@@ -1191,7 +1193,7 @@ qdb_Request ( ...@@ -1191,7 +1193,7 @@ qdb_Request (
gqp->flags.b.reply = 1; gqp->flags.b.reply = 1;
if (!qdb_Enque(sts, pbp, pqp)) if (!qdb_Enque(sts, pbp, pqp))
return NULL; return NULL;
gbp = qdb_Get(sts, gqp, tmo, gp); gbp = qdb_Get(sts, gqp, tmo, gp, multipleReq);
gqp->flags.b.reply = 0; gqp->flags.b.reply = 0;
if (!pbp->c.flags.b.remote) if (!pbp->c.flags.b.remote)
return gbp; return gbp;
......
/* /*
* Proview $Id: rt_qdb.h,v 1.6 2005-09-01 14:57:56 claes Exp $ * Proview $Id: rt_qdb.h,v 1.7 2006-02-10 14:40:45 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -753,7 +753,7 @@ void qdb_Eput (pwr_tStatus*, qdb_sQue*); ...@@ -753,7 +753,7 @@ void qdb_Eput (pwr_tStatus*, qdb_sQue*);
pwr_tBoolean qdb_Signal (pwr_tStatus*, qdb_sQue*); pwr_tBoolean qdb_Signal (pwr_tStatus*, qdb_sQue*);
int qdb_Wait (pwr_tStatus*, qdb_sQue*, qdb_sQue*, int); int qdb_Wait (pwr_tStatus*, qdb_sQue*, qdb_sQue*, int);
void qdb_Free (pwr_tStatus*, qdb_sBuffer*); void qdb_Free (pwr_tStatus*, qdb_sBuffer*);
qdb_sBuffer * qdb_Get (pwr_tStatus*, qdb_sQue*, int, qcom_sGet*); qdb_sBuffer * qdb_Get (pwr_tStatus*, qdb_sQue*, int, qcom_sGet*, pwr_tBoolean multipleGet);
qdb_sQbond * qdb_GetBond (pwr_tStatus*, qdb_sQue*, qdb_sQue*); qdb_sQbond * qdb_GetBond (pwr_tStatus*, qdb_sQue*, qdb_sQue*);
void qdb_GetInfo (qcom_sGet*, qdb_sBuffer*); void qdb_GetInfo (qcom_sGet*, qdb_sBuffer*);
qdb_sLocal * qdb_MapDb (pwr_tStatus*); qdb_sLocal * qdb_MapDb (pwr_tStatus*);
...@@ -765,7 +765,7 @@ void qdb_RemoveAppl (pwr_tStatus*, qdb_sAppl*); ...@@ -765,7 +765,7 @@ void qdb_RemoveAppl (pwr_tStatus*, qdb_sAppl*);
void qdb_PutInfo (qdb_sBuffer*, qcom_sPut *, const qcom_sQid*, qcom_tRid); void qdb_PutInfo (qdb_sBuffer*, qcom_sPut *, const qcom_sQid*, qcom_tRid);
pwr_tBoolean qdb_RemoveQue (pwr_tStatus*, qdb_sQue*); pwr_tBoolean qdb_RemoveQue (pwr_tStatus*, qdb_sQue*);
qdb_sQue * qdb_Que (pwr_tStatus*, const qcom_sQid*, qdb_sNode**); qdb_sQue * qdb_Que (pwr_tStatus*, const qcom_sQid*, qdb_sNode**);
void * qdb_Request (pwr_tStatus*, qdb_sBuffer*, qdb_sQue*, qdb_sQue*, int, qcom_sGet*); void * qdb_Request (pwr_tStatus*, qdb_sBuffer*, qdb_sQue*, qdb_sQue*, int, qcom_sGet*, pwr_tBoolean);
void qdb_DumpPool (); void qdb_DumpPool ();
#endif #endif
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