Commit 986d9e13 authored by claes's avatar claes

Fix to load unknown class from remote node

parent 14d2ac10
...@@ -322,7 +322,8 @@ netError: ...@@ -322,7 +322,8 @@ netError:
void void
cmvolc_GetNonExistingClass ( cmvolc_GetNonExistingClass (
pwr_tStatus *sts, pwr_tStatus *sts,
gdb_sObject *op gdb_sObject *op,
pwr_tCid cid
) )
{ {
...@@ -336,7 +337,6 @@ cmvolc_GetNonExistingClass ( ...@@ -336,7 +337,6 @@ cmvolc_GetNonExistingClass (
net_sGetGclassR *rmp = NULL; /* Receive message. */ net_sGetGclassR *rmp = NULL; /* Receive message. */
int i, j; int i, j;
pwr_tUInt32 nextIdx = 0; pwr_tUInt32 nextIdx = 0;
pwr_tClassId cid;
pwr_tVolumeId cvid; pwr_tVolumeId cvid;
gdb_sClass *cp; gdb_sClass *cp;
gdb_sVolume *vp; gdb_sVolume *vp;
...@@ -356,8 +356,6 @@ cmvolc_GetNonExistingClass ( ...@@ -356,8 +356,6 @@ cmvolc_GetNonExistingClass (
pwr_Assert(op->l.flags.b.isCached); pwr_Assert(op->l.flags.b.isCached);
cid = op->g.cid;
vp = pool_Address(NULL, gdbroot->pool, op->l.vr); vp = pool_Address(NULL, gdbroot->pool, op->l.vr);
np = pool_Address(NULL, gdbroot->pool, vp->l.nr); np = pool_Address(NULL, gdbroot->pool, vp->l.nr);
if (!np->cclassSupport) { if (!np->cclassSupport) {
......
...@@ -38,7 +38,8 @@ cmvolc_GetCachedClass ( ...@@ -38,7 +38,8 @@ cmvolc_GetCachedClass (
void void
cmvolc_GetNonExistingClass ( cmvolc_GetNonExistingClass (
pwr_tStatus *sts, pwr_tStatus *sts,
gdb_sObject *op gdb_sObject *op,
pwr_tCid cid
); );
......
...@@ -828,7 +828,7 @@ gdh_GetObjectClass ( ...@@ -828,7 +828,7 @@ gdh_GetObjectClass (
if (op->l.flags.b.isCached) { if (op->l.flags.b.isCached) {
cp = hash_Search(&lsts, gdbroot->cid_ht, cid); cp = hash_Search(&lsts, gdbroot->cid_ht, cid);
if (cp == NULL) { if (cp == NULL) {
cmvolc_GetNonExistingClass(&lsts, op); cmvolc_GetNonExistingClass(&lsts, op, *cid);
} }
} }
...@@ -853,6 +853,7 @@ gdh_GetAttrRefTid ( ...@@ -853,6 +853,7 @@ gdh_GetAttrRefTid (
pwr_tStatus sts = GDH__SUCCESS; pwr_tStatus sts = GDH__SUCCESS;
mvol_sAttribute *ap; mvol_sAttribute *ap;
mvol_sAttribute attribute; mvol_sAttribute attribute;
gdb_sClass *cp;
if ( arp->Flags.b.Object && arp->Body) { if ( arp->Flags.b.Object && arp->Body) {
*tid = arp->Body & ~7; *tid = arp->Body & ~7;
...@@ -879,11 +880,29 @@ gdh_GetAttrRefTid ( ...@@ -879,11 +880,29 @@ gdh_GetAttrRefTid (
sts = gdh_GetObjectInfoAttrref( &cast_aref, &castid, sizeof(castid)); sts = gdh_GetObjectInfoAttrref( &cast_aref, &castid, sizeof(castid));
if ( ODD(sts) && castid != pwr_cNCastId) { if ( ODD(sts) && castid != pwr_cNCastId) {
*tid = castid; *tid = castid;
return sts; } else {
} *tid = ap->adef->TypeRef;
sts = GDH__SUCCESS; }
} else {
*tid = ap->adef->TypeRef;
} }
*tid = ap->adef->TypeRef;
if (!(ap->op->l.flags.m & gdb_mLo_native)) {
gdh_ScopeLock {
cp = hash_Search(&sts, gdbroot->cid_ht, tid);
if (cp == NULL) {
cmvolc_GetNonExistingClass(&sts, ap->op, *tid);
cp = hash_Search(&sts, gdbroot->cid_ht, tid);
if (cp == NULL) {
sts = GDH__NOSUCHCLASS;
}
}
} gdh_ScopeUnlock;
}
} }
return sts; return sts;
} }
...@@ -3125,12 +3144,14 @@ pwr_tStatus ...@@ -3125,12 +3144,14 @@ pwr_tStatus
gdh_GetObjectBodyDef( gdh_GetObjectBodyDef(
pwr_tCid cid, pwr_tCid cid,
gdh_sAttrDef **bodydef, gdh_sAttrDef **bodydef,
int *rows int *rows,
pwr_tOid oid
) )
{ {
gdb_sClass *cp; gdb_sClass *cp;
gdb_sObject *bop; gdb_sObject *bop;
gdb_sObject *aop; gdb_sObject *aop;
gdb_sObject *op;
pwr_sParam *adef; pwr_sParam *adef;
pwr_sObjBodyDef *bdef; pwr_sObjBodyDef *bdef;
int acnt = 0; int acnt = 0;
...@@ -3159,7 +3180,20 @@ gdh_GetObjectBodyDef( ...@@ -3159,7 +3180,20 @@ gdh_GetObjectBodyDef(
if ( strcmp( a_super[scnt-1]->g.f.name.orig, "Super") == 0 && cdh_tidIsCid(adef->TypeRef)) { if ( strcmp( a_super[scnt-1]->g.f.name.orig, "Super") == 0 && cdh_tidIsCid(adef->TypeRef)) {
cp = hash_Search(&sts, gdbroot->cid_ht, &adef->TypeRef); cp = hash_Search(&sts, gdbroot->cid_ht, &adef->TypeRef);
if ( cp == 0) { rsts = GDH__NOSUCHCLASS; goto error_sts;}
if (cp == 0) {
if (!cdh_ObjidIsNull(oid)) {
op = vol_OidToObject(&sts, oid, gdb_mLo_global, vol_mTrans_all, cvol_eHint_none);
if (!(op->l.flags.m & gdb_mLo_native)) {
cmvolc_GetNonExistingClass(&sts, op, adef->TypeRef);
cp = hash_Search(&sts, gdbroot->cid_ht, &adef->TypeRef);
if (cp == NULL) { rsts = GDH__NOSUCHCLASS; goto error_sts;}
} else { rsts = GDH__NOSUCHCLASS; goto error_sts;}
} else { rsts = GDH__NOSUCHCLASS; goto error_sts;}
}
bop = pool_Address(&sts, gdbroot->pool, cp->bor); bop = pool_Address(&sts, gdbroot->pool, cp->bor);
if (bop == NULL) { rsts = GDH__ATTRIBUTE; goto error_sts;} if (bop == NULL) { rsts = GDH__ATTRIBUTE; goto error_sts;}
...@@ -3315,21 +3349,49 @@ gdh_GetAttrRefAdef( ...@@ -3315,21 +3349,49 @@ gdh_GetAttrRefAdef(
pwr_tStatus pwr_tStatus
gdh_GetSuperClass( gdh_GetSuperClass(
pwr_tCid cid, pwr_tCid cid,
pwr_tCid *supercid pwr_tCid *supercid,
pwr_tObjid oid
) )
{ {
gdb_sClass *cp; gdb_sClass *cp;
gdb_sObject *op;
pwr_tCid sid;
pwr_tStatus sts = GDH__SUCCESS; pwr_tStatus sts = GDH__SUCCESS;
gdh_ScopeLock { gdh_ScopeLock {
/* TODO get cashed class... */
cp = hash_Search(&sts, gdbroot->cid_ht, &cid); cp = hash_Search(&sts, gdbroot->cid_ht, &cid);
if ( cp) { if (cp) {
if ( !(cp->attr[0].flags.m & PWR_MASK_SUPERCLASS)) if ( !(cp->attr[0].flags.m & PWR_MASK_SUPERCLASS))
sts = GDH__NOSUCHCLASS; sts = GDH__NOSUCHCLASS;
else else {
*supercid = cp->attr[0].tid; sid = *supercid = cp->attr[0].tid;
if (!cdh_ObjidIsNull(oid)) {
op = vol_OidToObject(&sts, oid, gdb_mLo_global, vol_mTrans_all, cvol_eHint_none);
if (!(op->l.flags.m & gdb_mLo_native)) {
cp = hash_Search(&sts, gdbroot->cid_ht, &sid);
if (cp == NULL) {
cmvolc_GetNonExistingClass(&sts, op, sid);
cp = hash_Search(&sts, gdbroot->cid_ht, &sid);
if (cp == NULL) {
sts = GDH__NOSUCHCLASS;
}
}
}
}
}
} else if (!cdh_ObjidIsNull(oid)) {
op = vol_OidToObject(&sts, oid, gdb_mLo_global, vol_mTrans_all, cvol_eHint_none);
cmvolc_GetNonExistingClass(&sts, op, cid);
cp = hash_Search(&sts, gdbroot->cid_ht, &cid);
if (cp) {
if (!(cp->attr[0].flags.m & PWR_MASK_SUPERCLASS))
sts = GDH__NOSUCHCLASS;
else
*supercid = cp->attr[0].tid;
} else {
sts = GDH__NOSUCHCLASS;
}
} }
} gdh_ScopeUnlock; } gdh_ScopeUnlock;
......
...@@ -722,7 +722,8 @@ pwr_tStatus ...@@ -722,7 +722,8 @@ pwr_tStatus
gdh_GetObjectBodyDef( gdh_GetObjectBodyDef(
pwr_tCid cid, pwr_tCid cid,
gdh_sAttrDef **bodydef, gdh_sAttrDef **bodydef,
int *rows int *rows,
pwr_tOid oid
); );
pwr_tStatus pwr_tStatus
...@@ -740,8 +741,9 @@ gdh_GetAttrRefAdef( ...@@ -740,8 +741,9 @@ gdh_GetAttrRefAdef(
pwr_tStatus pwr_tStatus
gdh_GetSuperClass( gdh_GetSuperClass(
pwr_tCid cid, pwr_tCid cid,
pwr_tCid *supercid pwr_tCid *supercid,
pwr_tObjid oid
); );
pwr_tStatus pwr_tStatus
......
...@@ -6498,7 +6498,7 @@ int rtt_object_parameters( ...@@ -6498,7 +6498,7 @@ int rtt_object_parameters(
strcat( title, " "); strcat( title, " ");
strcat( title, classname); strcat( title, classname);
sts = gdh_GetObjectBodyDef( class, &bd, &rows); sts = gdh_GetObjectBodyDef( class, &bd, &rows, objid);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
/* Count the parameters */ /* Count the parameters */
......
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