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