aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2008-10-08 15:31:14 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-10-10 14:41:50 -0400
commit456018d791ff4ef03d610f72486c637056bcd749 (patch)
treec278b69dc731a048e3c5a1d350b0d74611fcb791 /fs/nfs
parent03254e65a60d3113164672dbbadc023c4a56ecd1 (diff)
NFS: Cleanup nfs_set_port
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/internal.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 5d2a5d3c4241..d212ee41caf2 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -285,16 +285,15 @@ unsigned int nfs_page_array_len(unsigned int base, size_t len)
285 */ 285 */
286static inline void nfs_set_port(struct sockaddr *sap, unsigned short port) 286static inline void nfs_set_port(struct sockaddr *sap, unsigned short port)
287{ 287{
288 struct sockaddr_in *ap = (struct sockaddr_in *)sap;
289 struct sockaddr_in6 *ap6 = (struct sockaddr_in6 *)sap;
290
288 switch (sap->sa_family) { 291 switch (sap->sa_family) {
289 case AF_INET: { 292 case AF_INET:
290 struct sockaddr_in *ap = (struct sockaddr_in *)sap; 293 ap->sin_port = htons(port);
291 ap->sin_port = htons(port); 294 break;
292 break; 295 case AF_INET6:
293 } 296 ap6->sin6_port = htons(port);
294 case AF_INET6: { 297 break;
295 struct sockaddr_in6 *ap = (struct sockaddr_in6 *)sap;
296 ap->sin6_port = htons(port);
297 break;
298 }
299 } 298 }
300} 299}