aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2010-10-19 17:56:52 -0400
committerJ. Bruce Fields <bfields@redhat.com>2010-10-21 10:11:55 -0400
commit5a3c9d71343cf27b7afef24ed312368d48dada09 (patch)
treef547acfdd49706cfa484dce5dc16339617e6346b /fs/nfsd
parent8b5ce5cd44743af84507721fa2cb4125ae67955c (diff)
nfsd4: separate callback change and callback probe
Only one of the nfsd4_callback_probe callers actually cares about changing the callback information. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4callback.c15
-rw-r--r--fs/nfsd/nfs4state.c7
-rw-r--r--fs/nfsd/state.h3
3 files changed, 16 insertions, 9 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 140bb3656a24..d38ee3c55a08 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -550,7 +550,7 @@ int set_callback_cred(void)
550 550
551static struct workqueue_struct *callback_wq; 551static struct workqueue_struct *callback_wq;
552 552
553void do_probe_callback(struct nfs4_client *clp) 553static void do_probe_callback(struct nfs4_client *clp)
554{ 554{
555 struct nfsd4_callback *cb = &clp->cl_cb_null; 555 struct nfsd4_callback *cb = &clp->cl_cb_null;
556 556
@@ -568,17 +568,22 @@ void do_probe_callback(struct nfs4_client *clp)
568} 568}
569 569
570/* 570/*
571 * Set up the callback client and put a NFSPROC4_CB_NULL on the wire... 571 * Poke the callback thread to process any updates to the callback
572 * parameters, and send a null probe.
572 */ 573 */
573void nfsd4_probe_callback(struct nfs4_client *clp, struct nfs4_cb_conn *conn) 574void nfsd4_probe_callback(struct nfs4_client *clp)
575{
576 set_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_cb_flags);
577 do_probe_callback(clp);
578}
579
580void nfsd4_change_callback(struct nfs4_client *clp, struct nfs4_cb_conn *conn)
574{ 581{
575 BUG_ON(atomic_read(&clp->cl_cb_set)); 582 BUG_ON(atomic_read(&clp->cl_cb_set));
576 583
577 spin_lock(&clp->cl_lock); 584 spin_lock(&clp->cl_lock);
578 memcpy(&clp->cl_cb_conn, conn, sizeof(struct nfs4_cb_conn)); 585 memcpy(&clp->cl_cb_conn, conn, sizeof(struct nfs4_cb_conn));
579 set_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_cb_flags);
580 spin_unlock(&clp->cl_lock); 586 spin_unlock(&clp->cl_lock);
581 do_probe_callback(clp);
582} 587}
583 588
584/* 589/*
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 59bc0011516b..2327a8c00862 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -783,7 +783,7 @@ static struct nfsd4_session *alloc_init_session(struct svc_rqst *rqstp, struct n
783 rpc_copy_addr((struct sockaddr *)&clp->cl_cb_conn.cb_addr, sa); 783 rpc_copy_addr((struct sockaddr *)&clp->cl_cb_conn.cb_addr, sa);
784 clp->cl_cb_conn.cb_addrlen = svc_addr_len(sa); 784 clp->cl_cb_conn.cb_addrlen = svc_addr_len(sa);
785 clp->cl_cb_conn.cb_minorversion = 1; 785 clp->cl_cb_conn.cb_minorversion = 1;
786 nfsd4_probe_callback(clp, &clp->cl_cb_conn); 786 nfsd4_probe_callback(clp);
787 } 787 }
788 return new; 788 return new;
789} 789}
@@ -1912,7 +1912,8 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
1912 status = nfserr_clid_inuse; 1912 status = nfserr_clid_inuse;
1913 else { 1913 else {
1914 atomic_set(&conf->cl_cb_set, 0); 1914 atomic_set(&conf->cl_cb_set, 0);
1915 nfsd4_probe_callback(conf, &unconf->cl_cb_conn); 1915 nfsd4_change_callback(conf, &unconf->cl_cb_conn);
1916 nfsd4_probe_callback(conf);
1916 expire_client(unconf); 1917 expire_client(unconf);
1917 status = nfs_ok; 1918 status = nfs_ok;
1918 1919
@@ -1946,7 +1947,7 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
1946 } 1947 }
1947 move_to_confirmed(unconf); 1948 move_to_confirmed(unconf);
1948 conf = unconf; 1949 conf = unconf;
1949 nfsd4_probe_callback(conf, &conf->cl_cb_conn); 1950 nfsd4_probe_callback(conf);
1950 status = nfs_ok; 1951 status = nfs_ok;
1951 } 1952 }
1952 } else if ((!conf || (conf && !same_verf(&conf->cl_confirm, &confirm))) 1953 } else if ((!conf || (conf && !same_verf(&conf->cl_confirm, &confirm)))
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index b3bed366aba4..bbc4d587b341 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -453,7 +453,8 @@ extern int nfs4_in_grace(void);
453extern __be32 nfs4_check_open_reclaim(clientid_t *clid); 453extern __be32 nfs4_check_open_reclaim(clientid_t *clid);
454extern void nfs4_free_stateowner(struct kref *kref); 454extern void nfs4_free_stateowner(struct kref *kref);
455extern int set_callback_cred(void); 455extern int set_callback_cred(void);
456extern void nfsd4_probe_callback(struct nfs4_client *clp, struct nfs4_cb_conn *); 456extern void nfsd4_probe_callback(struct nfs4_client *clp);
457extern void nfsd4_change_callback(struct nfs4_client *clp, struct nfs4_cb_conn *);
457extern void nfsd4_do_callback_rpc(struct work_struct *); 458extern void nfsd4_do_callback_rpc(struct work_struct *);
458extern void nfsd4_cb_recall(struct nfs4_delegation *dp); 459extern void nfsd4_cb_recall(struct nfs4_delegation *dp);
459extern int nfsd4_create_callback_queue(void); 460extern int nfsd4_create_callback_queue(void);