diff options
Diffstat (limited to 'fs/nfsd/nfs4callback.c')
-rw-r--r-- | fs/nfsd/nfs4callback.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 5856fc8adb70..d6c46a9de422 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
@@ -455,7 +455,7 @@ static int max_cb_time(void) | |||
455 | } | 455 | } |
456 | 456 | ||
457 | /* Reference counting, callback cleanup, etc., all look racy as heck. | 457 | /* Reference counting, callback cleanup, etc., all look racy as heck. |
458 | * And why is cb_set an atomic? */ | 458 | * And why is cl_cb_set an atomic? */ |
459 | 459 | ||
460 | int setup_callback_client(struct nfs4_client *clp) | 460 | int setup_callback_client(struct nfs4_client *clp) |
461 | { | 461 | { |
@@ -481,7 +481,7 @@ int setup_callback_client(struct nfs4_client *clp) | |||
481 | if (!clp->cl_principal && (clp->cl_flavor >= RPC_AUTH_GSS_KRB5)) | 481 | if (!clp->cl_principal && (clp->cl_flavor >= RPC_AUTH_GSS_KRB5)) |
482 | return -EINVAL; | 482 | return -EINVAL; |
483 | if (cb->cb_minorversion) { | 483 | if (cb->cb_minorversion) { |
484 | args.bc_xprt = clp->cl_cb_xprt; | 484 | args.bc_xprt = clp->cl_cb_conn.cb_xprt; |
485 | args.protocol = XPRT_TRANSPORT_BC_TCP; | 485 | args.protocol = XPRT_TRANSPORT_BC_TCP; |
486 | } | 486 | } |
487 | /* Create RPC client */ | 487 | /* Create RPC client */ |
@@ -491,7 +491,7 @@ int setup_callback_client(struct nfs4_client *clp) | |||
491 | PTR_ERR(client)); | 491 | PTR_ERR(client)); |
492 | return PTR_ERR(client); | 492 | return PTR_ERR(client); |
493 | } | 493 | } |
494 | cb->cb_client = client; | 494 | clp->cl_cb_client = client; |
495 | return 0; | 495 | return 0; |
496 | 496 | ||
497 | } | 497 | } |
@@ -509,7 +509,7 @@ static void nfsd4_cb_probe_done(struct rpc_task *task, void *calldata) | |||
509 | if (task->tk_status) | 509 | if (task->tk_status) |
510 | warn_no_callback_path(clp, task->tk_status); | 510 | warn_no_callback_path(clp, task->tk_status); |
511 | else | 511 | else |
512 | atomic_set(&clp->cl_cb_conn.cb_set, 1); | 512 | atomic_set(&clp->cl_cb_set, 1); |
513 | } | 513 | } |
514 | 514 | ||
515 | static const struct rpc_call_ops nfsd4_cb_probe_ops = { | 515 | static const struct rpc_call_ops nfsd4_cb_probe_ops = { |
@@ -531,7 +531,6 @@ int set_callback_cred(void) | |||
531 | 531 | ||
532 | void do_probe_callback(struct nfs4_client *clp) | 532 | void do_probe_callback(struct nfs4_client *clp) |
533 | { | 533 | { |
534 | struct nfs4_cb_conn *cb = &clp->cl_cb_conn; | ||
535 | struct rpc_message msg = { | 534 | struct rpc_message msg = { |
536 | .rpc_proc = &nfs4_cb_procedures[NFSPROC4_CLNT_CB_NULL], | 535 | .rpc_proc = &nfs4_cb_procedures[NFSPROC4_CLNT_CB_NULL], |
537 | .rpc_argp = clp, | 536 | .rpc_argp = clp, |
@@ -539,7 +538,7 @@ void do_probe_callback(struct nfs4_client *clp) | |||
539 | }; | 538 | }; |
540 | int status; | 539 | int status; |
541 | 540 | ||
542 | status = rpc_call_async(cb->cb_client, &msg, | 541 | status = rpc_call_async(clp->cl_cb_client, &msg, |
543 | RPC_TASK_SOFT | RPC_TASK_SOFTCONN, | 542 | RPC_TASK_SOFT | RPC_TASK_SOFTCONN, |
544 | &nfsd4_cb_probe_ops, (void *)clp); | 543 | &nfsd4_cb_probe_ops, (void *)clp); |
545 | if (status) | 544 | if (status) |
@@ -554,7 +553,7 @@ nfsd4_probe_callback(struct nfs4_client *clp) | |||
554 | { | 553 | { |
555 | int status; | 554 | int status; |
556 | 555 | ||
557 | BUG_ON(atomic_read(&clp->cl_cb_conn.cb_set)); | 556 | BUG_ON(atomic_read(&clp->cl_cb_set)); |
558 | 557 | ||
559 | status = setup_callback_client(clp); | 558 | status = setup_callback_client(clp); |
560 | if (status) { | 559 | if (status) { |
@@ -656,7 +655,7 @@ static void nfsd4_cb_recall_done(struct rpc_task *task, void *calldata) | |||
656 | switch (task->tk_status) { | 655 | switch (task->tk_status) { |
657 | case -EIO: | 656 | case -EIO: |
658 | /* Network partition? */ | 657 | /* Network partition? */ |
659 | atomic_set(&clp->cl_cb_conn.cb_set, 0); | 658 | atomic_set(&clp->cl_cb_set, 0); |
660 | warn_no_callback_path(clp, task->tk_status); | 659 | warn_no_callback_path(clp, task->tk_status); |
661 | case -EBADHANDLE: | 660 | case -EBADHANDLE: |
662 | case -NFS4ERR_BAD_STATEID: | 661 | case -NFS4ERR_BAD_STATEID: |
@@ -673,7 +672,7 @@ static void nfsd4_cb_recall_done(struct rpc_task *task, void *calldata) | |||
673 | rpc_restart_call(task); | 672 | rpc_restart_call(task); |
674 | return; | 673 | return; |
675 | } else { | 674 | } else { |
676 | atomic_set(&clp->cl_cb_conn.cb_set, 0); | 675 | atomic_set(&clp->cl_cb_set, 0); |
677 | warn_no_callback_path(clp, task->tk_status); | 676 | warn_no_callback_path(clp, task->tk_status); |
678 | } | 677 | } |
679 | } | 678 | } |
@@ -709,11 +708,11 @@ void nfsd4_destroy_callback_queue(void) | |||
709 | void nfsd4_set_callback_client(struct nfs4_client *clp, struct rpc_clnt | 708 | void nfsd4_set_callback_client(struct nfs4_client *clp, struct rpc_clnt |
710 | *new) | 709 | *new) |
711 | { | 710 | { |
712 | struct rpc_clnt *old = clp->cl_cb_conn.cb_client; | 711 | struct rpc_clnt *old = clp->cl_cb_client; |
713 | 712 | ||
714 | clp->cl_cb_conn.cb_client = new; | 713 | clp->cl_cb_client = new; |
715 | /* | 714 | /* |
716 | * After this, any work that saw the old value of cb_client will | 715 | * After this, any work that saw the old value of cl_cb_client will |
717 | * be gone: | 716 | * be gone: |
718 | */ | 717 | */ |
719 | flush_workqueue(callback_wq); | 718 | flush_workqueue(callback_wq); |
@@ -728,7 +727,7 @@ void nfsd4_set_callback_client(struct nfs4_client *clp, struct rpc_clnt | |||
728 | static void _nfsd4_cb_recall(struct nfs4_delegation *dp) | 727 | static void _nfsd4_cb_recall(struct nfs4_delegation *dp) |
729 | { | 728 | { |
730 | struct nfs4_client *clp = dp->dl_client; | 729 | struct nfs4_client *clp = dp->dl_client; |
731 | struct rpc_clnt *clnt = clp->cl_cb_conn.cb_client; | 730 | struct rpc_clnt *clnt = clp->cl_cb_client; |
732 | struct nfs4_rpc_args *args = &dp->dl_recall.cb_args; | 731 | struct nfs4_rpc_args *args = &dp->dl_recall.cb_args; |
733 | struct rpc_message msg = { | 732 | struct rpc_message msg = { |
734 | .rpc_proc = &nfs4_cb_procedures[NFSPROC4_CLNT_CB_RECALL], | 733 | .rpc_proc = &nfs4_cb_procedures[NFSPROC4_CLNT_CB_RECALL], |