diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2009-04-29 19:09:19 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-05-01 17:31:44 -0400 |
commit | c237dc0303bcf6f4cc2e0efe4fe4e341c6f34dac (patch) | |
tree | d314fbccd51967a80f31f62e2467f0936fd096c0 /fs | |
parent | e300a63ce4ccec073d254d883a3638d5dca1d771 (diff) |
nfsd4: rename callback struct to cb_conn
I want to use the name for a struct that actually does represent a
single callback.
(Actually, I've never been sure it helps to a separate struct for the
callback information. Some day maybe those fields could just be dumped
into struct nfs4_client. I don't know.)
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/nfs4callback.c | 16 | ||||
-rw-r--r-- | fs/nfsd/nfs4state.c | 22 |
2 files changed, 19 insertions, 19 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 0aaf68beedbd..ed860d7ddd19 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
@@ -369,7 +369,7 @@ static int max_cb_time(void) | |||
369 | int setup_callback_client(struct nfs4_client *clp) | 369 | int setup_callback_client(struct nfs4_client *clp) |
370 | { | 370 | { |
371 | struct sockaddr_in addr; | 371 | struct sockaddr_in addr; |
372 | struct nfs4_callback *cb = &clp->cl_callback; | 372 | struct nfs4_cb_conn *cb = &clp->cl_cb_conn; |
373 | struct rpc_timeout timeparms = { | 373 | struct rpc_timeout timeparms = { |
374 | .to_initval = max_cb_time(), | 374 | .to_initval = max_cb_time(), |
375 | .to_retries = 0, | 375 | .to_retries = 0, |
@@ -422,7 +422,7 @@ static void nfsd4_cb_probe_done(struct rpc_task *task, void *calldata) | |||
422 | if (task->tk_status) | 422 | if (task->tk_status) |
423 | warn_no_callback_path(clp, task->tk_status); | 423 | warn_no_callback_path(clp, task->tk_status); |
424 | else | 424 | else |
425 | atomic_set(&clp->cl_callback.cb_set, 1); | 425 | atomic_set(&clp->cl_cb_conn.cb_set, 1); |
426 | put_nfs4_client(clp); | 426 | put_nfs4_client(clp); |
427 | } | 427 | } |
428 | 428 | ||
@@ -430,7 +430,7 @@ static const struct rpc_call_ops nfsd4_cb_probe_ops = { | |||
430 | .rpc_call_done = nfsd4_cb_probe_done, | 430 | .rpc_call_done = nfsd4_cb_probe_done, |
431 | }; | 431 | }; |
432 | 432 | ||
433 | static struct rpc_cred *lookup_cb_cred(struct nfs4_callback *cb) | 433 | static struct rpc_cred *lookup_cb_cred(struct nfs4_cb_conn *cb) |
434 | { | 434 | { |
435 | struct auth_cred acred = { | 435 | struct auth_cred acred = { |
436 | .machine_cred = 1 | 436 | .machine_cred = 1 |
@@ -448,7 +448,7 @@ static struct rpc_cred *lookup_cb_cred(struct nfs4_callback *cb) | |||
448 | 448 | ||
449 | void do_probe_callback(struct nfs4_client *clp) | 449 | void do_probe_callback(struct nfs4_client *clp) |
450 | { | 450 | { |
451 | struct nfs4_callback *cb = &clp->cl_callback; | 451 | struct nfs4_cb_conn *cb = &clp->cl_cb_conn; |
452 | struct rpc_message msg = { | 452 | struct rpc_message msg = { |
453 | .rpc_proc = &nfs4_cb_procedures[NFSPROC4_CLNT_CB_NULL], | 453 | .rpc_proc = &nfs4_cb_procedures[NFSPROC4_CLNT_CB_NULL], |
454 | .rpc_argp = clp, | 454 | .rpc_argp = clp, |
@@ -480,7 +480,7 @@ nfsd4_probe_callback(struct nfs4_client *clp) | |||
480 | { | 480 | { |
481 | int status; | 481 | int status; |
482 | 482 | ||
483 | BUG_ON(atomic_read(&clp->cl_callback.cb_set)); | 483 | BUG_ON(atomic_read(&clp->cl_cb_conn.cb_set)); |
484 | 484 | ||
485 | status = setup_callback_client(clp); | 485 | status = setup_callback_client(clp); |
486 | if (status) { | 486 | if (status) { |
@@ -501,12 +501,12 @@ void | |||
501 | nfsd4_cb_recall(struct nfs4_delegation *dp) | 501 | nfsd4_cb_recall(struct nfs4_delegation *dp) |
502 | { | 502 | { |
503 | struct nfs4_client *clp = dp->dl_client; | 503 | struct nfs4_client *clp = dp->dl_client; |
504 | struct rpc_clnt *clnt = clp->cl_callback.cb_client; | 504 | struct rpc_clnt *clnt = clp->cl_cb_conn.cb_client; |
505 | struct nfs4_cb_recall *cbr = &dp->dl_recall; | 505 | struct nfs4_cb_recall *cbr = &dp->dl_recall; |
506 | struct rpc_message msg = { | 506 | struct rpc_message msg = { |
507 | .rpc_proc = &nfs4_cb_procedures[NFSPROC4_CLNT_CB_RECALL], | 507 | .rpc_proc = &nfs4_cb_procedures[NFSPROC4_CLNT_CB_RECALL], |
508 | .rpc_argp = cbr, | 508 | .rpc_argp = cbr, |
509 | .rpc_cred = clp->cl_callback.cb_cred | 509 | .rpc_cred = clp->cl_cb_conn.cb_cred |
510 | }; | 510 | }; |
511 | int retries = 1; | 511 | int retries = 1; |
512 | int status = 0; | 512 | int status = 0; |
@@ -519,7 +519,7 @@ nfsd4_cb_recall(struct nfs4_delegation *dp) | |||
519 | switch (status) { | 519 | switch (status) { |
520 | case -EIO: | 520 | case -EIO: |
521 | /* Network partition? */ | 521 | /* Network partition? */ |
522 | atomic_set(&clp->cl_callback.cb_set, 0); | 522 | atomic_set(&clp->cl_cb_conn.cb_set, 0); |
523 | case -EBADHANDLE: | 523 | case -EBADHANDLE: |
524 | case -NFS4ERR_BAD_STATEID: | 524 | case -NFS4ERR_BAD_STATEID: |
525 | /* Race: client probably got cb_recall | 525 | /* Race: client probably got cb_recall |
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index b205c7d7bc6a..d7b5e6b89207 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -182,7 +182,7 @@ alloc_init_deleg(struct nfs4_client *clp, struct nfs4_stateid *stp, struct svc_f | |||
182 | { | 182 | { |
183 | struct nfs4_delegation *dp; | 183 | struct nfs4_delegation *dp; |
184 | struct nfs4_file *fp = stp->st_file; | 184 | struct nfs4_file *fp = stp->st_file; |
185 | struct nfs4_callback *cb = &stp->st_stateowner->so_client->cl_callback; | 185 | struct nfs4_cb_conn *cb = &stp->st_stateowner->so_client->cl_cb_conn; |
186 | 186 | ||
187 | dprintk("NFSD alloc_init_deleg\n"); | 187 | dprintk("NFSD alloc_init_deleg\n"); |
188 | if (fp->fi_had_conflict) | 188 | if (fp->fi_had_conflict) |
@@ -633,19 +633,19 @@ static struct nfs4_client *alloc_client(struct xdr_netobj name) | |||
633 | static void | 633 | static void |
634 | shutdown_callback_client(struct nfs4_client *clp) | 634 | shutdown_callback_client(struct nfs4_client *clp) |
635 | { | 635 | { |
636 | struct rpc_clnt *clnt = clp->cl_callback.cb_client; | 636 | struct rpc_clnt *clnt = clp->cl_cb_conn.cb_client; |
637 | 637 | ||
638 | if (clnt) { | 638 | if (clnt) { |
639 | /* | 639 | /* |
640 | * Callback threads take a reference on the client, so there | 640 | * Callback threads take a reference on the client, so there |
641 | * should be no outstanding callbacks at this point. | 641 | * should be no outstanding callbacks at this point. |
642 | */ | 642 | */ |
643 | clp->cl_callback.cb_client = NULL; | 643 | clp->cl_cb_conn.cb_client = NULL; |
644 | rpc_shutdown_client(clnt); | 644 | rpc_shutdown_client(clnt); |
645 | } | 645 | } |
646 | if (clp->cl_callback.cb_cred) { | 646 | if (clp->cl_cb_conn.cb_cred) { |
647 | put_rpccred(clp->cl_callback.cb_cred); | 647 | put_rpccred(clp->cl_cb_conn.cb_cred); |
648 | clp->cl_callback.cb_cred = NULL; | 648 | clp->cl_cb_conn.cb_cred = NULL; |
649 | } | 649 | } |
650 | } | 650 | } |
651 | 651 | ||
@@ -719,7 +719,7 @@ static struct nfs4_client *create_client(struct xdr_netobj name, char *recdir) | |||
719 | return NULL; | 719 | return NULL; |
720 | memcpy(clp->cl_recdir, recdir, HEXDIR_LEN); | 720 | memcpy(clp->cl_recdir, recdir, HEXDIR_LEN); |
721 | atomic_set(&clp->cl_count, 1); | 721 | atomic_set(&clp->cl_count, 1); |
722 | atomic_set(&clp->cl_callback.cb_set, 0); | 722 | atomic_set(&clp->cl_cb_conn.cb_set, 0); |
723 | INIT_LIST_HEAD(&clp->cl_idhash); | 723 | INIT_LIST_HEAD(&clp->cl_idhash); |
724 | INIT_LIST_HEAD(&clp->cl_strhash); | 724 | INIT_LIST_HEAD(&clp->cl_strhash); |
725 | INIT_LIST_HEAD(&clp->cl_openowners); | 725 | INIT_LIST_HEAD(&clp->cl_openowners); |
@@ -971,7 +971,7 @@ parse_ipv4(unsigned int addr_len, char *addr_val, unsigned int *cbaddrp, unsigne | |||
971 | static void | 971 | static void |
972 | gen_callback(struct nfs4_client *clp, struct nfsd4_setclientid *se) | 972 | gen_callback(struct nfs4_client *clp, struct nfsd4_setclientid *se) |
973 | { | 973 | { |
974 | struct nfs4_callback *cb = &clp->cl_callback; | 974 | struct nfs4_cb_conn *cb = &clp->cl_cb_conn; |
975 | 975 | ||
976 | /* Currently, we only support tcp for the callback channel */ | 976 | /* Currently, we only support tcp for the callback channel */ |
977 | if ((se->se_callback_netid_len != 3) || memcmp((char *)se->se_callback_netid_val, "tcp", 3)) | 977 | if ((se->se_callback_netid_len != 3) || memcmp((char *)se->se_callback_netid_val, "tcp", 3)) |
@@ -1691,7 +1691,7 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, | |||
1691 | else { | 1691 | else { |
1692 | /* XXX: We just turn off callbacks until we can handle | 1692 | /* XXX: We just turn off callbacks until we can handle |
1693 | * change request correctly. */ | 1693 | * change request correctly. */ |
1694 | atomic_set(&conf->cl_callback.cb_set, 0); | 1694 | atomic_set(&conf->cl_cb_conn.cb_set, 0); |
1695 | expire_client(unconf); | 1695 | expire_client(unconf); |
1696 | status = nfs_ok; | 1696 | status = nfs_ok; |
1697 | 1697 | ||
@@ -2425,7 +2425,7 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open, struct nfs4_sta | |||
2425 | { | 2425 | { |
2426 | struct nfs4_delegation *dp; | 2426 | struct nfs4_delegation *dp; |
2427 | struct nfs4_stateowner *sop = stp->st_stateowner; | 2427 | struct nfs4_stateowner *sop = stp->st_stateowner; |
2428 | struct nfs4_callback *cb = &sop->so_client->cl_callback; | 2428 | struct nfs4_cb_conn *cb = &sop->so_client->cl_cb_conn; |
2429 | struct file_lock fl, *flp = &fl; | 2429 | struct file_lock fl, *flp = &fl; |
2430 | int status, flag = 0; | 2430 | int status, flag = 0; |
2431 | 2431 | ||
@@ -2617,7 +2617,7 @@ nfsd4_renew(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
2617 | renew_client(clp); | 2617 | renew_client(clp); |
2618 | status = nfserr_cb_path_down; | 2618 | status = nfserr_cb_path_down; |
2619 | if (!list_empty(&clp->cl_delegations) | 2619 | if (!list_empty(&clp->cl_delegations) |
2620 | && !atomic_read(&clp->cl_callback.cb_set)) | 2620 | && !atomic_read(&clp->cl_cb_conn.cb_set)) |
2621 | goto out; | 2621 | goto out; |
2622 | status = nfs_ok; | 2622 | status = nfs_ok; |
2623 | out: | 2623 | out: |