diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2009-08-21 11:27:29 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-08-21 11:27:29 -0400 |
commit | e9dc122166b8d863d3057a66ada04838e5548e52 (patch) | |
tree | 749e15bf719b64bf9113db7acd8e043d9742cb26 /net/sunrpc/xprtrdma/transport.c | |
parent | 560ab42ef923aaf2e4347315bdfcc74b2708972c (diff) | |
parent | 405d8f8b1d936414da2093d4149ff790ff3f84a5 (diff) |
Merge branch 'nfs-for-2.6.32' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6 into for-2.6.32-incoming
Conflicts:
net/sunrpc/cache.c
Diffstat (limited to 'net/sunrpc/xprtrdma/transport.c')
-rw-r--r-- | net/sunrpc/xprtrdma/transport.c | 48 |
1 files changed, 13 insertions, 35 deletions
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c index 1dd6123070e9..9a63f669ece4 100644 --- a/net/sunrpc/xprtrdma/transport.c +++ b/net/sunrpc/xprtrdma/transport.c | |||
@@ -168,47 +168,25 @@ static struct rpc_xprt_ops xprt_rdma_procs; /* forward reference */ | |||
168 | static void | 168 | static void |
169 | xprt_rdma_format_addresses(struct rpc_xprt *xprt) | 169 | xprt_rdma_format_addresses(struct rpc_xprt *xprt) |
170 | { | 170 | { |
171 | struct sockaddr_in *addr = (struct sockaddr_in *) | 171 | struct sockaddr *sap = (struct sockaddr *) |
172 | &rpcx_to_rdmad(xprt).addr; | 172 | &rpcx_to_rdmad(xprt).addr; |
173 | char *buf; | 173 | struct sockaddr_in *sin = (struct sockaddr_in *)sap; |
174 | char buf[64]; | ||
174 | 175 | ||
175 | buf = kzalloc(20, GFP_KERNEL); | 176 | (void)rpc_ntop(sap, buf, sizeof(buf)); |
176 | if (buf) | 177 | xprt->address_strings[RPC_DISPLAY_ADDR] = kstrdup(buf, GFP_KERNEL); |
177 | snprintf(buf, 20, "%pI4", &addr->sin_addr.s_addr); | ||
178 | xprt->address_strings[RPC_DISPLAY_ADDR] = buf; | ||
179 | 178 | ||
180 | buf = kzalloc(8, GFP_KERNEL); | 179 | (void)snprintf(buf, sizeof(buf), "%u", rpc_get_port(sap)); |
181 | if (buf) | 180 | xprt->address_strings[RPC_DISPLAY_PORT] = kstrdup(buf, GFP_KERNEL); |
182 | snprintf(buf, 8, "%u", ntohs(addr->sin_port)); | ||
183 | xprt->address_strings[RPC_DISPLAY_PORT] = buf; | ||
184 | 181 | ||
185 | xprt->address_strings[RPC_DISPLAY_PROTO] = "rdma"; | 182 | xprt->address_strings[RPC_DISPLAY_PROTO] = "rdma"; |
186 | 183 | ||
187 | buf = kzalloc(48, GFP_KERNEL); | 184 | (void)snprintf(buf, sizeof(buf), "%02x%02x%02x%02x", |
188 | if (buf) | 185 | NIPQUAD(sin->sin_addr.s_addr)); |
189 | snprintf(buf, 48, "addr=%pI4 port=%u proto=%s", | 186 | xprt->address_strings[RPC_DISPLAY_HEX_ADDR] = kstrdup(buf, GFP_KERNEL); |
190 | &addr->sin_addr.s_addr, | 187 | |
191 | ntohs(addr->sin_port), "rdma"); | 188 | (void)snprintf(buf, sizeof(buf), "%4hx", rpc_get_port(sap)); |
192 | xprt->address_strings[RPC_DISPLAY_ALL] = buf; | 189 | xprt->address_strings[RPC_DISPLAY_HEX_PORT] = kstrdup(buf, GFP_KERNEL); |
193 | |||
194 | buf = kzalloc(10, GFP_KERNEL); | ||
195 | if (buf) | ||
196 | snprintf(buf, 10, "%02x%02x%02x%02x", | ||
197 | NIPQUAD(addr->sin_addr.s_addr)); | ||
198 | xprt->address_strings[RPC_DISPLAY_HEX_ADDR] = buf; | ||
199 | |||
200 | buf = kzalloc(8, GFP_KERNEL); | ||
201 | if (buf) | ||
202 | snprintf(buf, 8, "%4hx", ntohs(addr->sin_port)); | ||
203 | xprt->address_strings[RPC_DISPLAY_HEX_PORT] = buf; | ||
204 | |||
205 | buf = kzalloc(30, GFP_KERNEL); | ||
206 | if (buf) | ||
207 | snprintf(buf, 30, "%pI4.%u.%u", | ||
208 | &addr->sin_addr.s_addr, | ||
209 | ntohs(addr->sin_port) >> 8, | ||
210 | ntohs(addr->sin_port) & 0xff); | ||
211 | xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR] = buf; | ||
212 | 190 | ||
213 | /* netid */ | 191 | /* netid */ |
214 | xprt->address_strings[RPC_DISPLAY_NETID] = "rdma"; | 192 | xprt->address_strings[RPC_DISPLAY_NETID] = "rdma"; |