From: Cong Wang <amwang@redhat.com>
To: Jeff Layton <jlayton@redhat.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Trond Myklebust <Trond.Myklebust@netapp.com>,
"J. Bruce Fields" <bfields@fieldses.org>,
linux-nfs@vger.kernel.org
Subject: Re: [Patch net-next v2 5/8] sunrpc: use generic union inet_addr
Date: Wed, 07 Aug 2013 20:27:26 +0800 [thread overview]
Message-ID: <1375878446.11370.36.camel@cr0> (raw)
In-Reply-To: <20130806062801.67714276@tlielax.poochiereds.net>
On Tue, 2013-08-06 at 06:28 -0400, Jeff Layton wrote:
>
> My question is a bit more fundamental: Why are you using this new union
> in your patches instead of simply passing around "struct sockaddr"
> pointers? If you did that, then you could simply replace all of the
> rpc_* wrappers with your generic ones, since you wouldn't need to do
> the cast to this (seemingly unnecessary) union.
Because there are some places have to interpret the structure, without
this union, they need to cast to either sockaddr_in or sockaddr_in6
first, which is not as pretty as using a union.
For example, the code in netpoll:
ipv6_addr_equal(daddr, &np->local_ip.sin6.sin6_addr)
without the union, it would be:
struct sockaddr_in6 *addr = (struct sockaddr_in6 *) &np->local_ip;
ipv6_addr_equal(daddr, addr->sin6_addr);
>
> FWIW, I too am happy to see these routines moved to common code. I just
> wonder whether it might make more sense to use the existing convention
> instead of this new union.
>
Thanks.
next prev parent reply other threads:[~2013-08-07 12:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1375427674-21735-1-git-send-email-amwang@redhat.com>
2013-08-02 7:14 ` [Patch net-next v2 5/8] sunrpc: use generic union inet_addr Cong Wang
2013-08-02 13:36 ` Jeff Layton
2013-08-05 3:14 ` Cong Wang
2013-08-06 10:28 ` Jeff Layton
2013-08-07 12:27 ` Cong Wang [this message]
2013-08-07 13:21 ` Jeff Layton
2013-08-08 1:37 ` Cong Wang
2013-08-07 13:30 ` Jim Rees
2013-08-02 7:14 ` [Patch net-next v2 6/8] fs: use generic union inet_addr and helper functions Cong Wang
2013-08-02 10:31 ` [Cluster-devel] " Christoph Hellwig
2013-08-05 3:16 ` Cong Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1375878446.11370.36.camel@cr0 \
--to=amwang@redhat.com \
--cc=Trond.Myklebust@netapp.com \
--cc=bfields@fieldses.org \
--cc=davem@davemloft.net \
--cc=jlayton@redhat.com \
--cc=linux-nfs@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).