Commit 8bc5d1b2 authored by ml's avatar ml

Added support for net version 7, no Cached Classes

parent 4bd49851
...@@ -100,6 +100,14 @@ cmvolc_GetCachedClass ( ...@@ -100,6 +100,14 @@ cmvolc_GetCachedClass (
*fetched = 0; *fetched = 0;
/* Handle nodes that don't support cached classes */
if (!np->cclassSupport) {
*equal = 1;
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) */ /** @todo Check vp->u.c.equalClasses first (when implemented) */
......
...@@ -197,7 +197,7 @@ cvol_LinkObject ( ...@@ -197,7 +197,7 @@ cvol_LinkObject (
gdb_sObject * gdb_sObject *
cvol_LoadObject ( cvol_LoadObject (
pwr_tStatus *sts, pwr_tStatus *sts,
gdb_sNode *np, gdb_sNode *np,
gdb_sVolume *vp, gdb_sVolume *vp,
net_sGobject *gop net_sGobject *gop
) )
...@@ -223,6 +223,12 @@ cvol_LoadObject ( ...@@ -223,6 +223,12 @@ cvol_LoadObject (
op = cvol_LinkObject(&lsts, vp, op, vol_mLink_load); op = cvol_LinkObject(&lsts, vp, op, vol_mLink_load);
if (op == NULL) errh_Bugcheck(lsts, "cvol_LinkObject"); if (op == NULL) errh_Bugcheck(lsts, "cvol_LinkObject");
if (!np->cclassSupport) {
op->u.c.flags.b.classChecked = 1;
op->u.c.flags.b.classEqual = 1;
}
pwr_Return(op, sts, GDH__SUCCESS); pwr_Return(op, sts, GDH__SUCCESS);
} }
......
This diff is collapsed.
...@@ -210,20 +210,35 @@ ConvertPut ( ...@@ -210,20 +210,35 @@ ConvertPut (
pwr_tStatus lsts; pwr_tStatus lsts;
XDR xdrs; XDR xdrs;
qdb_sNode *np; qdb_sNode *np;
tFuncXdr fXdr;
if (put->type.b != net_cMsgClass) if (put->type.b != net_cMsgClass)
pwr_Return(FALSE, sts, NET__XDRFAILED); pwr_Return(FALSE, sts, NET__XDRFAILED);
np = hash_Search(&lsts, &qdb->nid_ht, &qid->nid); np = hash_Search(&lsts, &qdb->nid_ht, &qid->nid);
if (np == NULL) pwr_Return(FALSE, sts, lsts); if (np == NULL) pwr_Return(FALSE, sts, lsts);
/* This is a simple way to fix the net_sGvolume difference between
* Neth version 7 and later. If this is needed for more messages
* then a generic solution must be implemented.
*/
if (put->type.s == net_eMsg_volumes7) {
put->type.s = net_eMsg_volumes;
fXdr = xdr_net_sVolumes7;
}
else {
if ((int)put->type.s <= (int)net_eMsg__ || (int)put->type.s >= (int)net_eMsg_)
pwr_Return(FALSE, sts, NET__NOSUCHQCOMSUBT);
fXdr = func_xdr[(int)put->type.s];
}
if (np == qdb->my_node || np->bo == qdb->my_node->bo) { if (np == qdb->my_node || np->bo == qdb->my_node->bo) {
if (put->data != data) memcpy(put->data, data, put->size); if (put->data != data) memcpy(put->data, data, put->size);
pwr_Return(TRUE, sts, NET__SUCCESS); pwr_Return(TRUE, sts, NET__SUCCESS);
} }
xdrmem_create(&xdrs, (char *) put->data, put->size, XDR_ENCODE); xdrmem_create(&xdrs, (char *) put->data, put->size, XDR_ENCODE);
if ((int)put->type.s <= (int)net_eMsg__ || (int)put->type.s >= (int)net_eMsg_) if(!(fXdr)(&xdrs, (char *) data))
pwr_Return(FALSE, sts, NET__NOSUCHQCOMSUBT);
if(!func_xdr[(int)put->type.s](&xdrs, (char *) data))
pwr_Return(FALSE, sts, NET__XDRFAILED); pwr_Return(FALSE, sts, NET__XDRFAILED);
pwr_Return(TRUE, sts, NET__SUCCESS); pwr_Return(TRUE, sts, NET__SUCCESS);
...@@ -239,20 +254,44 @@ ConvertGet ( ...@@ -239,20 +254,44 @@ ConvertGet (
pwr_tStatus lsts; pwr_tStatus lsts;
XDR xdrs; XDR xdrs;
qdb_sNode *np; qdb_sNode *np;
tFuncXdr fXdr;
gdb_sNode *gnp;
pwr_tUInt32 netver;
if (get->type.b != net_cMsgClass) if (get->type.b != net_cMsgClass)
pwr_Return(FALSE, sts, NET__XDRFAILED); pwr_Return(FALSE, sts, NET__XDRFAILED);
np = hash_Search(&lsts, &qdb->nid_ht, &get->sender.nid); np = hash_Search(&lsts, &qdb->nid_ht, &get->sender.nid);
if (np == NULL) pwr_Return(FALSE, sts, lsts); if (np == NULL) pwr_Return(FALSE, sts, lsts);
if ((int)get->type.s <= (int)net_eMsg__ || (int)get->type.s >= (int)net_eMsg_)
pwr_Return(FALSE, sts, NET__NOSUCHQCOMSUBT);
/* This is a simple way to fix the net_sGvolume difference between
* Neth version 7 and later. If this is needed for more messages
* then a generic solution must be implemented.
*/
fXdr = func_xdr[(int)get->type.s];
if (get->type.s == net_eMsg_volumes) {
gdb_ScopeLock {
gnp = hash_Search(&lsts, gdbroot->nid_ht, &np->nid);
netver = gnp->netver;
} gdb_ScopeUnlock;
if (netver == 7) {
get->type.s = net_eMsg_volumes7;
fXdr = xdr_net_sVolumes7;
}
}
if (np == qdb->my_node || np->bo == qdb->my_node->bo) { if (np == qdb->my_node || np->bo == qdb->my_node->bo) {
if (get->data != data) memcpy(data, get->data, get->size); if (get->data != data) memcpy(data, get->data, get->size);
pwr_Return(TRUE, sts, NET__SUCCESS); pwr_Return(TRUE, sts, NET__SUCCESS);
} }
xdrmem_create(&xdrs, (char *) data, get->size, XDR_DECODE); xdrmem_create(&xdrs, (char *) data, get->size, XDR_DECODE);
if ((int)get->type.s <= (int)net_eMsg__ || (int)get->type.s >= (int)net_eMsg_)
pwr_Return(FALSE, sts, NET__NOSUCHQCOMSUBT); if(!(fXdr)(&xdrs, (char *) get->data))
if(!func_xdr[(int)get->type.s](&xdrs, (char *) get->data))
pwr_Return(FALSE, sts, NET__XDRFAILED); pwr_Return(FALSE, sts, NET__XDRFAILED);
pwr_Return(TRUE, sts, NET__SUCCESS); pwr_Return(TRUE, sts, NET__SUCCESS);
......
...@@ -26,10 +26,11 @@ ...@@ -26,10 +26,11 @@
%#include "co_cdh.h" %#include "co_cdh.h"
%#endif %#endif
% %
%/* Protocol version. Increase whenever an %/** Protocol version. Increase whenever an
% incompatible change is done to the protocol */ % incompatible change is done to the protocol.
% Update supported features in function id() in file rt_neth.c */
% %
%#define net_cVersion 7 %#define net_cVersion 8
% %
%#define net_cSendRcvTmo 20000 /* Timeout (ms) used in pams_rcv_msgw calls */ %#define net_cSendRcvTmo 20000 /* Timeout (ms) used in pams_rcv_msgw calls */
%#define net_cProcHandler 110 %#define net_cProcHandler 110
...@@ -86,7 +87,11 @@ enum net_eMsg { ...@@ -86,7 +87,11 @@ enum net_eMsg {
net_eMsg_getGclass, /* The whole class */ net_eMsg_getGclass, /* The whole class */
net_eMsg_getGclassR, net_eMsg_getGclassR,
net_eMsg_ /* Not a valid message */ net_eMsg_, /* Not a valid message */
net_eMsg_volumes7, /* Version 7. Internal only */
net_eMsg_end
}; };
...@@ -837,6 +842,8 @@ struct net_sRenameObject { ...@@ -837,6 +842,8 @@ struct net_sRenameObject {
cdh_sFamily f; /* Used for Rename */ cdh_sFamily f; /* Used for Rename */
}; };
/* net_sGvolume for Neth Ver > 7 */
struct net_sGvolume { struct net_sGvolume {
pwr_tVolumeId vid; pwr_tVolumeId vid;
pwr_tObjid oid; /* Oid of volume object. */ pwr_tObjid oid; /* Oid of volume object. */
...@@ -844,10 +851,25 @@ struct net_sGvolume { ...@@ -844,10 +851,25 @@ struct net_sGvolume {
pwr_tClassId cid; /* Class of volume. */ pwr_tClassId cid; /* Class of volume. */
pwr_tNodeId nid; /* Node id of owner of volume, pwr_tNodeId nid; /* Node id of owner of volume,
pwr_cNNodeId if shared or class volume. */ pwr_cNNodeId if shared or class volume. */
pwr_tTime time; pwr_tTime time; /* Currently only used for Class volumes.
* Added in Neth version 8 */
};
/* net_sGvolume for Neth Ver == 7 */
struct net_sGvolume7 {
pwr_tVolumeId vid;
pwr_tObjid oid; /* Oid of volume object. */
cdh_sObjName name;
pwr_tClassId cid; /* Class of volume. */
pwr_tNodeId nid; /* Node id of owner of volume,
pwr_cNNodeId if shared or class volume. */
}; };
#ifdef RPC_HDR #ifdef RPC_HDR
%
%#define net_cVolumeMaxCount (net_cSizeLarge/sizeof(net_sGvolume)) %#define net_cVolumeMaxCount (net_cSizeLarge/sizeof(net_sGvolume))
% %
%typedef struct { %typedef struct {
...@@ -859,6 +881,15 @@ struct net_sGvolume { ...@@ -859,6 +881,15 @@ struct net_sGvolume {
% %
%bool_t xdr_net_sVolumes(); %bool_t xdr_net_sVolumes();
% %
%typedef struct {
% net_sMessage hdr pwr_dPacked; /* Header */
% pwr_tUInt32 ctx pwr_dPacked;
% pwr_tUInt32 count pwr_dPacked; /* # of headers */
% net_sGvolume7 g[1] pwr_dPacked; /* Array of volume headers */
%} net_sVolumes7;
%
%bool_t xdr_net_sVolumes7();
%
#elif defined RPC_XDR #elif defined RPC_XDR
% %
%bool_t %bool_t
...@@ -887,6 +918,34 @@ struct net_sGvolume { ...@@ -887,6 +918,34 @@ struct net_sGvolume {
% } % }
% return (TRUE); % return (TRUE);
%} %}
%
%
%bool_t
%xdr_net_sVolumes7(xdrs, objp)
% XDR *xdrs;
% net_sVolumes *objp;
%{
% int count;
%
% if (xdrs->x_op == XDR_DECODE) {
% count = (int) ntohl(objp->count);
% } else {
% count = objp->count;
% }
% if (!xdr_net_sMessage(xdrs, &objp->hdr)) {
% return (FALSE);
% }
% if (!xdr_pwr_tUInt32(xdrs, &objp->ctx)) {
% return (FALSE);
% }
% if (!xdr_pwr_tUInt32(xdrs, &objp->count)) {
% return (FALSE);
% }
% if (!xdr_vector(xdrs, (char *)objp->g, count, sizeof(net_sGvolume7), (xdrproc_t)xdr_net_sGvolume7)) {
% return (FALSE);
% }
% return (TRUE);
%}
#endif #endif
struct net_sMount { struct net_sMount {
......
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