[openib-general] Re: [PATCH] SDP: use container_of in place of cast to sdp_opt

Michael S. Tsirkin mst at mellanox.co.il
Tue Jun 21 10:35:15 PDT 2005


Quoting r. Tom Duffy <tduffy at sun.com>:
> Subject: Re: [PATCH] SDP: use container_of in place of cast to sdp_opt
> 
> On Tue, 2005-06-21 at 09:21 +0300, Michael S. Tsirkin wrote:
> > As a side note, wouldnt sk_to_sdp and sdp_to_sk be better names for
> > sdp_sk and sk_sdp?
> 
> I modeled this code based off of every other socket class in Linux.
> They use casts and shortened names.

Seems to be not entirely accurate: there is inet_sk but I no sk_inet
that I could see. And inet_sk() kind of makes sense since it returns
inet_socket, as opposed to sdp_sk() which returns sdp_conn :)

As for casts, inet_sock says:
        /* sk and pinet6 has to be the first two members of inet_sock */
so apparently there are other tricks that force specific layout in inet_sock
which we dont have, or need.

-- 
MST



More information about the general mailing list