aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c2
-rw-r--r--net/sunrpc/auth_gss/gss_mech_switch.c2
-rw-r--r--net/sunrpc/clnt.c48
-rw-r--r--net/sunrpc/rpc_pipe.c12
-rw-r--r--net/sunrpc/rpcb_clnt.c20
-rw-r--r--net/sunrpc/svc.c16
-rw-r--r--net/sunrpc/svc_xprt.c2
-rw-r--r--net/sunrpc/xdr.c9
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_recvfrom.c23
-rw-r--r--net/sunrpc/xprtrdma/verbs.c1
-rw-r--r--net/sunrpc/xprtsock.c2
11 files changed, 70 insertions, 67 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 621c07f322c4..cc12d5f5d5da 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -624,7 +624,7 @@ gss_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor)
624 gss_auth->mech = gss_mech_get_by_pseudoflavor(flavor); 624 gss_auth->mech = gss_mech_get_by_pseudoflavor(flavor);
625 if (!gss_auth->mech) { 625 if (!gss_auth->mech) {
626 printk(KERN_WARNING "%s: Pseudoflavor %d not found!\n", 626 printk(KERN_WARNING "%s: Pseudoflavor %d not found!\n",
627 __FUNCTION__, flavor); 627 __func__, flavor);
628 goto err_free; 628 goto err_free;
629 } 629 }
630 gss_auth->service = gss_pseudoflavor_to_service(gss_auth->mech, flavor); 630 gss_auth->service = gss_pseudoflavor_to_service(gss_auth->mech, flavor);
diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c
index 61801a069ff0..bce9d527af08 100644
--- a/net/sunrpc/auth_gss/gss_mech_switch.c
+++ b/net/sunrpc/auth_gss/gss_mech_switch.c
@@ -317,7 +317,7 @@ gss_delete_sec_context(struct gss_ctx **context_handle)
317 317
318 if (!*context_handle) 318 if (!*context_handle)
319 return(GSS_S_NO_CONTEXT); 319 return(GSS_S_NO_CONTEXT);
320 if ((*context_handle)->internal_ctx_id != 0) 320 if ((*context_handle)->internal_ctx_id)
321 (*context_handle)->mech_type->gm_ops 321 (*context_handle)->mech_type->gm_ops
322 ->gss_delete_sec_context((*context_handle) 322 ->gss_delete_sec_context((*context_handle)
323 ->internal_ctx_id); 323 ->internal_ctx_id);
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index c6efb982057b..8945307556ec 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -43,7 +43,7 @@
43 43
44#define dprint_status(t) \ 44#define dprint_status(t) \
45 dprintk("RPC: %5u %s (status %d)\n", t->tk_pid, \ 45 dprintk("RPC: %5u %s (status %d)\n", t->tk_pid, \
46 __FUNCTION__, t->tk_status) 46 __func__, t->tk_status)
47 47
48/* 48/*
49 * All RPC clients are linked into this list 49 * All RPC clients are linked into this list
@@ -261,10 +261,6 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
261 }; 261 };
262 char servername[48]; 262 char servername[48];
263 263
264 xprt = xprt_create_transport(&xprtargs);
265 if (IS_ERR(xprt))
266 return (struct rpc_clnt *)xprt;
267
268 /* 264 /*
269 * If the caller chooses not to specify a hostname, whip 265 * If the caller chooses not to specify a hostname, whip
270 * up a string representation of the passed-in address. 266 * up a string representation of the passed-in address.
@@ -372,7 +368,7 @@ out_no_path:
372out_no_stats: 368out_no_stats:
373 kfree(new); 369 kfree(new);
374out_no_clnt: 370out_no_clnt:
375 dprintk("RPC: %s: returned error %d\n", __FUNCTION__, err); 371 dprintk("RPC: %s: returned error %d\n", __func__, err);
376 return ERR_PTR(err); 372 return ERR_PTR(err);
377} 373}
378EXPORT_SYMBOL_GPL(rpc_clone_client); 374EXPORT_SYMBOL_GPL(rpc_clone_client);
@@ -756,7 +752,7 @@ call_reserveresult(struct rpc_task *task)
756 } 752 }
757 753
758 printk(KERN_ERR "%s: status=%d, but no request slot, exiting\n", 754 printk(KERN_ERR "%s: status=%d, but no request slot, exiting\n",
759 __FUNCTION__, status); 755 __func__, status);
760 rpc_exit(task, -EIO); 756 rpc_exit(task, -EIO);
761 return; 757 return;
762 } 758 }
@@ -767,7 +763,7 @@ call_reserveresult(struct rpc_task *task)
767 */ 763 */
768 if (task->tk_rqstp) { 764 if (task->tk_rqstp) {
769 printk(KERN_ERR "%s: status=%d, request allocated anyway\n", 765 printk(KERN_ERR "%s: status=%d, request allocated anyway\n",
770 __FUNCTION__, status); 766 __func__, status);
771 xprt_release(task); 767 xprt_release(task);
772 } 768 }
773 769
@@ -779,7 +775,7 @@ call_reserveresult(struct rpc_task *task)
779 break; 775 break;
780 default: 776 default:
781 printk(KERN_ERR "%s: unrecognized error %d, exiting\n", 777 printk(KERN_ERR "%s: unrecognized error %d, exiting\n",
782 __FUNCTION__, status); 778 __func__, status);
783 break; 779 break;
784 } 780 }
785 rpc_exit(task, status); 781 rpc_exit(task, status);
@@ -1337,7 +1333,7 @@ call_verify(struct rpc_task *task)
1337 * undefined results 1333 * undefined results
1338 */ 1334 */
1339 dprintk("RPC: %5u %s: XDR representation not a multiple of" 1335 dprintk("RPC: %5u %s: XDR representation not a multiple of"
1340 " 4 bytes: 0x%x\n", task->tk_pid, __FUNCTION__, 1336 " 4 bytes: 0x%x\n", task->tk_pid, __func__,
1341 task->tk_rqstp->rq_rcv_buf.len); 1337 task->tk_rqstp->rq_rcv_buf.len);
1342 goto out_eio; 1338 goto out_eio;
1343 } 1339 }
@@ -1347,7 +1343,7 @@ call_verify(struct rpc_task *task)
1347 1343
1348 if ((n = ntohl(*p++)) != RPC_REPLY) { 1344 if ((n = ntohl(*p++)) != RPC_REPLY) {
1349 dprintk("RPC: %5u %s: not an RPC reply: %x\n", 1345 dprintk("RPC: %5u %s: not an RPC reply: %x\n",
1350 task->tk_pid, __FUNCTION__, n); 1346 task->tk_pid, __func__, n);
1351 goto out_garbage; 1347 goto out_garbage;
1352 } 1348 }
1353 if ((n = ntohl(*p++)) != RPC_MSG_ACCEPTED) { 1349 if ((n = ntohl(*p++)) != RPC_MSG_ACCEPTED) {
@@ -1359,13 +1355,13 @@ call_verify(struct rpc_task *task)
1359 case RPC_MISMATCH: 1355 case RPC_MISMATCH:
1360 dprintk("RPC: %5u %s: RPC call version " 1356 dprintk("RPC: %5u %s: RPC call version "
1361 "mismatch!\n", 1357 "mismatch!\n",
1362 task->tk_pid, __FUNCTION__); 1358 task->tk_pid, __func__);
1363 error = -EPROTONOSUPPORT; 1359 error = -EPROTONOSUPPORT;
1364 goto out_err; 1360 goto out_err;
1365 default: 1361 default:
1366 dprintk("RPC: %5u %s: RPC call rejected, " 1362 dprintk("RPC: %5u %s: RPC call rejected, "
1367 "unknown error: %x\n", 1363 "unknown error: %x\n",
1368 task->tk_pid, __FUNCTION__, n); 1364 task->tk_pid, __func__, n);
1369 goto out_eio; 1365 goto out_eio;
1370 } 1366 }
1371 if (--len < 0) 1367 if (--len < 0)
@@ -1379,7 +1375,7 @@ call_verify(struct rpc_task *task)
1379 break; 1375 break;
1380 task->tk_cred_retry--; 1376 task->tk_cred_retry--;
1381 dprintk("RPC: %5u %s: retry stale creds\n", 1377 dprintk("RPC: %5u %s: retry stale creds\n",
1382 task->tk_pid, __FUNCTION__); 1378 task->tk_pid, __func__);
1383 rpcauth_invalcred(task); 1379 rpcauth_invalcred(task);
1384 /* Ensure we obtain a new XID! */ 1380 /* Ensure we obtain a new XID! */
1385 xprt_release(task); 1381 xprt_release(task);
@@ -1392,7 +1388,7 @@ call_verify(struct rpc_task *task)
1392 break; 1388 break;
1393 task->tk_garb_retry--; 1389 task->tk_garb_retry--;
1394 dprintk("RPC: %5u %s: retry garbled creds\n", 1390 dprintk("RPC: %5u %s: retry garbled creds\n",
1395 task->tk_pid, __FUNCTION__); 1391 task->tk_pid, __func__);
1396 task->tk_action = call_bind; 1392 task->tk_action = call_bind;
1397 goto out_retry; 1393 goto out_retry;
1398 case RPC_AUTH_TOOWEAK: 1394 case RPC_AUTH_TOOWEAK:
@@ -1401,16 +1397,16 @@ call_verify(struct rpc_task *task)
1401 break; 1397 break;
1402 default: 1398 default:
1403 dprintk("RPC: %5u %s: unknown auth error: %x\n", 1399 dprintk("RPC: %5u %s: unknown auth error: %x\n",
1404 task->tk_pid, __FUNCTION__, n); 1400 task->tk_pid, __func__, n);
1405 error = -EIO; 1401 error = -EIO;
1406 } 1402 }
1407 dprintk("RPC: %5u %s: call rejected %d\n", 1403 dprintk("RPC: %5u %s: call rejected %d\n",
1408 task->tk_pid, __FUNCTION__, n); 1404 task->tk_pid, __func__, n);
1409 goto out_err; 1405 goto out_err;
1410 } 1406 }
1411 if (!(p = rpcauth_checkverf(task, p))) { 1407 if (!(p = rpcauth_checkverf(task, p))) {
1412 dprintk("RPC: %5u %s: auth check failed\n", 1408 dprintk("RPC: %5u %s: auth check failed\n",
1413 task->tk_pid, __FUNCTION__); 1409 task->tk_pid, __func__);
1414 goto out_garbage; /* bad verifier, retry */ 1410 goto out_garbage; /* bad verifier, retry */
1415 } 1411 }
1416 len = p - (__be32 *)iov->iov_base - 1; 1412 len = p - (__be32 *)iov->iov_base - 1;
@@ -1421,14 +1417,14 @@ call_verify(struct rpc_task *task)
1421 return p; 1417 return p;
1422 case RPC_PROG_UNAVAIL: 1418 case RPC_PROG_UNAVAIL:
1423 dprintk("RPC: %5u %s: program %u is unsupported by server %s\n", 1419 dprintk("RPC: %5u %s: program %u is unsupported by server %s\n",
1424 task->tk_pid, __FUNCTION__, 1420 task->tk_pid, __func__,
1425 (unsigned int)task->tk_client->cl_prog, 1421 (unsigned int)task->tk_client->cl_prog,
1426 task->tk_client->cl_server); 1422 task->tk_client->cl_server);
1427 error = -EPFNOSUPPORT; 1423 error = -EPFNOSUPPORT;
1428 goto out_err; 1424 goto out_err;
1429 case RPC_PROG_MISMATCH: 1425 case RPC_PROG_MISMATCH:
1430 dprintk("RPC: %5u %s: program %u, version %u unsupported by " 1426 dprintk("RPC: %5u %s: program %u, version %u unsupported by "
1431 "server %s\n", task->tk_pid, __FUNCTION__, 1427 "server %s\n", task->tk_pid, __func__,
1432 (unsigned int)task->tk_client->cl_prog, 1428 (unsigned int)task->tk_client->cl_prog,
1433 (unsigned int)task->tk_client->cl_vers, 1429 (unsigned int)task->tk_client->cl_vers,
1434 task->tk_client->cl_server); 1430 task->tk_client->cl_server);
@@ -1437,7 +1433,7 @@ call_verify(struct rpc_task *task)
1437 case RPC_PROC_UNAVAIL: 1433 case RPC_PROC_UNAVAIL:
1438 dprintk("RPC: %5u %s: proc %p unsupported by program %u, " 1434 dprintk("RPC: %5u %s: proc %p unsupported by program %u, "
1439 "version %u on server %s\n", 1435 "version %u on server %s\n",
1440 task->tk_pid, __FUNCTION__, 1436 task->tk_pid, __func__,
1441 task->tk_msg.rpc_proc, 1437 task->tk_msg.rpc_proc,
1442 task->tk_client->cl_prog, 1438 task->tk_client->cl_prog,
1443 task->tk_client->cl_vers, 1439 task->tk_client->cl_vers,
@@ -1446,11 +1442,11 @@ call_verify(struct rpc_task *task)
1446 goto out_err; 1442 goto out_err;
1447 case RPC_GARBAGE_ARGS: 1443 case RPC_GARBAGE_ARGS:
1448 dprintk("RPC: %5u %s: server saw garbage\n", 1444 dprintk("RPC: %5u %s: server saw garbage\n",
1449 task->tk_pid, __FUNCTION__); 1445 task->tk_pid, __func__);
1450 break; /* retry */ 1446 break; /* retry */
1451 default: 1447 default:
1452 dprintk("RPC: %5u %s: server accept status: %x\n", 1448 dprintk("RPC: %5u %s: server accept status: %x\n",
1453 task->tk_pid, __FUNCTION__, n); 1449 task->tk_pid, __func__, n);
1454 /* Also retry */ 1450 /* Also retry */
1455 } 1451 }
1456 1452
@@ -1459,7 +1455,7 @@ out_garbage:
1459 if (task->tk_garb_retry) { 1455 if (task->tk_garb_retry) {
1460 task->tk_garb_retry--; 1456 task->tk_garb_retry--;
1461 dprintk("RPC: %5u %s: retrying\n", 1457 dprintk("RPC: %5u %s: retrying\n",
1462 task->tk_pid, __FUNCTION__); 1458 task->tk_pid, __func__);
1463 task->tk_action = call_bind; 1459 task->tk_action = call_bind;
1464out_retry: 1460out_retry:
1465 return ERR_PTR(-EAGAIN); 1461 return ERR_PTR(-EAGAIN);
@@ -1469,11 +1465,11 @@ out_eio:
1469out_err: 1465out_err:
1470 rpc_exit(task, error); 1466 rpc_exit(task, error);
1471 dprintk("RPC: %5u %s: call failed with error %d\n", task->tk_pid, 1467 dprintk("RPC: %5u %s: call failed with error %d\n", task->tk_pid,
1472 __FUNCTION__, error); 1468 __func__, error);
1473 return ERR_PTR(error); 1469 return ERR_PTR(error);
1474out_overflow: 1470out_overflow:
1475 dprintk("RPC: %5u %s: server reply was truncated.\n", task->tk_pid, 1471 dprintk("RPC: %5u %s: server reply was truncated.\n", task->tk_pid,
1476 __FUNCTION__); 1472 __func__);
1477 goto out_garbage; 1473 goto out_garbage;
1478} 1474}
1479 1475
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 1b395a41a8b2..5a9b0e7828cd 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -479,13 +479,13 @@ rpc_lookup_parent(char *path, struct nameidata *nd)
479 mnt = rpc_get_mount(); 479 mnt = rpc_get_mount();
480 if (IS_ERR(mnt)) { 480 if (IS_ERR(mnt)) {
481 printk(KERN_WARNING "%s: %s failed to mount " 481 printk(KERN_WARNING "%s: %s failed to mount "
482 "pseudofilesystem \n", __FILE__, __FUNCTION__); 482 "pseudofilesystem \n", __FILE__, __func__);
483 return PTR_ERR(mnt); 483 return PTR_ERR(mnt);
484 } 484 }
485 485
486 if (vfs_path_lookup(mnt->mnt_root, mnt, path, LOOKUP_PARENT, nd)) { 486 if (vfs_path_lookup(mnt->mnt_root, mnt, path, LOOKUP_PARENT, nd)) {
487 printk(KERN_WARNING "%s: %s failed to find path %s\n", 487 printk(KERN_WARNING "%s: %s failed to find path %s\n",
488 __FILE__, __FUNCTION__, path); 488 __FILE__, __func__, path);
489 rpc_put_mount(); 489 rpc_put_mount();
490 return -ENOENT; 490 return -ENOENT;
491 } 491 }
@@ -604,7 +604,7 @@ rpc_populate(struct dentry *parent,
604out_bad: 604out_bad:
605 mutex_unlock(&dir->i_mutex); 605 mutex_unlock(&dir->i_mutex);
606 printk(KERN_WARNING "%s: %s failed to populate directory %s\n", 606 printk(KERN_WARNING "%s: %s failed to populate directory %s\n",
607 __FILE__, __FUNCTION__, parent->d_name.name); 607 __FILE__, __func__, parent->d_name.name);
608 return -ENOMEM; 608 return -ENOMEM;
609} 609}
610 610
@@ -623,7 +623,7 @@ __rpc_mkdir(struct inode *dir, struct dentry *dentry)
623 return 0; 623 return 0;
624out_err: 624out_err:
625 printk(KERN_WARNING "%s: %s failed to allocate inode for dentry %s\n", 625 printk(KERN_WARNING "%s: %s failed to allocate inode for dentry %s\n",
626 __FILE__, __FUNCTION__, dentry->d_name.name); 626 __FILE__, __func__, dentry->d_name.name);
627 return -ENOMEM; 627 return -ENOMEM;
628} 628}
629 629
@@ -715,7 +715,7 @@ err_depopulate:
715err_dput: 715err_dput:
716 dput(dentry); 716 dput(dentry);
717 printk(KERN_WARNING "%s: %s() failed to create directory %s (errno = %d)\n", 717 printk(KERN_WARNING "%s: %s() failed to create directory %s (errno = %d)\n",
718 __FILE__, __FUNCTION__, path, error); 718 __FILE__, __func__, path, error);
719 dentry = ERR_PTR(error); 719 dentry = ERR_PTR(error);
720 goto out; 720 goto out;
721} 721}
@@ -804,7 +804,7 @@ err_dput:
804 dput(dentry); 804 dput(dentry);
805 dentry = ERR_PTR(-ENOMEM); 805 dentry = ERR_PTR(-ENOMEM);
806 printk(KERN_WARNING "%s: %s() failed to create pipe %s/%s (errno = %d)\n", 806 printk(KERN_WARNING "%s: %s() failed to create pipe %s/%s (errno = %d)\n",
807 __FILE__, __FUNCTION__, parent->d_name.name, name, 807 __FILE__, __func__, parent->d_name.name, name,
808 -ENOMEM); 808 -ENOMEM);
809 goto out; 809 goto out;
810} 810}
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
index f480c718b400..0517967a68bf 100644
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -224,7 +224,7 @@ int rpcb_getport_sync(struct sockaddr_in *sin, u32 prog, u32 vers, int prot)
224 int status; 224 int status;
225 225
226 dprintk("RPC: %s(" NIPQUAD_FMT ", %u, %u, %d)\n", 226 dprintk("RPC: %s(" NIPQUAD_FMT ", %u, %u, %d)\n",
227 __FUNCTION__, NIPQUAD(sin->sin_addr.s_addr), prog, vers, prot); 227 __func__, NIPQUAD(sin->sin_addr.s_addr), prog, vers, prot);
228 228
229 rpcb_clnt = rpcb_create(NULL, (struct sockaddr *)sin, 229 rpcb_clnt = rpcb_create(NULL, (struct sockaddr *)sin,
230 sizeof(*sin), prot, 2, 0); 230 sizeof(*sin), prot, 2, 0);
@@ -283,7 +283,7 @@ void rpcb_getport_async(struct rpc_task *task)
283 struct rpcb_info *info; 283 struct rpcb_info *info;
284 284
285 dprintk("RPC: %5u %s(%s, %u, %u, %d)\n", 285 dprintk("RPC: %5u %s(%s, %u, %u, %d)\n",
286 task->tk_pid, __FUNCTION__, 286 task->tk_pid, __func__,
287 clnt->cl_server, clnt->cl_prog, clnt->cl_vers, xprt->prot); 287 clnt->cl_server, clnt->cl_prog, clnt->cl_vers, xprt->prot);
288 288
289 /* Autobind on cloned rpc clients is discouraged */ 289 /* Autobind on cloned rpc clients is discouraged */
@@ -292,7 +292,7 @@ void rpcb_getport_async(struct rpc_task *task)
292 if (xprt_test_and_set_binding(xprt)) { 292 if (xprt_test_and_set_binding(xprt)) {
293 status = -EAGAIN; /* tell caller to check again */ 293 status = -EAGAIN; /* tell caller to check again */
294 dprintk("RPC: %5u %s: waiting for another binder\n", 294 dprintk("RPC: %5u %s: waiting for another binder\n",
295 task->tk_pid, __FUNCTION__); 295 task->tk_pid, __func__);
296 goto bailout_nowake; 296 goto bailout_nowake;
297 } 297 }
298 298
@@ -304,7 +304,7 @@ void rpcb_getport_async(struct rpc_task *task)
304 if (xprt_bound(xprt)) { 304 if (xprt_bound(xprt)) {
305 status = 0; 305 status = 0;
306 dprintk("RPC: %5u %s: already bound\n", 306 dprintk("RPC: %5u %s: already bound\n",
307 task->tk_pid, __FUNCTION__); 307 task->tk_pid, __func__);
308 goto bailout_nofree; 308 goto bailout_nofree;
309 } 309 }
310 310
@@ -321,27 +321,27 @@ void rpcb_getport_async(struct rpc_task *task)
321 default: 321 default:
322 status = -EAFNOSUPPORT; 322 status = -EAFNOSUPPORT;
323 dprintk("RPC: %5u %s: bad address family\n", 323 dprintk("RPC: %5u %s: bad address family\n",
324 task->tk_pid, __FUNCTION__); 324 task->tk_pid, __func__);
325 goto bailout_nofree; 325 goto bailout_nofree;
326 } 326 }
327 if (info[xprt->bind_index].rpc_proc == NULL) { 327 if (info[xprt->bind_index].rpc_proc == NULL) {
328 xprt->bind_index = 0; 328 xprt->bind_index = 0;
329 status = -EPFNOSUPPORT; 329 status = -EPFNOSUPPORT;
330 dprintk("RPC: %5u %s: no more getport versions available\n", 330 dprintk("RPC: %5u %s: no more getport versions available\n",
331 task->tk_pid, __FUNCTION__); 331 task->tk_pid, __func__);
332 goto bailout_nofree; 332 goto bailout_nofree;
333 } 333 }
334 bind_version = info[xprt->bind_index].rpc_vers; 334 bind_version = info[xprt->bind_index].rpc_vers;
335 335
336 dprintk("RPC: %5u %s: trying rpcbind version %u\n", 336 dprintk("RPC: %5u %s: trying rpcbind version %u\n",
337 task->tk_pid, __FUNCTION__, bind_version); 337 task->tk_pid, __func__, bind_version);
338 338
339 rpcb_clnt = rpcb_create(clnt->cl_server, sap, salen, xprt->prot, 339 rpcb_clnt = rpcb_create(clnt->cl_server, sap, salen, xprt->prot,
340 bind_version, 0); 340 bind_version, 0);
341 if (IS_ERR(rpcb_clnt)) { 341 if (IS_ERR(rpcb_clnt)) {
342 status = PTR_ERR(rpcb_clnt); 342 status = PTR_ERR(rpcb_clnt);
343 dprintk("RPC: %5u %s: rpcb_create failed, error %ld\n", 343 dprintk("RPC: %5u %s: rpcb_create failed, error %ld\n",
344 task->tk_pid, __FUNCTION__, PTR_ERR(rpcb_clnt)); 344 task->tk_pid, __func__, PTR_ERR(rpcb_clnt));
345 goto bailout_nofree; 345 goto bailout_nofree;
346 } 346 }
347 347
@@ -349,7 +349,7 @@ void rpcb_getport_async(struct rpc_task *task)
349 if (!map) { 349 if (!map) {
350 status = -ENOMEM; 350 status = -ENOMEM;
351 dprintk("RPC: %5u %s: no memory available\n", 351 dprintk("RPC: %5u %s: no memory available\n",
352 task->tk_pid, __FUNCTION__); 352 task->tk_pid, __func__);
353 goto bailout_nofree; 353 goto bailout_nofree;
354 } 354 }
355 map->r_prog = clnt->cl_prog; 355 map->r_prog = clnt->cl_prog;
@@ -366,7 +366,7 @@ void rpcb_getport_async(struct rpc_task *task)
366 if (IS_ERR(child)) { 366 if (IS_ERR(child)) {
367 status = -EIO; 367 status = -EIO;
368 dprintk("RPC: %5u %s: rpc_run_task failed\n", 368 dprintk("RPC: %5u %s: rpc_run_task failed\n",
369 task->tk_pid, __FUNCTION__); 369 task->tk_pid, __func__);
370 goto bailout; 370 goto bailout;
371 } 371 }
372 rpc_put_task(child); 372 rpc_put_task(child);
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index a290e1523297..090af78d68b5 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -301,7 +301,6 @@ static inline int
301svc_pool_map_set_cpumask(unsigned int pidx, cpumask_t *oldmask) 301svc_pool_map_set_cpumask(unsigned int pidx, cpumask_t *oldmask)
302{ 302{
303 struct svc_pool_map *m = &svc_pool_map; 303 struct svc_pool_map *m = &svc_pool_map;
304 unsigned int node; /* or cpu */
305 304
306 /* 305 /*
307 * The caller checks for sv_nrpools > 1, which 306 * The caller checks for sv_nrpools > 1, which
@@ -314,16 +313,23 @@ svc_pool_map_set_cpumask(unsigned int pidx, cpumask_t *oldmask)
314 default: 313 default:
315 return 0; 314 return 0;
316 case SVC_POOL_PERCPU: 315 case SVC_POOL_PERCPU:
317 node = m->pool_to[pidx]; 316 {
317 unsigned int cpu = m->pool_to[pidx];
318
318 *oldmask = current->cpus_allowed; 319 *oldmask = current->cpus_allowed;
319 set_cpus_allowed(current, cpumask_of_cpu(node)); 320 set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
320 return 1; 321 return 1;
322 }
321 case SVC_POOL_PERNODE: 323 case SVC_POOL_PERNODE:
322 node = m->pool_to[pidx]; 324 {
325 unsigned int node = m->pool_to[pidx];
326 node_to_cpumask_ptr(nodecpumask, node);
327
323 *oldmask = current->cpus_allowed; 328 *oldmask = current->cpus_allowed;
324 set_cpus_allowed(current, node_to_cpumask(node)); 329 set_cpus_allowed_ptr(current, nodecpumask);
325 return 1; 330 return 1;
326 } 331 }
332 }
327} 333}
328 334
329/* 335/*
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index ea377e06afae..332eb47539e1 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -185,7 +185,7 @@ int svc_create_xprt(struct svc_serv *serv, char *xprt_name, unsigned short port,
185 struct svc_xprt_class *xcl; 185 struct svc_xprt_class *xcl;
186 struct sockaddr_in sin = { 186 struct sockaddr_in sin = {
187 .sin_family = AF_INET, 187 .sin_family = AF_INET,
188 .sin_addr.s_addr = INADDR_ANY, 188 .sin_addr.s_addr = htonl(INADDR_ANY),
189 .sin_port = htons(port), 189 .sin_port = htons(port),
190 }; 190 };
191 dprintk("svc: creating transport %s[%d]\n", xprt_name, port); 191 dprintk("svc: creating transport %s[%d]\n", xprt_name, port);
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
index 995c3fdc16c2..79a55d56cc98 100644
--- a/net/sunrpc/xdr.c
+++ b/net/sunrpc/xdr.c
@@ -244,7 +244,7 @@ _copy_to_pages(struct page **pages, size_t pgbase, const char *p, size_t len)
244 pgto = pages + (pgbase >> PAGE_CACHE_SHIFT); 244 pgto = pages + (pgbase >> PAGE_CACHE_SHIFT);
245 pgbase &= ~PAGE_CACHE_MASK; 245 pgbase &= ~PAGE_CACHE_MASK;
246 246
247 do { 247 for (;;) {
248 copy = PAGE_CACHE_SIZE - pgbase; 248 copy = PAGE_CACHE_SIZE - pgbase;
249 if (copy > len) 249 if (copy > len)
250 copy = len; 250 copy = len;
@@ -253,6 +253,10 @@ _copy_to_pages(struct page **pages, size_t pgbase, const char *p, size_t len)
253 memcpy(vto + pgbase, p, copy); 253 memcpy(vto + pgbase, p, copy);
254 kunmap_atomic(vto, KM_USER0); 254 kunmap_atomic(vto, KM_USER0);
255 255
256 len -= copy;
257 if (len == 0)
258 break;
259
256 pgbase += copy; 260 pgbase += copy;
257 if (pgbase == PAGE_CACHE_SIZE) { 261 if (pgbase == PAGE_CACHE_SIZE) {
258 flush_dcache_page(*pgto); 262 flush_dcache_page(*pgto);
@@ -260,8 +264,7 @@ _copy_to_pages(struct page **pages, size_t pgbase, const char *p, size_t len)
260 pgto++; 264 pgto++;
261 } 265 }
262 p += copy; 266 p += copy;
263 267 }
264 } while ((len -= copy) != 0);
265 flush_dcache_page(*pgto); 268 flush_dcache_page(*pgto);
266} 269}
267 270
diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
index ab54a736486e..c22d6b6f2db4 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
@@ -237,14 +237,12 @@ static void rdma_set_ctxt_sge(struct svc_rdma_op_ctxt *ctxt,
237 237
238static int rdma_read_max_sge(struct svcxprt_rdma *xprt, int sge_count) 238static int rdma_read_max_sge(struct svcxprt_rdma *xprt, int sge_count)
239{ 239{
240#ifdef RDMA_TRANSPORT_IWARP
241 if ((RDMA_TRANSPORT_IWARP == 240 if ((RDMA_TRANSPORT_IWARP ==
242 rdma_node_get_transport(xprt->sc_cm_id-> 241 rdma_node_get_transport(xprt->sc_cm_id->
243 device->node_type)) 242 device->node_type))
244 && sge_count > 1) 243 && sge_count > 1)
245 return 1; 244 return 1;
246 else 245 else
247#endif
248 return min_t(int, sge_count, xprt->sc_max_sge); 246 return min_t(int, sge_count, xprt->sc_max_sge);
249} 247}
250 248
@@ -324,15 +322,6 @@ next_sge:
324 ctxt->direction = DMA_FROM_DEVICE; 322 ctxt->direction = DMA_FROM_DEVICE;
325 clear_bit(RDMACTXT_F_READ_DONE, &ctxt->flags); 323 clear_bit(RDMACTXT_F_READ_DONE, &ctxt->flags);
326 clear_bit(RDMACTXT_F_LAST_CTXT, &ctxt->flags); 324 clear_bit(RDMACTXT_F_LAST_CTXT, &ctxt->flags);
327 if ((ch+1)->rc_discrim == 0) {
328 /*
329 * Checked in sq_cq_reap to see if we need to
330 * be enqueued
331 */
332 set_bit(RDMACTXT_F_LAST_CTXT, &ctxt->flags);
333 ctxt->next = hdr_ctxt;
334 hdr_ctxt->next = head;
335 }
336 325
337 /* Prepare READ WR */ 326 /* Prepare READ WR */
338 memset(&read_wr, 0, sizeof read_wr); 327 memset(&read_wr, 0, sizeof read_wr);
@@ -350,7 +339,17 @@ next_sge:
350 rdma_set_ctxt_sge(ctxt, &sge[ch_sge_ary[ch_no].start], 339 rdma_set_ctxt_sge(ctxt, &sge[ch_sge_ary[ch_no].start],
351 &sgl_offset, 340 &sgl_offset,
352 read_wr.num_sge); 341 read_wr.num_sge);
353 342 if (((ch+1)->rc_discrim == 0) &&
343 (read_wr.num_sge == ch_sge_ary[ch_no].count)) {
344 /*
345 * Mark the last RDMA_READ with a bit to
346 * indicate all RPC data has been fetched from
347 * the client and the RPC needs to be enqueued.
348 */
349 set_bit(RDMACTXT_F_LAST_CTXT, &ctxt->flags);
350 ctxt->next = hdr_ctxt;
351 hdr_ctxt->next = head;
352 }
354 /* Post the read */ 353 /* Post the read */
355 err = svc_rdma_send(xprt, &read_wr); 354 err = svc_rdma_send(xprt, &read_wr);
356 if (err) { 355 if (err) {
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index ffbf22a1d2ca..8ea283ecc522 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -1573,7 +1573,6 @@ rpcrdma_ep_post(struct rpcrdma_ia *ia,
1573 send_wr.sg_list = req->rl_send_iov; 1573 send_wr.sg_list = req->rl_send_iov;
1574 send_wr.num_sge = req->rl_niovs; 1574 send_wr.num_sge = req->rl_niovs;
1575 send_wr.opcode = IB_WR_SEND; 1575 send_wr.opcode = IB_WR_SEND;
1576 send_wr.imm_data = 0;
1577 if (send_wr.num_sge == 4) /* no need to sync any pad (constant) */ 1576 if (send_wr.num_sge == 4) /* no need to sync any pad (constant) */
1578 ib_dma_sync_single_for_device(ia->ri_id->device, 1577 ib_dma_sync_single_for_device(ia->ri_id->device,
1579 req->rl_send_iov[3].addr, req->rl_send_iov[3].length, 1578 req->rl_send_iov[3].addr, req->rl_send_iov[3].length,
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 63d79e347c00..ddbe981ab516 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1379,7 +1379,7 @@ static int xs_bind4(struct sock_xprt *transport, struct socket *sock)
1379 nloop++; 1379 nloop++;
1380 } while (err == -EADDRINUSE && nloop != 2); 1380 } while (err == -EADDRINUSE && nloop != 2);
1381 dprintk("RPC: %s "NIPQUAD_FMT":%u: %s (%d)\n", 1381 dprintk("RPC: %s "NIPQUAD_FMT":%u: %s (%d)\n",
1382 __FUNCTION__, NIPQUAD(myaddr.sin_addr), 1382 __func__, NIPQUAD(myaddr.sin_addr),
1383 port, err ? "failed" : "ok", err); 1383 port, err ? "failed" : "ok", err);
1384 return err; 1384 return err;
1385} 1385}