netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 11/25] NFS: Make nfs_alloc_client() take (sockaddr, len) instead of sockaddr_in
@ 2007-11-13 18:31 Chuck Lever
  0 siblings, 0 replies; only message in thread
From: Chuck Lever @ 2007-11-13 18:31 UTC (permalink / raw)
  To: nfs; +Cc: netdev

To support non-IPv4 addresses, adjust the arguments and callers of
nfs_alloc_client() to pass in a "struct sockaddr *" and length instead of
a "struct sockaddr_in *".

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net>
---

 fs/nfs/client.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 53bf8ab..c1ee3d3 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -100,7 +100,8 @@ struct rpc_program		nfsacl_program = {
  * bother putting them in a slab cache...
  */
 static struct nfs_client *nfs_alloc_client(const char *hostname,
-					   const struct sockaddr_in *addr,
+					   const struct sockaddr *addr,
+					   size_t addrlen,
 					   unsigned int nfsversion)
 {
 	struct nfs_client *clp;
@@ -117,7 +118,7 @@ static struct nfs_client *nfs_alloc_client(const char *hostname,
 	atomic_set(&clp->cl_count, 1);
 	clp->cl_cons_state = NFS_CS_INITING;
 
-	clp->cl_addrlen = sizeof(*addr);	/* for now */
+	clp->cl_addrlen = addrlen;
 	memcpy(&clp->cl_addr, addr, clp->cl_addrlen);
 
 	if (hostname) {
@@ -285,7 +286,9 @@ static struct nfs_client *nfs_get_client(const char *hostname,
 
 		spin_unlock(&nfs_client_lock);
 
-		new = nfs_alloc_client(hostname, addr, nfsversion);
+		new = nfs_alloc_client(hostname,
+				       (const struct sockaddr *)addr,
+				       sizeof(*addr), nfsversion);
 	} while (new);
 
 	return ERR_PTR(-ENOMEM);


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-11-13 18:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-13 18:31 [PATCH 11/25] NFS: Make nfs_alloc_client() take (sockaddr, len) instead of sockaddr_in Chuck Lever

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).