Commit 1196aa19 authored by claes's avatar claes

Changes in network data conversion to handle attributes of class-type

parent 76a0cab1
......@@ -78,7 +78,8 @@ cmvolc_GetCachedClass (
const gdb_sVolume *vp,
mvol_sAttribute *ap,
pwr_tBoolean *equal, /**< set if classes are equal then NULL is returned */
pwr_tBoolean *fetched /**< true if the class has been fected from the remote node */
pwr_tBoolean *fetched, /**< true if the class has been fected from the remote node */
gdb_sClass *cp
)
{
qcom_sQid tgt;
......@@ -93,6 +94,8 @@ cmvolc_GetCachedClass (
pwr_tUInt32 size;
pwr_tUInt32 nextIdx = 0;
pwr_tUInt32 stopIdx;
gdb_sObject *cop;
pwr_tTime time;
gdb_AssumeLocked;
......@@ -103,16 +106,20 @@ cmvolc_GetCachedClass (
/* Handle nodes that don't support cached classes */
if (!np->cclassSupport) {
*equal = 1;
if (cp == NULL) {
ap->op->u.c.flags.b.classChecked = 1;
ap->op->u.c.flags.b.classEqual = 1;
}
pwr_Return(NULL, sts, GDH__SUCCESS);
}
/** @todo Check vp->u.c.equalClasses first (when implemented) */
ccvKey.nid = np->nid;
if (cp == NULL)
ccvKey.vid = ap->op->g.cid >> 16; /* Class Id to Class Volume Id */
else
ccvKey.vid = cp->cid >> 16;
ccvp = hash_Search(sts, gdbroot->ccvol_ht, &ccvKey);
......@@ -121,28 +128,40 @@ cmvolc_GetCachedClass (
/** @todo Verify that this bugcheck is valid */
}
if (ccvp->equalClasses) {
/* If cp is not NULL then we always fetch the class */
if (ccvp->equalClasses && cp == NULL) {
*equal = 1;
ap->op->u.c.flags.b.classChecked = 1;
ap->op->u.c.flags.b.classEqual = 1;
pwr_Return(NULL, sts, GDH__SUCCESS);
}
if (cp != NULL) {
ccKey.cid = cp->cid;
cop = pool_Address(NULL, gdbroot->pool, cp->cor);
time = cop->u.n.time;
}
else {
ccKey.cid = ap->op->g.cid;
time = ap->cop->u.n.time;
}
ccKey.ccvoltime = ccvp->time;
ccp = hash_Search(sts, gdbroot->cclass_ht, &ccKey);
if (ccp != NULL) {
cmvolc_TouchClass(ccp);
if (time_Acomp(&ap->cop->u.n.time, &ccp->time) == 0) {
if (time_Acomp(&time, &ccp->time) == 0 && cp == NULL) {
*equal = 1;
ap->op->u.c.flags.b.classChecked = 1;
ap->op->u.c.flags.b.classEqual = 1;
pwr_Return(NULL, sts, GDH__SUCCESS);
} else {
if (cp == NULL) {
ap->op->u.c.flags.b.classChecked = 1;
ap->op->u.c.flags.b.classEqual = 0;
}
pwr_Return(ccp, sts, GDH__SUCCESS);
}
}
......@@ -151,6 +170,36 @@ cmvolc_GetCachedClass (
*fetched = 1;
/* If classes equal, create cached class */
if (ccvp->equalClasses && cp != NULL) {
*fetched = 0;
size = sizeof(*ccp) + (cp->acount - 1) * sizeof(ccp->attr[0]);
ccp = pool_Alloc(sts, gdbroot->pool, size);
if (ccp == NULL) {
return NULL;
}
*equal = 1;
ccp->size = cp->size;
ccp->time = time;
for (i = 0; i < cp->acount; i++) {
ccp->attr[i].aix = cp->attr[i].aix;
ccp->attr[i].flags = cp->attr[i].flags;
ccp->attr[i].type = cp->attr[i].type;
ccp->attr[i].offs = cp->attr[i].offs;
ccp->attr[i].size = cp->attr[i].size;
ccp->attr[i].elem = cp->attr[i].elem;
ccp->attr[i].moffset = cp->attr[i].moffset;
}
ccp->acount = cp->acount;
} else {
do {
gdb_Unlock;
......@@ -162,7 +211,7 @@ cmvolc_GetCachedClass (
tgt.qix = net_cProcHandler;
smp->ver = net_cVersion;
smp->cid = ccKey.cid;
smp->time = ap->cop->u.n.time;
smp->time = time;
smp->aidx = nextIdx;
rmp = net_Request(sts, &tgt, &put, NULL, net_eMsg_getCclassR);
......@@ -172,8 +221,10 @@ cmvolc_GetCachedClass (
gdb_Lock;
if (ccp == NULL) {
if (rmp->equal)
if (rmp->equal && cp == NULL)
size = sizeof(*ccp);
else if (rmp->equal && cp != NULL)
size = sizeof(*ccp) + (cp->acount - 1) * sizeof(ccp->attr[0]);
else
size = sizeof(*ccp) + (rmp->cclass.acount - 1) * sizeof(ccp->attr[0]);
......@@ -183,21 +234,37 @@ cmvolc_GetCachedClass (
return NULL;
}
if (rmp->equal) {
if (rmp->equal && cp == NULL) {
ccp->size = 0;
ccp->time = ap->cop->u.n.time;
ccp->time = time;
} else if (rmp->equal && cp != NULL) {
ccp->size = cp->size;
ccp->time = time;
} else {
ccp->size = rmp->cclass.size;
ccp->time = rmp->cclass.time;
}
}
if (rmp->equal) {
if (rmp->equal && cp == NULL) {
*equal = 1;
ccp->acount = 0;
} else if (rmp->equal && cp != NULL) {
*equal = 1;
for (i = 0; i < cp->acount; i++) {
ccp->attr[i].aix = cp->attr[i].aix;
ccp->attr[i].flags = cp->attr[i].flags;
ccp->attr[i].type = cp->attr[i].type;
ccp->attr[i].offs = cp->attr[i].offs;
ccp->attr[i].size = cp->attr[i].size;
ccp->attr[i].elem = cp->attr[i].elem;
ccp->attr[i].moffset = cp->attr[i].moffset;
}
ccp->acount = cp->acount;
} else {
nextIdx = rmp->naidx;
stopIdx = nextIdx != ULONG_MAX ? nextIdx : rmp->cclass.acount;
......@@ -212,16 +279,19 @@ cmvolc_GetCachedClass (
rmp = NULL;
} while(!*equal && nextIdx != ULONG_MAX);
}
ccp->key = ccKey;
ccp->flags.b.equal = *equal;
ccp = linkCclass(sts, ccp);
if (*equal)
if (*equal && cp == NULL)
ccp = NULL;
if (cp != NULL)
*equal = 0;
return ccp;
......
......@@ -31,7 +31,8 @@ cmvolc_GetCachedClass (
const gdb_sVolume *vp,
mvol_sAttribute *ap,
pwr_tBoolean *equal, /**< set if classes are equal then NULL is returned */
pwr_tBoolean *fetched /**< true if the class has been fected from the remote node */
pwr_tBoolean *fetched, /**< true if the class has been fected from the remote node */
gdb_sClass *cp
);
void
......
......@@ -109,6 +109,9 @@ cvolc_GetObjectInfo (
net_sGetObjectInfoR *rmp; /* Receive message. */
pwr_tBoolean equal;
ndc_sRemoteToNative *tbl = NULL;
pwr_tBoolean first = 1;
int rsize;
cdh_uTypeId cid;
gdb_AssumeUnlocked;
pwr_Assert(sts != NULL);
......@@ -137,7 +140,13 @@ cvolc_GetObjectInfo (
if (ODD(rmp->sts)) {
size = MIN(arp->Size, size);
if (ccp == NULL || equal) {
ndc_ConvertData(sts, np, arp, p, rmp->info, size, ndc_eOp_decode);
gdb_sClass *cp;
cid.pwr = arp->Body;
cid.c.bix = 0; /* To get the class id. */
cp = hash_Search(sts, gdbroot->cid_ht, &cid.pwr);
if (cp != NULL) {
ndc_ConvertData(sts, np, cp, arp, p, rmp->info, &size, ndc_eOp_decode, arp->Offset, 0);
}
} else {
if (!ccp->flags.b.rnConv && ap->aop == NULL) { /* whole object */
......@@ -152,7 +161,7 @@ cvolc_GetObjectInfo (
if (tbl == NULL)
break;
ndc_UpdateRemoteToNativeTable(sts, tbl, ap->cp->acount, ap->cp, ccp);
ndc_UpdateRemoteToNativeTable(sts, tbl, ap->cp->acount, ap->cp, ccp, np->nid);
if (ODD(*sts)) {
ccp->rnConv = pool_Reference(NULL, gdbroot->pool, tbl);
ccp->flags.b.rnConv = 1;
......@@ -165,7 +174,8 @@ cvolc_GetObjectInfo (
} gdb_ScopeUnlock;
}
ndc_ConvertRemoteData(sts, np, ccp, rarp, rmp->info, rmp->info, rarp->Size, ndc_eOp_decode);
rsize = rarp->Size;
ndc_ConvertRemoteData(sts, np, ccp, rarp, rmp->info, rmp->info, &rsize, ndc_eOp_decode, rarp->Offset, 0);
if (ODD(*sts)) {
if (ccp->flags.b.rnConv) {
if (tbl == NULL) {
......@@ -173,13 +183,16 @@ cvolc_GetObjectInfo (
if (tbl == NULL)
errh_Bugcheck(*sts, "failed getting address for conversion table");
}
gdb_ScopeLock {
ndc_ConvertRemoteToNativeTable(sts, ccp, tbl, rarp,
arp, p, rmp->info, size);
arp, p, rmp->info, &size,
arp->Offset, 0, 0, &first, np->nid);
} gdb_ScopeUnlock;
} else {
/* The object pointer may be invalid after gdb has been open, reset it */
ap->op = NULL;
ndc_ConvertRemoteToNativeData(sts, ccp, ridx, ap, rarp, arp, p, rmp->info, size);
ndc_ConvertRemoteToNativeData(sts, ccp, ridx, ap, rarp, arp, p, rmp->info, &size, arp->Offset, 0, 0, np->nid);
}
}
}
......@@ -364,6 +377,8 @@ cvolc_SetObjectInfo (
int msize;
net_sSetObjectInfoR *rmp;
pwr_tBoolean equal;
int rsize;
cdh_uTypeId cid;
gdb_AssumeUnlocked;
......@@ -389,14 +404,22 @@ cvolc_SetObjectInfo (
smp->size = rarp->Size;
smp->aref = *rarp;
if (equal)
ndc_ConvertData(sts, np, arp, smp->info, p, size, ndc_eOp_encode);
else {
if (equal) {
gdb_sClass *cp;
cid.pwr = arp->Body;
cid.c.bix = 0; /* To get the class id. */
cp = hash_Search(sts, gdbroot->cid_ht, &cid.pwr);
if (cp != NULL) {
ndc_ConvertData(sts, np, cp, arp, smp->info, p, &size, ndc_eOp_encode, arp->Offset, 0);
}
} else {
/* The object pointer may be invalid after gdb has been open, reset it */
ap->op = NULL;
ndc_ConvertNativeToRemoteData(sts, ccp, ridx, ap, rarp, arp, smp->info, p, rarp->Size);
rsize = rarp->Size;
ndc_ConvertNativeToRemoteData(sts, ccp, ridx, ap, rarp, arp, smp->info, p, &rsize, rarp->Offset, 0, 0, np->nid);
if (ODD(*sts)) {
ndc_ConvertRemoteData(sts, np, ccp, rarp, smp->info, smp->info, rarp->Size, ndc_eOp_encode);
rsize = rarp->Size;
ndc_ConvertRemoteData(sts, np, ccp, rarp, smp->info, smp->info, &rsize, ndc_eOp_encode, rarp->Offset, 0);
}
if (EVEN(*sts)) {
net_Free(NULL, smp);
......
......@@ -227,6 +227,8 @@ cvolsm_GetObjectInfo (
net_sGetObjectInfo *mp = get->data;
qcom_sPut put;
gdb_sNode *np;
cdh_uTypeId cid;
gdb_sClass *cp;
gdb_AssumeUnlocked;
......@@ -247,9 +249,14 @@ cvolsm_GetObjectInfo (
} gdb_ScopeUnlock;
if (p != NULL)
ndc_ConvertData(&sts, np, &mp->aref, rmp->info, p, mp->aref.Size, ndc_eOp_encode);
if (p != NULL) {
size = mp->aref.Size;
cid.pwr = mp->aref.Body;
cid.c.bix = 0; /* To get the class id. */
cp = hash_Search(&sts, gdbroot->cid_ht, &cid.pwr);
if (cp != NULL)
ndc_ConvertData(&sts, np, cp, &mp->aref, rmp->info, p, &size, ndc_eOp_encode, mp->aref.Offset, 0);
}
rmp->aref = mp->aref;
rmp->sts = sts;
rmp->size = mp->aref.Size;
......@@ -349,6 +356,9 @@ cvolsm_SetObjectInfo (
qcom_sPut put;
net_sSetObjectInfo *mp = get->data;
gdb_sNode *np;
int size;
cdh_uTypeId cid;
gdb_sClass *cp;
gdb_AssumeUnlocked;
......@@ -367,8 +377,14 @@ cvolsm_SetObjectInfo (
} gdb_ScopeUnlock;
if (p != NULL)
ndc_ConvertData(&sts, np, &mp->aref, p, mp->info, mp->aref.Size, ndc_eOp_decode);
if (p != NULL) {
size = mp->aref.Size;
cid.pwr = mp->aref.Body;
cid.c.bix = 0; /* To get the class id. */
cp = hash_Search(&sts, gdbroot->cid_ht, &cid.pwr);
if (cp != NULL)
ndc_ConvertData(&sts, np, cp, &mp->aref, p, mp->info, &size, ndc_eOp_decode, mp->aref.Offset, 0);
}
rmp->aref = mp->aref;
rmp->sts = sts;
......
......@@ -605,7 +605,7 @@ gdh_GetObjectInfo (
ccp = NULL;
/* Get cached class if needed */
if (!ap->op->u.c.flags.b.classChecked || !ap->op->u.c.flags.b.classEqual) {
ccp = cmvolc_GetCachedClass(&sts, np, vp, ap, &equal, &fetched);
ccp = cmvolc_GetCachedClass(&sts, np, vp, ap, &equal, &fetched, NULL);
if (EVEN(sts)) {
np = NULL;
break;
......@@ -630,7 +630,7 @@ gdh_GetObjectInfo (
if (equal)
break;
rarp = ndc_NarefToRaref(&sts, ap, arp, ccp, &ridx, &raref, &equal);
rarp = ndc_NarefToRaref(&sts, ap, arp, ccp, &ridx, &raref, &equal, pn, ccpLocked, vp, np);
}
break;
} while (1);
......@@ -717,7 +717,7 @@ gdh_GetObjectInfoAttrref (
ccp = NULL;
/* Get cached class if needed */
if (!ap->op->u.c.flags.b.classChecked || !ap->op->u.c.flags.b.classEqual) {
ccp = cmvolc_GetCachedClass(&sts, np, vp, ap, &equal, &fetched);
ccp = cmvolc_GetCachedClass(&sts, np, vp, ap, &equal, &fetched, NULL);
if (EVEN(sts)) {
np = NULL;
break;
......@@ -740,7 +740,7 @@ gdh_GetObjectInfoAttrref (
if (equal)
break;
rarp = ndc_NarefToRaref(&sts, ap, arp, ccp, &ridx, &raref, &equal);
rarp = ndc_NarefToRaref(&sts, ap, arp, ccp, &ridx, &raref, &equal, NULL, ccpLocked, vp, np);
}
break;
......@@ -2062,7 +2062,7 @@ gdh_SetObjectInfo (
ccp = NULL;
/* Get cached class if needed */
if (!ap->op->u.c.flags.b.classChecked || !ap->op->u.c.flags.b.classEqual) {
ccp = cmvolc_GetCachedClass(&sts, np, vp, ap, &equal, &fetched);
ccp = cmvolc_GetCachedClass(&sts, np, vp, ap, &equal, &fetched, NULL);
if (EVEN(sts)) {
np = NULL;
break;
......@@ -2087,7 +2087,7 @@ gdh_SetObjectInfo (
if (equal)
break;
rarp = ndc_NarefToRaref(&sts, ap, arp, ccp, &ridx, &raref, &equal);
rarp = ndc_NarefToRaref(&sts, ap, arp, ccp, &ridx, &raref, &equal, pn, ccpLocked, vp, np);
}
break;
......@@ -2175,7 +2175,7 @@ gdh_SetObjectInfoAttrref (
ccp = NULL;
/* Get cached class if needed */
if (!ap->op->u.c.flags.b.classChecked || !ap->op->u.c.flags.b.classEqual) {
ccp = cmvolc_GetCachedClass(&sts, np, vp, ap, &equal, &fetched);
ccp = cmvolc_GetCachedClass(&sts, np, vp, ap, &equal, &fetched, NULL);
if (EVEN(sts)) {
np = NULL;
break;
......@@ -2198,7 +2198,7 @@ gdh_SetObjectInfoAttrref (
if (equal)
break;
rarp = ndc_NarefToRaref(&sts, ap, arp, ccp, &ridx, &raref, &equal);
rarp = ndc_NarefToRaref(&sts, ap, arp, ccp, &ridx, &raref, &equal, NULL, ccpLocked, vp, np);
}
break;
......@@ -2510,6 +2510,8 @@ gdh_SubData (
if (cp->cclass != pool_cNRef) {
gdb_sCclass *ccp;
ndc_sRemoteToNative *tbl;
pwr_tUInt32 size;
pwr_tBoolean first = 1;
ccp = pool_Address(NULL, gdbroot->pool, cp->cclass);
if (ccp == NULL) errh_Bugcheck(GDH__WEIRD, "gdh_SubData, get cached class address");
......@@ -2519,7 +2521,8 @@ gdh_SubData (
tbl = pool_Address(NULL, gdbroot->pool, ccp->rnConv);
if (tbl == NULL)errh_Bugcheck(GDH__WEIRD, "gdh_SubData, get cached class address");
ndc_ConvertRemoteToNativeTable(&sts, ccp, tbl, &cp->raref, &cp->aref, bp, p, MIN(bsize, cp->aref.Size));
size = MIN(bsize, cp->aref.Size);
ndc_ConvertRemoteToNativeTable(&sts, ccp, tbl, &cp->raref, &cp->aref, bp, p, &size, cp->aref.Offset, 0, 0, &first, cp->nid);
} else
memcpy(bp, p, MIN(bsize, cp->aref.Size));
......
......@@ -193,6 +193,7 @@ mvol_AnameToAttribute (
ap->adef = NULL;
ap->idx = ULONG_MAX;
} else {
acp = ap->cp;
abop = ap->bop;
acp = ap->cp;
for ( i = 0; i < pn->nAttribute; i++) {
......
This diff is collapsed.
......@@ -50,11 +50,14 @@ pwr_tBoolean
ndc_ConvertData (
pwr_tStatus *sts,
const gdb_sNode *np,
gdb_sClass *cp,
const pwr_sAttrRef *arp,
void *tp, /* Address of target. */
const void *sp, /* Address of source. */
pwr_tUInt32 size, /* Size of source. */
ndc_eOp op
pwr_tUInt32 *size, /* Size of source. */
ndc_eOp op,
pwr_tUInt32 offset,
pwr_tUInt32 offs
);
/**
......@@ -71,7 +74,11 @@ ndc_ConvertNativeToRemoteData (
const pwr_sAttrRef *narp, /**< Native attribute reference */
void *tp, /**< Address of target. */
const void *sp, /**< Address of source. */
pwr_tUInt32 size /**< Size of target buffer. */
pwr_tUInt32 *size, /**< Size of target buffer. */
pwr_tUInt32 offset, /**< Offset in class */
pwr_tUInt32 toffs, /**< Offset i ntarget buffer */
pwr_tUInt32 soffs, /**< Offset i source buffer */
pwr_tNodeId nid /**< Node id */
);
/**
......@@ -85,8 +92,10 @@ ndc_ConvertRemoteData (
const pwr_sAttrRef *arp,
void *tp, /* Address of target. */
const void *sp, /* Address of source. */
pwr_tUInt32 size, /* Size of source. */
ndc_eOp op
pwr_tUInt32 *size, /* Size of source. */
ndc_eOp op,
pwr_tUInt32 offset, /**< Offset to attribute in class. */
pwr_tUInt32 offs /**< Offset in buffer. */
);
......@@ -105,7 +114,11 @@ ndc_ConvertRemoteToNativeData (
const pwr_sAttrRef *narp, /**< Native attribute reference */
void *tp, /**< Address of target. */
const void *sp, /**< Address of source. */
pwr_tUInt32 size /**< Size of target buffer. */
pwr_tUInt32 *size, /**< Size of target buffer. */
pwr_tUInt32 offset, /**< Offset in class */
pwr_tUInt32 toffs, /**< Offset i ntarget buffer */
pwr_tUInt32 soffs, /**< Offset i source buffer */
pwr_tNodeId nid /**< Node id */
);
/**
......@@ -121,7 +134,12 @@ ndc_ConvertRemoteToNativeTable (
const pwr_sAttrRef *narp, /**< Native attribute reference */
void *tp, /**< Address of target. */
const void *sp, /**< Address of source. */
pwr_tUInt32 size /**< Size of target buffer. */
pwr_tUInt32 *size, /**< Size of target buffer. */
pwr_tUInt32 offset, /**< Offset to attribute in class. */
pwr_tUInt32 toffs, /**< Offset in target buffer. */
pwr_tUInt32 soffs, /**< Offset in source buffer. */
pwr_tBoolean *first, /**< First scan. */
pwr_tNodeId nid /**< Node id */
);
......@@ -133,12 +151,16 @@ ndc_ConvertRemoteToNativeTable (
pwr_sAttrRef *
ndc_NarefToRaref(
pwr_tStatus *sts, /**< Status */
const mvol_sAttribute *ap, /**< Native mvol attribute */
const pwr_sAttrRef *narp, /**< Native attribute reference */
const gdb_sCclass *ccp, /**< Cached class */
pwr_tUInt32 *ridx, /**< Attribute index in ccp or UINT_LONG if whole object*/
mvol_sAttribute *ap, /**< Native mvol attribute */
pwr_sAttrRef *narp, /**< Native attribute reference */
gdb_sCclass *ccp, /**< Cached class */
pwr_tUInt32 *ridx, /**< Attribute index in ccp or UINT_LONG if whole object */
pwr_sAttrRef *rarp, /**< Remote attribute reference */
pwr_tBoolean *equal /**< Set if the attribute references are equal */
pwr_tBoolean *equal, /**< Set if the attribute references are equal, not checked if whole object */
cdh_sParseName *pn, /**< Not NULL if called from Get-/SetObjectInfo */
gdb_sCclass *ccpLocked,
gdb_sVolume *vp,
gdb_sNode *np
);
ndc_sRemoteToNative *
......@@ -147,7 +169,8 @@ ndc_UpdateRemoteToNativeTable(
ndc_sRemoteToNative *tbl,
pwr_tUInt32 tcnt, /**< # table entries */
const gdb_sClass *cp,
const gdb_sCclass *ccp
const gdb_sCclass *ccp,
pwr_tNodeId nid
);
......
......@@ -180,6 +180,7 @@ testClient (
pwr_sAttrRef *arp;
pwr_sAttrRef *rarp;
gdb_sCclass *ccp;
gdb_sCclass *ccpLocked;
pool_tRef ccr;
pwr_tUInt32 ridx;
pwr_tBoolean equal;
......@@ -217,7 +218,7 @@ testClient (
/* Get cached class if needed */
if (!op->u.c.flags.b.classChecked || !op->u.c.flags.b.classEqual) {
ccp = cmvolc_GetCachedClass(&lsts, np, vp, ap, &equal, &fetched);
ccp = cmvolc_GetCachedClass(&lsts, np, vp, ap, &equal, &fetched, NULL);
if (EVEN(lsts)) {
np = NULL;
op = NULL;
......@@ -298,7 +299,7 @@ testClient (
if (!op->u.c.flags.b.classChecked || !op->u.c.flags.b.classEqual) {
ap = vol_ArefToAttribute(&lsts, &attribute, &cp->aref, gdb_mLo_global, vol_mTrans_all);
if (ap == NULL) break;
ccp = cmvolc_GetCachedClass(&lsts, np, vp, ap, &equal, &fetched);
ccp = cmvolc_GetCachedClass(&lsts, np, vp, ap, &equal, &fetched, NULL);
if (EVEN(lsts)) {
np = NULL;
op = NULL;
......@@ -363,9 +364,10 @@ testClient (
np = pool_Address(NULL, gdbroot->pool, vp->l.nr);
if (!equal) {
rarp = ndc_NarefToRaref(sts, ap, arp, ccp, &ridx, &cp->raref, &equal);
ccpLocked = ccp;
rarp = ndc_NarefToRaref(sts, ap, arp, ccp, &ridx, &cp->raref, &equal, NULL, ccpLocked, vp, np );
if (rarp == NULL || equal) {
if (ccp->flags.b.cacheLock)
cmvolc_UnlockClass(NULL, ccp);
cp->cclass = pool_cNRef;
if (rarp == NULL)
......@@ -378,7 +380,7 @@ testClient (
tbl = pool_Alloc(sts, gdbroot->pool, sizeof(*tbl) * c->acount);
ndc_UpdateRemoteToNativeTable(sts, tbl, c->acount, c, ccp);
ndc_UpdateRemoteToNativeTable(sts, tbl, c->acount, c, ccp, np->nid);
if (ODD(*sts)) {
ccp->rnConv = pool_Reference(NULL, gdbroot->pool, tbl);
ccp->flags.b.rnConv = 1;
......
......@@ -111,6 +111,7 @@ subcm_Data (
qcom_sQid tgt;
gdb_sCclass *ccp;
ndc_sRemoteToNative *tbl;
int rsize;
clock_gettime(CLOCK_REALTIME, &curtim);
......@@ -180,15 +181,26 @@ subcm_Data (
refcount++;
if (1 || mp->msg.hdr.xdr) {
if (cp->cclass == pool_cNRef)
ndc_ConvertData(&sts, np, &cp->aref, dp->data, dp->data, dp->size, ndc_eOp_decode);
if (cp->cclass == pool_cNRef) {
gdb_sClass *classp;
cdh_uTypeId cid;
cid.pwr = cp->aref.Body;
cid.c.bix = 0; /* To get the class id. */
classp = hash_Search(&sts, gdbroot->cid_ht, &cid.pwr);
rsize = dp->size;
if (classp != NULL)
ndc_ConvertData(&sts, np, classp, &cp->aref, dp->data, dp->data, &rsize, ndc_eOp_decode, cp->aref.Offset, 0);
}
else {
cp->old = TRUE;
ccp = pool_Address(&cp->sts, gdbroot->pool, cp->cclass);
if (ccp != NULL) {
tbl = pool_Address(&cp->sts, gdbroot->pool, ccp->rnConv);
if (tbl != NULL) {
ndc_ConvertRemoteData(&cp->sts, np, ccp, &cp->raref, dp->data, dp->data, dp->size, ndc_eOp_decode);
rsize = dp->size;
ndc_ConvertRemoteData(&cp->sts, np, ccp, &cp->raref, dp->data, dp->data, &rsize, ndc_eOp_decode, cp->raref.Offset, 0);
if (ODD(cp->sts))
cp->old = FALSE;
}
......@@ -207,7 +219,10 @@ subcm_Data (
if (cp->cclass == pool_cNRef)
memcpy(adrs, dp->data, MIN(dp->size, cp->usersize));
else if (!cp->old) {
ndc_ConvertRemoteToNativeTable(&cp->sts, ccp, tbl, &cp->raref, &cp->aref, adrs, dp->data, cp->usersize);
pwr_tUInt32 size = cp->usersize;
pwr_tBoolean first = 1;
ndc_ConvertRemoteToNativeTable(&cp->sts, ccp, tbl, &cp->raref, &cp->aref, adrs, dp->data, &size,
cp->aref.Offset, 0, 0, &first, np->nid);
if (EVEN(cp->sts))
cp->old = TRUE;
}
......
......@@ -284,6 +284,8 @@ subsm_SendBuffer (
pwr_tBoolean remote = (bp->nid != gdbroot->db->nid);
pool_sQlink *sl;
void *data;
gdb_sClass *classp;
cdh_uTypeId cid;
gdb_AssumeLocked;
......@@ -363,7 +365,12 @@ subsm_SendBuffer (
dp->sts = sp->sts;
if (ODD(sp->sts)) {
ndc_ConvertData(&dp->sts, np, &sp->aref, dp->data, data, sp->aref.Size, ndc_eOp_encode);
size = sp->aref.Size;
cid.pwr = sp->aref.Body;
cid.c.bix = 0; /* To get the class id. */
classp = hash_Search(&sts, gdbroot->cid_ht, &cid.pwr);
if (classp == NULL)
ndc_ConvertData(&dp->sts, np, classp, &sp->aref, dp->data, data, &size, ndc_eOp_encode, sp->aref.Offset, 0);
sp->count++;
mp->count++;
}
......
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