diff options
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/auth.c | 14 | ||||
-rw-r--r-- | net/sunrpc/clnt.c | 8 | ||||
-rw-r--r-- | net/sunrpc/rpcb_clnt.c | 17 | ||||
-rw-r--r-- | net/sunrpc/svcauth_unix.c | 24 | ||||
-rw-r--r-- | net/sunrpc/svcsock.c | 6 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | 4 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/svc_rdma_sendto.c | 2 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/svc_rdma_transport.c | 16 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/transport.c | 14 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/verbs.c | 16 | ||||
-rw-r--r-- | net/sunrpc/xprtsock.c | 41 |
11 files changed, 75 insertions, 87 deletions
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 050e4e84d9e3..0c431c277af5 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c | |||
@@ -350,16 +350,18 @@ EXPORT_SYMBOL_GPL(rpcauth_lookup_credcache); | |||
350 | struct rpc_cred * | 350 | struct rpc_cred * |
351 | rpcauth_lookupcred(struct rpc_auth *auth, int flags) | 351 | rpcauth_lookupcred(struct rpc_auth *auth, int flags) |
352 | { | 352 | { |
353 | struct auth_cred acred = { | 353 | struct auth_cred acred; |
354 | .uid = current->fsuid, | ||
355 | .gid = current->fsgid, | ||
356 | .group_info = current->group_info, | ||
357 | }; | ||
358 | struct rpc_cred *ret; | 354 | struct rpc_cred *ret; |
355 | const struct cred *cred = current_cred(); | ||
359 | 356 | ||
360 | dprintk("RPC: looking up %s cred\n", | 357 | dprintk("RPC: looking up %s cred\n", |
361 | auth->au_ops->au_name); | 358 | auth->au_ops->au_name); |
362 | get_group_info(acred.group_info); | 359 | |
360 | memset(&acred, 0, sizeof(acred)); | ||
361 | acred.uid = cred->fsuid; | ||
362 | acred.gid = cred->fsgid; | ||
363 | acred.group_info = get_group_info(((struct cred *)cred)->group_info); | ||
364 | |||
363 | ret = auth->au_ops->lookup_cred(auth, &acred, flags); | 365 | ret = auth->au_ops->lookup_cred(auth, &acred, flags); |
364 | put_group_info(acred.group_info); | 366 | put_group_info(acred.group_info); |
365 | return ret; | 367 | return ret; |
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 347f2a25abb6..836f15c0c4a3 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -279,15 +279,15 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args) | |||
279 | case AF_INET: { | 279 | case AF_INET: { |
280 | struct sockaddr_in *sin = | 280 | struct sockaddr_in *sin = |
281 | (struct sockaddr_in *)args->address; | 281 | (struct sockaddr_in *)args->address; |
282 | snprintf(servername, sizeof(servername), NIPQUAD_FMT, | 282 | snprintf(servername, sizeof(servername), "%pI4", |
283 | NIPQUAD(sin->sin_addr.s_addr)); | 283 | &sin->sin_addr.s_addr); |
284 | break; | 284 | break; |
285 | } | 285 | } |
286 | case AF_INET6: { | 286 | case AF_INET6: { |
287 | struct sockaddr_in6 *sin = | 287 | struct sockaddr_in6 *sin = |
288 | (struct sockaddr_in6 *)args->address; | 288 | (struct sockaddr_in6 *)args->address; |
289 | snprintf(servername, sizeof(servername), NIP6_FMT, | 289 | snprintf(servername, sizeof(servername), "%pI6", |
290 | NIP6(sin->sin6_addr)); | 290 | &sin->sin6_addr); |
291 | break; | 291 | break; |
292 | } | 292 | } |
293 | default: | 293 | default: |
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index 41013dd66ac3..03ae007641e4 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c | |||
@@ -270,10 +270,9 @@ static int rpcb_register_netid4(struct sockaddr_in *address_to_register, | |||
270 | char buf[32]; | 270 | char buf[32]; |
271 | 271 | ||
272 | /* Construct AF_INET universal address */ | 272 | /* Construct AF_INET universal address */ |
273 | snprintf(buf, sizeof(buf), | 273 | snprintf(buf, sizeof(buf), "%pI4.%u.%u", |
274 | NIPQUAD_FMT".%u.%u", | 274 | &address_to_register->sin_addr.s_addr, |
275 | NIPQUAD(address_to_register->sin_addr.s_addr), | 275 | port >> 8, port & 0xff); |
276 | port >> 8, port & 0xff); | ||
277 | map->r_addr = buf; | 276 | map->r_addr = buf; |
278 | 277 | ||
279 | dprintk("RPC: %sregistering [%u, %u, %s, '%s'] with " | 278 | dprintk("RPC: %sregistering [%u, %u, %s, '%s'] with " |
@@ -305,9 +304,9 @@ static int rpcb_register_netid6(struct sockaddr_in6 *address_to_register, | |||
305 | snprintf(buf, sizeof(buf), "::.%u.%u", | 304 | snprintf(buf, sizeof(buf), "::.%u.%u", |
306 | port >> 8, port & 0xff); | 305 | port >> 8, port & 0xff); |
307 | else | 306 | else |
308 | snprintf(buf, sizeof(buf), NIP6_FMT".%u.%u", | 307 | snprintf(buf, sizeof(buf), "%pI6.%u.%u", |
309 | NIP6(address_to_register->sin6_addr), | 308 | &address_to_register->sin6_addr, |
310 | port >> 8, port & 0xff); | 309 | port >> 8, port & 0xff); |
311 | map->r_addr = buf; | 310 | map->r_addr = buf; |
312 | 311 | ||
313 | dprintk("RPC: %sregistering [%u, %u, %s, '%s'] with " | 312 | dprintk("RPC: %sregistering [%u, %u, %s, '%s'] with " |
@@ -422,8 +421,8 @@ int rpcb_getport_sync(struct sockaddr_in *sin, u32 prog, u32 vers, int prot) | |||
422 | struct rpc_clnt *rpcb_clnt; | 421 | struct rpc_clnt *rpcb_clnt; |
423 | int status; | 422 | int status; |
424 | 423 | ||
425 | dprintk("RPC: %s(" NIPQUAD_FMT ", %u, %u, %d)\n", | 424 | dprintk("RPC: %s(%pI4, %u, %u, %d)\n", |
426 | __func__, NIPQUAD(sin->sin_addr.s_addr), prog, vers, prot); | 425 | __func__, &sin->sin_addr.s_addr, prog, vers, prot); |
427 | 426 | ||
428 | rpcb_clnt = rpcb_create(NULL, (struct sockaddr *)sin, | 427 | rpcb_clnt = rpcb_create(NULL, (struct sockaddr *)sin, |
429 | sizeof(*sin), prot, RPCBVERS_2); | 428 | sizeof(*sin), prot, RPCBVERS_2); |
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index f24800f2c098..82240e6127b2 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c | |||
@@ -162,13 +162,9 @@ static void ip_map_request(struct cache_detail *cd, | |||
162 | struct ip_map *im = container_of(h, struct ip_map, h); | 162 | struct ip_map *im = container_of(h, struct ip_map, h); |
163 | 163 | ||
164 | if (ipv6_addr_v4mapped(&(im->m_addr))) { | 164 | if (ipv6_addr_v4mapped(&(im->m_addr))) { |
165 | snprintf(text_addr, 20, NIPQUAD_FMT, | 165 | snprintf(text_addr, 20, "%pI4", &im->m_addr.s6_addr32[3]); |
166 | ntohl(im->m_addr.s6_addr32[3]) >> 24 & 0xff, | ||
167 | ntohl(im->m_addr.s6_addr32[3]) >> 16 & 0xff, | ||
168 | ntohl(im->m_addr.s6_addr32[3]) >> 8 & 0xff, | ||
169 | ntohl(im->m_addr.s6_addr32[3]) >> 0 & 0xff); | ||
170 | } else { | 166 | } else { |
171 | snprintf(text_addr, 40, NIP6_FMT, NIP6(im->m_addr)); | 167 | snprintf(text_addr, 40, "%pI6", &im->m_addr); |
172 | } | 168 | } |
173 | qword_add(bpp, blen, im->m_class); | 169 | qword_add(bpp, blen, im->m_class); |
174 | qword_add(bpp, blen, text_addr); | 170 | qword_add(bpp, blen, text_addr); |
@@ -208,13 +204,13 @@ static int ip_map_parse(struct cache_detail *cd, | |||
208 | len = qword_get(&mesg, buf, mlen); | 204 | len = qword_get(&mesg, buf, mlen); |
209 | if (len <= 0) return -EINVAL; | 205 | if (len <= 0) return -EINVAL; |
210 | 206 | ||
211 | if (sscanf(buf, NIPQUAD_FMT "%c", &b1, &b2, &b3, &b4, &c) == 4) { | 207 | if (sscanf(buf, "%u.%u.%u.%u%c", &b1, &b2, &b3, &b4, &c) == 4) { |
212 | addr.s6_addr32[0] = 0; | 208 | addr.s6_addr32[0] = 0; |
213 | addr.s6_addr32[1] = 0; | 209 | addr.s6_addr32[1] = 0; |
214 | addr.s6_addr32[2] = htonl(0xffff); | 210 | addr.s6_addr32[2] = htonl(0xffff); |
215 | addr.s6_addr32[3] = | 211 | addr.s6_addr32[3] = |
216 | htonl((((((b1<<8)|b2)<<8)|b3)<<8)|b4); | 212 | htonl((((((b1<<8)|b2)<<8)|b3)<<8)|b4); |
217 | } else if (sscanf(buf, NIP6_FMT "%c", | 213 | } else if (sscanf(buf, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x%c", |
218 | &b1, &b2, &b3, &b4, &b5, &b6, &b7, &b8, &c) == 8) { | 214 | &b1, &b2, &b3, &b4, &b5, &b6, &b7, &b8, &c) == 8) { |
219 | addr.s6_addr16[0] = htons(b1); | 215 | addr.s6_addr16[0] = htons(b1); |
220 | addr.s6_addr16[1] = htons(b2); | 216 | addr.s6_addr16[1] = htons(b2); |
@@ -278,16 +274,10 @@ static int ip_map_show(struct seq_file *m, | |||
278 | dom = im->m_client->h.name; | 274 | dom = im->m_client->h.name; |
279 | 275 | ||
280 | if (ipv6_addr_v4mapped(&addr)) { | 276 | if (ipv6_addr_v4mapped(&addr)) { |
281 | seq_printf(m, "%s " NIPQUAD_FMT " %s\n", | 277 | seq_printf(m, "%s %pI4 %s\n", |
282 | im->m_class, | 278 | im->m_class, &addr.s6_addr32[3], dom); |
283 | ntohl(addr.s6_addr32[3]) >> 24 & 0xff, | ||
284 | ntohl(addr.s6_addr32[3]) >> 16 & 0xff, | ||
285 | ntohl(addr.s6_addr32[3]) >> 8 & 0xff, | ||
286 | ntohl(addr.s6_addr32[3]) >> 0 & 0xff, | ||
287 | dom); | ||
288 | } else { | 279 | } else { |
289 | seq_printf(m, "%s " NIP6_FMT " %s\n", | 280 | seq_printf(m, "%s %pI6 %s\n", im->m_class, &addr, dom); |
290 | im->m_class, NIP6(addr), dom); | ||
291 | } | 281 | } |
292 | return 0; | 282 | return 0; |
293 | } | 283 | } |
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index a1951dcc5776..ef3238d665ee 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -250,10 +250,10 @@ static int one_sock_name(char *buf, struct svc_sock *svsk) | |||
250 | 250 | ||
251 | switch(svsk->sk_sk->sk_family) { | 251 | switch(svsk->sk_sk->sk_family) { |
252 | case AF_INET: | 252 | case AF_INET: |
253 | len = sprintf(buf, "ipv4 %s %u.%u.%u.%u %d\n", | 253 | len = sprintf(buf, "ipv4 %s %pI4 %d\n", |
254 | svsk->sk_sk->sk_protocol==IPPROTO_UDP? | 254 | svsk->sk_sk->sk_protocol == IPPROTO_UDP ? |
255 | "udp" : "tcp", | 255 | "udp" : "tcp", |
256 | NIPQUAD(inet_sk(svsk->sk_sk)->rcv_saddr), | 256 | &inet_sk(svsk->sk_sk)->rcv_saddr, |
257 | inet_sk(svsk->sk_sk)->num); | 257 | inet_sk(svsk->sk_sk)->num); |
258 | break; | 258 | break; |
259 | default: | 259 | default: |
diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c index a4756576d687..629a28764da9 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | |||
@@ -646,8 +646,7 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp) | |||
646 | ret = rdma_read_xdr(rdma_xprt, rmsgp, rqstp, ctxt); | 646 | ret = rdma_read_xdr(rdma_xprt, rmsgp, rqstp, ctxt); |
647 | if (ret > 0) { | 647 | if (ret > 0) { |
648 | /* read-list posted, defer until data received from client. */ | 648 | /* read-list posted, defer until data received from client. */ |
649 | svc_xprt_received(xprt); | 649 | goto defer; |
650 | return 0; | ||
651 | } | 650 | } |
652 | if (ret < 0) { | 651 | if (ret < 0) { |
653 | /* Post of read-list failed, free context. */ | 652 | /* Post of read-list failed, free context. */ |
@@ -679,6 +678,7 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp) | |||
679 | * close bit and call svc_xprt_delete | 678 | * close bit and call svc_xprt_delete |
680 | */ | 679 | */ |
681 | set_bit(XPT_CLOSE, &xprt->xpt_flags); | 680 | set_bit(XPT_CLOSE, &xprt->xpt_flags); |
681 | defer: | ||
682 | svc_xprt_received(xprt); | 682 | svc_xprt_received(xprt); |
683 | return 0; | 683 | return 0; |
684 | } | 684 | } |
diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c index 9a7a8e7ae038..a3334e3b73cc 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c | |||
@@ -69,7 +69,7 @@ | |||
69 | * array is only concerned with the reply we are assured that we have | 69 | * array is only concerned with the reply we are assured that we have |
70 | * on extra page for the RPCRMDA header. | 70 | * on extra page for the RPCRMDA header. |
71 | */ | 71 | */ |
72 | int fast_reg_xdr(struct svcxprt_rdma *xprt, | 72 | static int fast_reg_xdr(struct svcxprt_rdma *xprt, |
73 | struct xdr_buf *xdr, | 73 | struct xdr_buf *xdr, |
74 | struct svc_rdma_req_map *vec) | 74 | struct svc_rdma_req_map *vec) |
75 | { | 75 | { |
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index 6fb493cbd29f..3d810e7df3fb 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c | |||
@@ -61,7 +61,7 @@ static int svc_rdma_has_wspace(struct svc_xprt *xprt); | |||
61 | static void rq_cq_reap(struct svcxprt_rdma *xprt); | 61 | static void rq_cq_reap(struct svcxprt_rdma *xprt); |
62 | static void sq_cq_reap(struct svcxprt_rdma *xprt); | 62 | static void sq_cq_reap(struct svcxprt_rdma *xprt); |
63 | 63 | ||
64 | DECLARE_TASKLET(dto_tasklet, dto_tasklet_func, 0UL); | 64 | static DECLARE_TASKLET(dto_tasklet, dto_tasklet_func, 0UL); |
65 | static DEFINE_SPINLOCK(dto_lock); | 65 | static DEFINE_SPINLOCK(dto_lock); |
66 | static LIST_HEAD(dto_xprt_q); | 66 | static LIST_HEAD(dto_xprt_q); |
67 | 67 | ||
@@ -827,7 +827,7 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt) | |||
827 | struct rdma_conn_param conn_param; | 827 | struct rdma_conn_param conn_param; |
828 | struct ib_qp_init_attr qp_attr; | 828 | struct ib_qp_init_attr qp_attr; |
829 | struct ib_device_attr devattr; | 829 | struct ib_device_attr devattr; |
830 | int dma_mr_acc; | 830 | int uninitialized_var(dma_mr_acc); |
831 | int need_dma_mr; | 831 | int need_dma_mr; |
832 | int ret; | 832 | int ret; |
833 | int i; | 833 | int i; |
@@ -1048,21 +1048,21 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt) | |||
1048 | 1048 | ||
1049 | dprintk("svcrdma: new connection %p accepted with the following " | 1049 | dprintk("svcrdma: new connection %p accepted with the following " |
1050 | "attributes:\n" | 1050 | "attributes:\n" |
1051 | " local_ip : %d.%d.%d.%d\n" | 1051 | " local_ip : %pI4\n" |
1052 | " local_port : %d\n" | 1052 | " local_port : %d\n" |
1053 | " remote_ip : %d.%d.%d.%d\n" | 1053 | " remote_ip : %pI4\n" |
1054 | " remote_port : %d\n" | 1054 | " remote_port : %d\n" |
1055 | " max_sge : %d\n" | 1055 | " max_sge : %d\n" |
1056 | " sq_depth : %d\n" | 1056 | " sq_depth : %d\n" |
1057 | " max_requests : %d\n" | 1057 | " max_requests : %d\n" |
1058 | " ord : %d\n", | 1058 | " ord : %d\n", |
1059 | newxprt, | 1059 | newxprt, |
1060 | NIPQUAD(((struct sockaddr_in *)&newxprt->sc_cm_id-> | 1060 | &((struct sockaddr_in *)&newxprt->sc_cm_id-> |
1061 | route.addr.src_addr)->sin_addr.s_addr), | 1061 | route.addr.src_addr)->sin_addr.s_addr, |
1062 | ntohs(((struct sockaddr_in *)&newxprt->sc_cm_id-> | 1062 | ntohs(((struct sockaddr_in *)&newxprt->sc_cm_id-> |
1063 | route.addr.src_addr)->sin_port), | 1063 | route.addr.src_addr)->sin_port), |
1064 | NIPQUAD(((struct sockaddr_in *)&newxprt->sc_cm_id-> | 1064 | &((struct sockaddr_in *)&newxprt->sc_cm_id-> |
1065 | route.addr.dst_addr)->sin_addr.s_addr), | 1065 | route.addr.dst_addr)->sin_addr.s_addr, |
1066 | ntohs(((struct sockaddr_in *)&newxprt->sc_cm_id-> | 1066 | ntohs(((struct sockaddr_in *)&newxprt->sc_cm_id-> |
1067 | route.addr.dst_addr)->sin_port), | 1067 | route.addr.dst_addr)->sin_port), |
1068 | newxprt->sc_max_sge, | 1068 | newxprt->sc_max_sge, |
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c index 9839c3d94145..1dd6123070e9 100644 --- a/net/sunrpc/xprtrdma/transport.c +++ b/net/sunrpc/xprtrdma/transport.c | |||
@@ -174,7 +174,7 @@ xprt_rdma_format_addresses(struct rpc_xprt *xprt) | |||
174 | 174 | ||
175 | buf = kzalloc(20, GFP_KERNEL); | 175 | buf = kzalloc(20, GFP_KERNEL); |
176 | if (buf) | 176 | if (buf) |
177 | snprintf(buf, 20, NIPQUAD_FMT, NIPQUAD(addr->sin_addr.s_addr)); | 177 | snprintf(buf, 20, "%pI4", &addr->sin_addr.s_addr); |
178 | xprt->address_strings[RPC_DISPLAY_ADDR] = buf; | 178 | xprt->address_strings[RPC_DISPLAY_ADDR] = buf; |
179 | 179 | ||
180 | buf = kzalloc(8, GFP_KERNEL); | 180 | buf = kzalloc(8, GFP_KERNEL); |
@@ -186,8 +186,8 @@ xprt_rdma_format_addresses(struct rpc_xprt *xprt) | |||
186 | 186 | ||
187 | buf = kzalloc(48, GFP_KERNEL); | 187 | buf = kzalloc(48, GFP_KERNEL); |
188 | if (buf) | 188 | if (buf) |
189 | snprintf(buf, 48, "addr="NIPQUAD_FMT" port=%u proto=%s", | 189 | snprintf(buf, 48, "addr=%pI4 port=%u proto=%s", |
190 | NIPQUAD(addr->sin_addr.s_addr), | 190 | &addr->sin_addr.s_addr, |
191 | ntohs(addr->sin_port), "rdma"); | 191 | ntohs(addr->sin_port), "rdma"); |
192 | xprt->address_strings[RPC_DISPLAY_ALL] = buf; | 192 | xprt->address_strings[RPC_DISPLAY_ALL] = buf; |
193 | 193 | ||
@@ -204,8 +204,8 @@ xprt_rdma_format_addresses(struct rpc_xprt *xprt) | |||
204 | 204 | ||
205 | buf = kzalloc(30, GFP_KERNEL); | 205 | buf = kzalloc(30, GFP_KERNEL); |
206 | if (buf) | 206 | if (buf) |
207 | snprintf(buf, 30, NIPQUAD_FMT".%u.%u", | 207 | snprintf(buf, 30, "%pI4.%u.%u", |
208 | NIPQUAD(addr->sin_addr.s_addr), | 208 | &addr->sin_addr.s_addr, |
209 | ntohs(addr->sin_port) >> 8, | 209 | ntohs(addr->sin_port) >> 8, |
210 | ntohs(addr->sin_port) & 0xff); | 210 | ntohs(addr->sin_port) & 0xff); |
211 | xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR] = buf; | 211 | xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR] = buf; |
@@ -369,8 +369,8 @@ xprt_setup_rdma(struct xprt_create *args) | |||
369 | if (ntohs(sin->sin_port) != 0) | 369 | if (ntohs(sin->sin_port) != 0) |
370 | xprt_set_bound(xprt); | 370 | xprt_set_bound(xprt); |
371 | 371 | ||
372 | dprintk("RPC: %s: %u.%u.%u.%u:%u\n", __func__, | 372 | dprintk("RPC: %s: %pI4:%u\n", |
373 | NIPQUAD(sin->sin_addr.s_addr), ntohs(sin->sin_port)); | 373 | __func__, &sin->sin_addr.s_addr, ntohs(sin->sin_port)); |
374 | 374 | ||
375 | /* Set max requests */ | 375 | /* Set max requests */ |
376 | cdata.max_requests = xprt->max_reqs; | 376 | cdata.max_requests = xprt->max_reqs; |
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c index a5fef5e6c323..3b21e0cc5e69 100644 --- a/net/sunrpc/xprtrdma/verbs.c +++ b/net/sunrpc/xprtrdma/verbs.c | |||
@@ -276,7 +276,9 @@ rpcrdma_conn_upcall(struct rdma_cm_id *id, struct rdma_cm_event *event) | |||
276 | struct rpcrdma_xprt *xprt = id->context; | 276 | struct rpcrdma_xprt *xprt = id->context; |
277 | struct rpcrdma_ia *ia = &xprt->rx_ia; | 277 | struct rpcrdma_ia *ia = &xprt->rx_ia; |
278 | struct rpcrdma_ep *ep = &xprt->rx_ep; | 278 | struct rpcrdma_ep *ep = &xprt->rx_ep; |
279 | #ifdef RPC_DEBUG | ||
279 | struct sockaddr_in *addr = (struct sockaddr_in *) &ep->rep_remote_addr; | 280 | struct sockaddr_in *addr = (struct sockaddr_in *) &ep->rep_remote_addr; |
281 | #endif | ||
280 | struct ib_qp_attr attr; | 282 | struct ib_qp_attr attr; |
281 | struct ib_qp_init_attr iattr; | 283 | struct ib_qp_init_attr iattr; |
282 | int connstate = 0; | 284 | int connstate = 0; |
@@ -323,12 +325,11 @@ rpcrdma_conn_upcall(struct rdma_cm_id *id, struct rdma_cm_event *event) | |||
323 | case RDMA_CM_EVENT_DEVICE_REMOVAL: | 325 | case RDMA_CM_EVENT_DEVICE_REMOVAL: |
324 | connstate = -ENODEV; | 326 | connstate = -ENODEV; |
325 | connected: | 327 | connected: |
326 | dprintk("RPC: %s: %s: %u.%u.%u.%u:%u" | 328 | dprintk("RPC: %s: %s: %pI4:%u (ep 0x%p event 0x%x)\n", |
327 | " (ep 0x%p event 0x%x)\n", | ||
328 | __func__, | 329 | __func__, |
329 | (event->event <= 11) ? conn[event->event] : | 330 | (event->event <= 11) ? conn[event->event] : |
330 | "unknown connection error", | 331 | "unknown connection error", |
331 | NIPQUAD(addr->sin_addr.s_addr), | 332 | &addr->sin_addr.s_addr, |
332 | ntohs(addr->sin_port), | 333 | ntohs(addr->sin_port), |
333 | ep, event->event); | 334 | ep, event->event); |
334 | atomic_set(&rpcx_to_rdmax(ep->rep_xprt)->rx_buf.rb_credits, 1); | 335 | atomic_set(&rpcx_to_rdmax(ep->rep_xprt)->rx_buf.rb_credits, 1); |
@@ -348,18 +349,17 @@ connected: | |||
348 | if (connstate == 1) { | 349 | if (connstate == 1) { |
349 | int ird = attr.max_dest_rd_atomic; | 350 | int ird = attr.max_dest_rd_atomic; |
350 | int tird = ep->rep_remote_cma.responder_resources; | 351 | int tird = ep->rep_remote_cma.responder_resources; |
351 | printk(KERN_INFO "rpcrdma: connection to %u.%u.%u.%u:%u " | 352 | printk(KERN_INFO "rpcrdma: connection to %pI4:%u " |
352 | "on %s, memreg %d slots %d ird %d%s\n", | 353 | "on %s, memreg %d slots %d ird %d%s\n", |
353 | NIPQUAD(addr->sin_addr.s_addr), | 354 | &addr->sin_addr.s_addr, |
354 | ntohs(addr->sin_port), | 355 | ntohs(addr->sin_port), |
355 | ia->ri_id->device->name, | 356 | ia->ri_id->device->name, |
356 | ia->ri_memreg_strategy, | 357 | ia->ri_memreg_strategy, |
357 | xprt->rx_buf.rb_max_requests, | 358 | xprt->rx_buf.rb_max_requests, |
358 | ird, ird < 4 && ird < tird / 2 ? " (low!)" : ""); | 359 | ird, ird < 4 && ird < tird / 2 ? " (low!)" : ""); |
359 | } else if (connstate < 0) { | 360 | } else if (connstate < 0) { |
360 | printk(KERN_INFO "rpcrdma: connection to %u.%u.%u.%u:%u " | 361 | printk(KERN_INFO "rpcrdma: connection to %pI4:%u closed (%d)\n", |
361 | "closed (%d)\n", | 362 | &addr->sin_addr.s_addr, |
362 | NIPQUAD(addr->sin_addr.s_addr), | ||
363 | ntohs(addr->sin_port), | 363 | ntohs(addr->sin_port), |
364 | connstate); | 364 | connstate); |
365 | } | 365 | } |
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 0a50361e3d83..5cbb404c4cdf 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -284,8 +284,7 @@ static void xs_format_ipv4_peer_addresses(struct rpc_xprt *xprt, | |||
284 | 284 | ||
285 | buf = kzalloc(20, GFP_KERNEL); | 285 | buf = kzalloc(20, GFP_KERNEL); |
286 | if (buf) { | 286 | if (buf) { |
287 | snprintf(buf, 20, NIPQUAD_FMT, | 287 | snprintf(buf, 20, "%pI4", &addr->sin_addr.s_addr); |
288 | NIPQUAD(addr->sin_addr.s_addr)); | ||
289 | } | 288 | } |
290 | xprt->address_strings[RPC_DISPLAY_ADDR] = buf; | 289 | xprt->address_strings[RPC_DISPLAY_ADDR] = buf; |
291 | 290 | ||
@@ -300,8 +299,8 @@ static void xs_format_ipv4_peer_addresses(struct rpc_xprt *xprt, | |||
300 | 299 | ||
301 | buf = kzalloc(48, GFP_KERNEL); | 300 | buf = kzalloc(48, GFP_KERNEL); |
302 | if (buf) { | 301 | if (buf) { |
303 | snprintf(buf, 48, "addr="NIPQUAD_FMT" port=%u proto=%s", | 302 | snprintf(buf, 48, "addr=%pI4 port=%u proto=%s", |
304 | NIPQUAD(addr->sin_addr.s_addr), | 303 | &addr->sin_addr.s_addr, |
305 | ntohs(addr->sin_port), | 304 | ntohs(addr->sin_port), |
306 | protocol); | 305 | protocol); |
307 | } | 306 | } |
@@ -323,8 +322,8 @@ static void xs_format_ipv4_peer_addresses(struct rpc_xprt *xprt, | |||
323 | 322 | ||
324 | buf = kzalloc(30, GFP_KERNEL); | 323 | buf = kzalloc(30, GFP_KERNEL); |
325 | if (buf) { | 324 | if (buf) { |
326 | snprintf(buf, 30, NIPQUAD_FMT".%u.%u", | 325 | snprintf(buf, 30, "%pI4.%u.%u", |
327 | NIPQUAD(addr->sin_addr.s_addr), | 326 | &addr->sin_addr.s_addr, |
328 | ntohs(addr->sin_port) >> 8, | 327 | ntohs(addr->sin_port) >> 8, |
329 | ntohs(addr->sin_port) & 0xff); | 328 | ntohs(addr->sin_port) & 0xff); |
330 | } | 329 | } |
@@ -342,8 +341,7 @@ static void xs_format_ipv6_peer_addresses(struct rpc_xprt *xprt, | |||
342 | 341 | ||
343 | buf = kzalloc(40, GFP_KERNEL); | 342 | buf = kzalloc(40, GFP_KERNEL); |
344 | if (buf) { | 343 | if (buf) { |
345 | snprintf(buf, 40, NIP6_FMT, | 344 | snprintf(buf, 40, "%pI6",&addr->sin6_addr); |
346 | NIP6(addr->sin6_addr)); | ||
347 | } | 345 | } |
348 | xprt->address_strings[RPC_DISPLAY_ADDR] = buf; | 346 | xprt->address_strings[RPC_DISPLAY_ADDR] = buf; |
349 | 347 | ||
@@ -358,18 +356,17 @@ static void xs_format_ipv6_peer_addresses(struct rpc_xprt *xprt, | |||
358 | 356 | ||
359 | buf = kzalloc(64, GFP_KERNEL); | 357 | buf = kzalloc(64, GFP_KERNEL); |
360 | if (buf) { | 358 | if (buf) { |
361 | snprintf(buf, 64, "addr="NIP6_FMT" port=%u proto=%s", | 359 | snprintf(buf, 64, "addr=%pI6 port=%u proto=%s", |
362 | NIP6(addr->sin6_addr), | 360 | &addr->sin6_addr, |
363 | ntohs(addr->sin6_port), | 361 | ntohs(addr->sin6_port), |
364 | protocol); | 362 | protocol); |
365 | } | 363 | } |
366 | xprt->address_strings[RPC_DISPLAY_ALL] = buf; | 364 | xprt->address_strings[RPC_DISPLAY_ALL] = buf; |
367 | 365 | ||
368 | buf = kzalloc(36, GFP_KERNEL); | 366 | buf = kzalloc(36, GFP_KERNEL); |
369 | if (buf) { | 367 | if (buf) |
370 | snprintf(buf, 36, NIP6_SEQFMT, | 368 | snprintf(buf, 36, "%pi6", &addr->sin6_addr); |
371 | NIP6(addr->sin6_addr)); | 369 | |
372 | } | ||
373 | xprt->address_strings[RPC_DISPLAY_HEX_ADDR] = buf; | 370 | xprt->address_strings[RPC_DISPLAY_HEX_ADDR] = buf; |
374 | 371 | ||
375 | buf = kzalloc(8, GFP_KERNEL); | 372 | buf = kzalloc(8, GFP_KERNEL); |
@@ -381,10 +378,10 @@ static void xs_format_ipv6_peer_addresses(struct rpc_xprt *xprt, | |||
381 | 378 | ||
382 | buf = kzalloc(50, GFP_KERNEL); | 379 | buf = kzalloc(50, GFP_KERNEL); |
383 | if (buf) { | 380 | if (buf) { |
384 | snprintf(buf, 50, NIP6_FMT".%u.%u", | 381 | snprintf(buf, 50, "%pI6.%u.%u", |
385 | NIP6(addr->sin6_addr), | 382 | &addr->sin6_addr, |
386 | ntohs(addr->sin6_port) >> 8, | 383 | ntohs(addr->sin6_port) >> 8, |
387 | ntohs(addr->sin6_port) & 0xff); | 384 | ntohs(addr->sin6_port) & 0xff); |
388 | } | 385 | } |
389 | xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR] = buf; | 386 | xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR] = buf; |
390 | 387 | ||
@@ -1415,8 +1412,8 @@ static int xs_bind4(struct sock_xprt *transport, struct socket *sock) | |||
1415 | if (port > last) | 1412 | if (port > last) |
1416 | nloop++; | 1413 | nloop++; |
1417 | } while (err == -EADDRINUSE && nloop != 2); | 1414 | } while (err == -EADDRINUSE && nloop != 2); |
1418 | dprintk("RPC: %s "NIPQUAD_FMT":%u: %s (%d)\n", | 1415 | dprintk("RPC: %s %pI4:%u: %s (%d)\n", |
1419 | __func__, NIPQUAD(myaddr.sin_addr), | 1416 | __func__, &myaddr.sin_addr, |
1420 | port, err ? "failed" : "ok", err); | 1417 | port, err ? "failed" : "ok", err); |
1421 | return err; | 1418 | return err; |
1422 | } | 1419 | } |
@@ -1448,8 +1445,8 @@ static int xs_bind6(struct sock_xprt *transport, struct socket *sock) | |||
1448 | if (port > last) | 1445 | if (port > last) |
1449 | nloop++; | 1446 | nloop++; |
1450 | } while (err == -EADDRINUSE && nloop != 2); | 1447 | } while (err == -EADDRINUSE && nloop != 2); |
1451 | dprintk("RPC: xs_bind6 "NIP6_FMT":%u: %s (%d)\n", | 1448 | dprintk("RPC: xs_bind6 %pI6:%u: %s (%d)\n", |
1452 | NIP6(myaddr.sin6_addr), port, err ? "failed" : "ok", err); | 1449 | &myaddr.sin6_addr, port, err ? "failed" : "ok", err); |
1453 | return err; | 1450 | return err; |
1454 | } | 1451 | } |
1455 | 1452 | ||