diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-10-17 16:08:10 -0700 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-10-18 09:13:32 -0700 |
commit | d77385f23830ee6c400569bac8b37e6eb3b7d360 (patch) | |
tree | 871501dccd72630f7aec103738e649c2fcb2fd9d /net/sunrpc/addr.c | |
parent | 45402c38eec740f52422aafc92937c6a4a8c8c0e (diff) | |
download | kernel-common-d77385f23830ee6c400569bac8b37e6eb3b7d360.tar.gz kernel-common-d77385f23830ee6c400569bac8b37e6eb3b7d360.tar.bz2 kernel-common-d77385f23830ee6c400569bac8b37e6eb3b7d360.zip |
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.c | 5 |
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); /** * rpc_sockaddr2uaddr - Construct a universal address string from @sap. * @sap: socket address + * @gfp_flags: allocation mode * * Returns a %NUL-terminated string in dynamically allocated memory; * otherwise NULL is returned if an error occurred. Caller must * free the returned string. */ -char *rpc_sockaddr2uaddr(const struct sockaddr *sap) +char *rpc_sockaddr2uaddr(const struct sockaddr *sap, gfp_t gfp_flags) { char portbuf[RPCBIND_MAXUADDRPLEN]; char addrbuf[RPCBIND_MAXUADDRLEN]; @@ -288,7 +289,7 @@ char *rpc_sockaddr2uaddr(const struct sockaddr *sap) if (strlcat(addrbuf, portbuf, sizeof(addrbuf)) > sizeof(addrbuf)) return NULL; - return kstrdup(addrbuf, GFP_KERNEL); + return kstrdup(addrbuf, gfp_flags); } EXPORT_SYMBOL_GPL(rpc_sockaddr2uaddr); |