Commit ec6ee612 authored by Chuck Lever's avatar Chuck Lever Committed by Trond Myklebust

NFS: Replace nfs_set_port() with rpc_set_port()

Clean up.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 53a0b9c4
...@@ -368,22 +368,3 @@ unsigned int nfs_page_array_len(unsigned int base, size_t len) ...@@ -368,22 +368,3 @@ unsigned int nfs_page_array_len(unsigned int base, size_t len)
return ((unsigned long)len + (unsigned long)base + return ((unsigned long)len + (unsigned long)base +
PAGE_SIZE - 1) >> PAGE_SHIFT; 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)
{
struct sockaddr_in *ap = (struct sockaddr_in *)sap;
struct sockaddr_in6 *ap6 = (struct sockaddr_in6 *)sap;
switch (sap->sa_family) {
case AF_INET:
ap->sin_port = htons(port);
break;
case AF_INET6:
ap6->sin6_port = htons(port);
break;
}
}
...@@ -125,7 +125,7 @@ static struct vfsmount *try_location(struct nfs_clone_mount *mountdata, ...@@ -125,7 +125,7 @@ static struct vfsmount *try_location(struct nfs_clone_mount *mountdata,
mountdata->addr, mountdata->addrlen); mountdata->addr, mountdata->addrlen);
if (mountdata->addrlen == 0) if (mountdata->addrlen == 0)
continue; continue;
nfs_set_port(mountdata->addr, NFS_PORT); rpc_set_port(mountdata->addr, NFS_PORT);
memcpy(page2, buf->data, buf->len); memcpy(page2, buf->data, buf->len);
page2[buf->len] = '\0'; page2[buf->len] = '\0';
......
...@@ -1409,7 +1409,7 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args, ...@@ -1409,7 +1409,7 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args,
/* /*
* autobind will be used if mount_server.port == 0 * autobind will be used if mount_server.port == 0
*/ */
nfs_set_port(request.sap, args->mount_server.port); rpc_set_port(request.sap, args->mount_server.port);
/* /*
* Now ask the mount server to map our export path * Now ask the mount server to map our export path
...@@ -1703,7 +1703,7 @@ static int nfs_validate_mount_data(void *options, ...@@ -1703,7 +1703,7 @@ static int nfs_validate_mount_data(void *options,
&args->nfs_server.address)) &args->nfs_server.address))
goto out_no_address; goto out_no_address;
nfs_set_port((struct sockaddr *)&args->nfs_server.address, rpc_set_port((struct sockaddr *)&args->nfs_server.address,
args->nfs_server.port); args->nfs_server.port);
nfs_set_mount_transport_protocol(args); nfs_set_mount_transport_protocol(args);
...@@ -2336,7 +2336,7 @@ static int nfs4_validate_mount_data(void *options, ...@@ -2336,7 +2336,7 @@ static int nfs4_validate_mount_data(void *options,
&args->nfs_server.address)) &args->nfs_server.address))
return -EINVAL; return -EINVAL;
nfs_set_port((struct sockaddr *)&args->nfs_server.address, rpc_set_port((struct sockaddr *)&args->nfs_server.address,
args->nfs_server.port); args->nfs_server.port);
nfs_validate_transport_protocol(args); nfs_validate_transport_protocol(args);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment