nfs: prepare to share nfs_set_port
authorJ. Bruce Fields <bfields@citi.umich.edu>
Wed, 20 Aug 2008 20:10:22 +0000 (16:10 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 7 Oct 2008 22:17:36 +0000 (18:17 -0400)
We plan to use this function elsewhere.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/internal.h
fs/nfs/super.c

index 7bcf6ec..8d91bd8 100644 (file)
@@ -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;
+       }
+       }
+}
index 1e35586..b99096b 100644 (file)
@@ -675,25 +675,6 @@ static void nfs_umount_begin(struct super_block *sb)
 }
 
 /*
- * 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.
  *
  * Address family must be initialized, and address must not be