aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/addr.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2011-10-17 19:08:10 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-10-18 12:13:32 -0400
commitd77385f23830ee6c400569bac8b37e6eb3b7d360 (patch)
tree871501dccd72630f7aec103738e649c2fcb2fd9d /net/sunrpc/addr.c
parent45402c38eec740f52422aafc92937c6a4a8c8c0e (diff)
SUNRPC: Fix rpc_sockaddr2uaddr
rpc_sockaddr2uaddr is only used by net/sunrpc/rpcb_clnt.c, where it is used in a non-blockable context in at least one case. Add non-blocking capability by adding a gfp_t argument Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/addr.c')
-rw-r--r--net/sunrpc/addr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/sunrpc/addr.c b/net/sunrpc/addr.c
index 4195233c4914..23cd19d45ab3 100644
--- a/net/sunrpc/addr.c
+++ b/net/sunrpc/addr.c
@@ -255,12 +255,13 @@ EXPORT_SYMBOL_GPL(rpc_pton);
255/** 255/**
256 * rpc_sockaddr2uaddr - Construct a universal address string from @sap. 256 * rpc_sockaddr2uaddr - Construct a universal address string from @sap.
257 * @sap: socket address 257 * @sap: socket address
258 * @gfp_flags: allocation mode
258 * 259 *
259 * Returns a %NUL-terminated string in dynamically allocated memory; 260 * Returns a %NUL-terminated string in dynamically allocated memory;
260 * otherwise NULL is returned if an error occurred. Caller must 261 * otherwise NULL is returned if an error occurred. Caller must
261 * free the returned string. 262 * free the returned string.
262 */ 263 */
263char *rpc_sockaddr2uaddr(const struct sockaddr *sap) 264char *rpc_sockaddr2uaddr(const struct sockaddr *sap, gfp_t gfp_flags)
264{ 265{
265 char portbuf[RPCBIND_MAXUADDRPLEN]; 266 char portbuf[RPCBIND_MAXUADDRPLEN];
266 char addrbuf[RPCBIND_MAXUADDRLEN]; 267 char addrbuf[RPCBIND_MAXUADDRLEN];
@@ -288,7 +289,7 @@ char *rpc_sockaddr2uaddr(const struct sockaddr *sap)
288 if (strlcat(addrbuf, portbuf, sizeof(addrbuf)) > sizeof(addrbuf)) 289 if (strlcat(addrbuf, portbuf, sizeof(addrbuf)) > sizeof(addrbuf))
289 return NULL; 290 return NULL;
290 291
291 return kstrdup(addrbuf, GFP_KERNEL); 292 return kstrdup(addrbuf, gfp_flags);
292} 293}
293EXPORT_SYMBOL_GPL(rpc_sockaddr2uaddr); 294EXPORT_SYMBOL_GPL(rpc_sockaddr2uaddr);
294 295