[openib-general] [PATCH][RFC] kDAPL: remove dat wrapper funct ion dat_ia_query()

Christoph Hellwig hch at lst.de
Thu Jun 9 02:47:59 PDT 2005


On Thu, Jun 09, 2005 at 11:37:25AM +0300, Itamar Rabenstein wrote:
> Hi Tom,
> 
> It looks very good to me but i want to ask why do we need the dat_common
> struct ?
> 
> as we can see in dat.h dat_common is defined as :
>  
> struct dat_common {
> 	struct dat_provider *provider;
> 	union dat_context context;
> };
> and is being use as data member of any dat_* struct 
> There are 9 places were we instance dat_common
> (dat_ia, dat_ep, dat_evd, ...)
> 
> i think that that dat_* struct should be like this 
> struct dat_ia {
> 	struct dat_provider *provider;
> 	union dat_context context;
> };
> instaed of 
> struct dat_ia {
> 	struct dat_common common;
> };
> 
> if we do it (only 5 lines more in code )
> every time we want to call a function it will be 
> ret = ia->provider->dat_ia_query(ia, NULL,
> instaed of 
> ret = ia->common.provider->dat_ia_query(ia, NULL,
> 
> i think that this is more readable.

It is.  B?ut I think it'll change even more later on - having a pointer
to the method table in every object is an enormous waste of space, in
the end the method should probably be only in a hca-level object, and
all other objects should have public pointers to it.




More information about the general mailing list