From: Aneesh K. <ane...@gm...> - 2006-05-11 08:23:05
|
Hi John and Brian, What is the specific requirment of using XDR within ICS. ? I see structures like pt_regs being encoded using ics directly. As per our last discussion most of these structures are marked OOL. So with XDR we encode them with XDR routines and out then as OOL data. But then if all the nodes involved in clustering are of same endian do we need to encode them using XDR routines ? -aneesh |
From: Aneesh K. <ane...@gm...> - 2006-05-11 15:37:40
|
On 5/11/06, Aneesh Kumar <ane...@gm...> wrote: > Hi John and Brian, > > What is the specific requirment of using XDR within ICS. ? I see > structures like pt_regs being encoded using ics directly. As per our > last discussion most of these structures are marked OOL. So with XDR > we encode them with XDR routines and out then as OOL data. But then if > all the nodes involved in clustering are of same endian do we need to > encode them using XDR routines ? > After looking at the code again i guess i understand what is happening. For structures carrying pointers to another data type we need the XDR param type. I have dropped from the latest ICS code the openssirpcgen. I am right now looking at NFS and understanding how to do the work the same way they are doing. -aneesh |
From: Aneesh K. <ane...@gm...> - 2006-05-11 16:09:09
|
On 5/11/06, Aneesh Kumar <ane...@gm...> wrote: > On 5/11/06, Aneesh Kumar <ane...@gm...> wrote: > > Hi John and Brian, > > > > What is the specific requirment of using XDR within ICS. ? I see > > structures like pt_regs being encoded using ics directly. As per our > > last discussion most of these structures are marked OOL. So with XDR > > we encode them with XDR routines and out then as OOL data. But then if > > all the nodes involved in clustering are of same endian do we need to > > encode them using XDR routines ? > > > > After looking at the code again i guess i understand what is > happening. For structures carrying pointers to another data type we > need the XDR param type. > > I have dropped from the latest ICS code the openssirpcgen. I am right > now looking at NFS and understanding how to do the work the same way > they are doing. > > How about doing it the below way struct my_struct { int a; char *data; } cli_encode_xdr_struct_my_struct(cli_handle_t *handle, struct my_struct *p) { /* scalar type encode inline */ cli_encode_int(handle, p->a) cli_encode_ool_data_t(handle, p->data, length_of_data, NULL, 0); } By carefully doing this way i guess we should be able to drop XDR and rpcge= n -aneesh |
From: John B. <joh...@hp...> - 2006-05-11 17:10:20
|
Aneesh Kumar wrote: > On 5/11/06, Aneesh Kumar <ane...@gm...> wrote: >> On 5/11/06, Aneesh Kumar <ane...@gm...> wrote: >> > Hi John and Brian, >> > >> > What is the specific requirment of using XDR within ICS. ? I see >> > structures like pt_regs being encoded using ics directly. As per our >> > last discussion most of these structures are marked OOL. So with XDR >> > we encode them with XDR routines and out then as OOL data. But then if >> > all the nodes involved in clustering are of same endian do we need to >> > encode them using XDR routines ? >> > >> >> After looking at the code again i guess i understand what is >> happening. For structures carrying pointers to another data type we >> need the XDR param type. >> >> I have dropped from the latest ICS code the openssirpcgen. I am right >> now looking at NFS and understanding how to do the work the same way >> they are doing. >> >> > > How about doing it the below way > > struct my_struct { > int a; > char *data; > } > > cli_encode_xdr_struct_my_struct(cli_handle_t *handle, struct my_struct *p) > { > /* scalar type encode inline */ > cli_encode_int(handle, p->a) > cli_encode_ool_data_t(handle, p->data, length_of_data, NULL, 0); > } > > > > By carefully doing this way i guess we should be able to drop XDR and > rpcgen You certainly can. It can become painful for complex structures. You don't necessarily have to encode the pointer data as ool, though. It depends on the length. (There is a 300 byte limit on inline data.) John > > > -aneesh > |
From: John B. <joh...@hp...> - 2006-05-11 17:00:57
|
Aneesh Kumar wrote: > On 5/11/06, Aneesh Kumar <ane...@gm...> wrote: >> Hi John and Brian, >> >> What is the specific requirment of using XDR within ICS. ? I see >> structures like pt_regs being encoded using ics directly. As per our >> last discussion most of these structures are marked OOL. So with XDR >> we encode them with XDR routines and out then as OOL data. But then if >> all the nodes involved in clustering are of same endian do we need to >> encode them using XDR routines ? >> > > After looking at the code again i guess i understand what is > happening. For structures carrying pointers to another data type we > need the XDR param type. You don't need it. XDR is just a convenient way of generating the glue for a complex structure. You can always write the marshaling routines by hand and drop the XDR. > > I have dropped from the latest ICS code the openssirpcgen. I am right > now looking at NFS and understanding how to do the work the same way > they are doing. > > > -aneesh > |