From: J. Bruce Fields Date: Wed, 20 Aug 2008 20:10:22 +0000 (-0400) Subject: nfs: prepare to share nfs_set_port X-Git-Tag: v2.6.28-rc1~266^2^2~31 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=f0c929251e01a7a86b6254c775cb6b65c6457f10;p=linux-2.6-omap-h63xx.git nfs: prepare to share nfs_set_port We plan to use this function elsewhere. Signed-off-by: J. Bruce Fields Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 7bcf6ec2d45..8d91bd88e31 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -276,3 +276,23 @@ unsigned int nfs_page_array_len(unsigned int base, size_t len) PAGE_SIZE - 1) >> PAGE_SHIFT; } + +/* + * Set the port number in an address. Be agnostic about the address + * family. + */ +static inline void nfs_set_port(struct sockaddr *sap, unsigned short port) +{ + 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; + } + } +} diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 1e355869721..b99096b8e82 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -674,25 +674,6 @@ static void nfs_umount_begin(struct super_block *sb) rpc_killall_tasks(rpc); } -/* - * Set the port number in an address. Be agnostic about the address family. - */ -static void nfs_set_port(struct sockaddr *sap, unsigned short port) -{ - 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; - } - } -} - /* * Sanity-check a server address provided by the mount command. *