From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: linux-nfs@vger.kernel.org
Cc: "J. Bruce Fields" <bfields@citi.umich.edu>
Subject: [PATCH 3/4] NFS: Cleanup nfs_set_port
Date: Thu, 09 Oct 2008 15:00:32 -0400 [thread overview]
Message-ID: <20081009190032.18388.45498.stgit@localhost.localdomain> (raw)
In-Reply-To: <20081009190031.18388.95039.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
From: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---
fs/nfs/internal.h | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index be091cb..98dcc9c 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -283,16 +283,15 @@ unsigned int nfs_page_array_len(unsigned int base, size_t len)
*/
static inline void nfs_set_port(struct sockaddr *sap, unsigned short port)
{
+ struct sockaddr_in *ap = (struct sockaddr_in *)sap;
+ struct sockaddr_in6 *ap6 = (struct sockaddr_in6 *)sap;
+
switch (sap->sa_family) {
- case AF_INET: {
- struct sockaddr_in *ap = (struct sockaddr_in *)sap;
- ap->sin_port = htons(port);
- break;
- }
- case AF_INET6: {
- struct sockaddr_in6 *ap = (struct sockaddr_in6 *)sap;
- ap->sin6_port = htons(port);
- break;
- }
+ case AF_INET:
+ ap->sin_port = htons(port);
+ break;
+ case AF_INET6:
+ ap6->sin6_port = htons(port);
+ break;
}
}
prev parent reply other threads:[~2008-10-09 19:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-09 19:00 [PATCH 0/4] Fixups agains the nfs 'devel' branch Trond Myklebust
[not found] ` <20081009190031.18388.95039.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-10-09 19:00 ` [PATCH 2/4] NFS: Remove checks for scope id's in v6 addresses in the fs-locations code Trond Myklebust
2008-10-09 19:00 ` [PATCH 4/4] NFS: fix nfs_parse_ip_address() corner case Trond Myklebust
2008-10-09 19:00 ` [PATCH 1/4] NFS: Fix attribute updates Trond Myklebust
2008-10-09 19:00 ` Trond Myklebust [this message]
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=20081009190032.18388.45498.stgit@localhost.localdomain \
--to=trond.myklebust@netapp.com \
--cc=bfields@citi.umich.edu \
--cc=linux-nfs@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