Commit 359d7601 authored by claes's avatar claes

Fetch of remote class in mvol_AnameToAttribute

parent bfca524b
...@@ -201,7 +201,7 @@ gdh_ClassAttrToAttrref ( ...@@ -201,7 +201,7 @@ gdh_ClassAttrToAttrref (
gdh_ScopeLock { gdh_ScopeLock {
ap = mvol_AnameToAttribute(&sts, &Attribute, cid, pn); ap = mvol_AnameToAttribute(&sts, &Attribute, cid, pn, NULL);
if (ap == NULL) break; if (ap == NULL) break;
mvol_AttributeToAref(&sts, ap, arp); mvol_AttributeToAref(&sts, ap, arp);
...@@ -1668,7 +1668,7 @@ gdh_MDAttribute ( ...@@ -1668,7 +1668,7 @@ gdh_MDAttribute (
if (arp != NULL) { if (arp != NULL) {
ap = vol_ArefToAttribute(&sts, &attribute, arp, gdb_mLo_global, vol_mTrans_all); ap = vol_ArefToAttribute(&sts, &attribute, arp, gdb_mLo_global, vol_mTrans_all);
} else if (cid != pwr_cNClassId) { } else if (cid != pwr_cNClassId) {
ap = mvol_AnameToAttribute(&sts, ap, cid, pn); ap = mvol_AnameToAttribute(&sts, ap, cid, pn, NULL);
} else { } else {
ap = vol_NameToAttribute(&sts, ap, pn, gdb_mLo_global, vol_mTrans_all); ap = vol_NameToAttribute(&sts, ap, pn, gdb_mLo_global, vol_mTrans_all);
} }
......
...@@ -171,7 +171,8 @@ mvol_AnameToAttribute ( ...@@ -171,7 +171,8 @@ mvol_AnameToAttribute (
pwr_tStatus *sts, pwr_tStatus *sts,
mvol_sAttribute *ap, mvol_sAttribute *ap,
pwr_tClassId cid, pwr_tClassId cid,
cdh_sParseName *pn cdh_sParseName *pn,
gdb_sObject *op
) )
{ {
cdh_uObjid coid; cdh_uObjid coid;
...@@ -179,9 +180,29 @@ mvol_AnameToAttribute ( ...@@ -179,9 +180,29 @@ mvol_AnameToAttribute (
gdb_sObject *abop; gdb_sObject *abop;
int offset = 0; int offset = 0;
int i; int i;
pwr_tOid oid, tid;
oid = op->g.oid;
ap->cp = hash_Search(sts, gdbroot->cid_ht, &cid); ap->cp = hash_Search(sts, gdbroot->cid_ht, &cid);
if (ap->cp == NULL) pwr_Return(NULL, sts, GDH__NOSUCHCLASS); // if (ap->cp == NULL) pwr_Return(NULL, sts, GDH__NOSUCHCLASS);
/* If it's not native object then we try to fetch class from remote node */
if (ap->cp == NULL) {
if (op == NULL) pwr_Return(NULL, sts, GDH__NOSUCHCLASS);
if (!(op->l.flags.m & gdb_mLo_native)) {
cmvolc_GetNonExistingClass(sts, op, cid);
ap->cp = hash_Search(sts, gdbroot->cid_ht, &cid);
if (ap->cp == NULL) {
pwr_Return(NULL, sts, GDH__NOSUCHCLASS);
} else {
/* Refresh pointer, pool has been released during fetch */
op = vol_OidToObject(sts, oid, gdb_mLo_global, vol_mTrans_all, cvol_eHint_none);
}
} else {
pwr_Return(NULL, sts, GDH__NOSUCHCLASS);
}
}
ap->bop = pool_Address(sts, gdbroot->pool, ap->cp->bor); ap->bop = pool_Address(sts, gdbroot->pool, ap->cp->bor);
if (ap->bop == NULL) pwr_Return(NULL, sts, GDH__ATTRIBUTE); if (ap->bop == NULL) pwr_Return(NULL, sts, GDH__ATTRIBUTE);
...@@ -202,8 +223,28 @@ mvol_AnameToAttribute ( ...@@ -202,8 +223,28 @@ mvol_AnameToAttribute (
while ( ap->aop == NULL) { while ( ap->aop == NULL) {
/* Try superclass */ /* Try superclass */
if ( acp->attr[0].flags.m & PWR_MASK_SUPERCLASS) { if ( acp->attr[0].flags.m & PWR_MASK_SUPERCLASS) {
tid = acp->attr[0].tid;
acp = hash_Search(sts, gdbroot->cid_ht, &acp->attr[0].tid); acp = hash_Search(sts, gdbroot->cid_ht, &acp->attr[0].tid);
if ( acp == NULL) pwr_Return(NULL, sts, GDH__NOSUCHCLASS); // if ( acp == NULL) pwr_Return(NULL, sts, GDH__NOSUCHCLASS);
/* If it's not native object then we try to fetch class from remote node */
if (acp == NULL) {
if (op == NULL) pwr_Return(NULL, sts, GDH__NOSUCHCLASS);
if (!(op->l.flags.m & gdb_mLo_native)) {
cmvolc_GetNonExistingClass(sts, op, tid);
acp = hash_Search(sts, gdbroot->cid_ht, &tid);
if (acp == NULL) {
pwr_Return(NULL, sts, GDH__NOSUCHCLASS);
} else {
/* Refresh pointers, pool has been released during fetch */
op = vol_OidToObject(sts, oid, gdb_mLo_global, vol_mTrans_all, cvol_eHint_none);
ap->cp = hash_Search(sts, gdbroot->cid_ht, &cid);
}
} else {
pwr_Return(NULL, sts, GDH__NOSUCHCLASS);
}
}
abop = pool_Address(sts, gdbroot->pool, acp->bor); abop = pool_Address(sts, gdbroot->pool, acp->bor);
if (abop == NULL) pwr_Return(NULL, sts, GDH__ATTRIBUTE); if (abop == NULL) pwr_Return(NULL, sts, GDH__ATTRIBUTE);
...@@ -222,8 +263,31 @@ mvol_AnameToAttribute ( ...@@ -222,8 +263,31 @@ mvol_AnameToAttribute (
offset += pn->index[i] * ap->adef->Info.Size / ap->adef->Info.Elements; offset += pn->index[i] * ap->adef->Info.Size / ap->adef->Info.Elements;
if ( !ap->adef->Info.Flags & PWR_MASK_CLASS) pwr_Return(NULL, sts, GDH__NOSUCHCLASS); if ( !ap->adef->Info.Flags & PWR_MASK_CLASS) pwr_Return(NULL, sts, GDH__NOSUCHCLASS);
tid = ap->adef->TypeRef;
acp = hash_Search(sts, gdbroot->cid_ht, &ap->adef->TypeRef); acp = hash_Search(sts, gdbroot->cid_ht, &ap->adef->TypeRef);
if (acp == NULL) pwr_Return(NULL, sts, GDH__NOSUCHCLASS); // if (acp == NULL) pwr_Return(NULL, sts, GDH__NOSUCHCLASS);
/* If it's not native object then we try to fetch class from remote node */
if (acp == NULL) {
if (op == NULL) pwr_Return(NULL, sts, GDH__NOSUCHCLASS);
if (!(op->l.flags.m & gdb_mLo_native)) {
cmvolc_GetNonExistingClass(sts, op, tid);
acp = hash_Search(sts, gdbroot->cid_ht, &tid);
if (acp == NULL) {
pwr_Return(NULL, sts, GDH__NOSUCHCLASS);
} else {
/* Refresh pointers, pool has been released during fetch */
op = vol_OidToObject(sts, oid, gdb_mLo_global, vol_mTrans_all, cvol_eHint_none);
ap->cp = hash_Search(sts, gdbroot->cid_ht, &cid);
ap->aop = hash_Search(sts, gdbroot->family_ht, &pn->attribute[i]);
ap->adef = pool_Address(NULL, gdbroot->rtdb, ap->aop->u.n.body);
}
} else {
pwr_Return(NULL, sts, GDH__NOSUCHCLASS);
}
}
abop = pool_Address(sts, gdbroot->pool, acp->bor); abop = pool_Address(sts, gdbroot->pool, acp->bor);
if (abop == NULL) pwr_Return(NULL, sts, GDH__ATTRIBUTE); if (abop == NULL) pwr_Return(NULL, sts, GDH__ATTRIBUTE);
......
...@@ -79,7 +79,8 @@ mvol_AnameToAttribute ( ...@@ -79,7 +79,8 @@ mvol_AnameToAttribute (
pwr_tStatus *sts, pwr_tStatus *sts,
mvol_sAttribute *ap, mvol_sAttribute *ap,
pwr_tClassId cid, pwr_tClassId cid,
cdh_sParseName *pn cdh_sParseName *pn,
gdb_sObject *op
); );
mvol_sAttribute * mvol_sAttribute *
......
...@@ -614,7 +614,7 @@ vol_NameToAttribute ( ...@@ -614,7 +614,7 @@ vol_NameToAttribute (
op = vol_NameToObject(sts, pn, lo_flags, trans); op = vol_NameToObject(sts, pn, lo_flags, trans);
if (op == NULL) return NULL; if (op == NULL) return NULL;
ap = mvol_AnameToAttribute(sts, ap, op->g.cid, pn); ap = mvol_AnameToAttribute(sts, ap, op->g.cid, pn, op);
if (ap == NULL) return NULL; if (ap == NULL) return NULL;
ap->op = op; ap->op = op;
......
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