All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@redhat.com>
To: linux-nfs@vger.kernel.org
Cc: "J. Bruce Fields" <bfields@redhat.com>
Subject: [PATCH 08/11] nfsd4: separate callback change and callback probe
Date: Thu, 21 Oct 2010 12:20:15 -0400	[thread overview]
Message-ID: <1287678018-9266-9-git-send-email-bfields@redhat.com> (raw)
In-Reply-To: <1287678018-9266-1-git-send-email-bfields@redhat.com>

Only one of the nfsd4_callback_probe callers actually cares about
changing the callback information.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
 fs/nfsd/nfs4callback.c |   15 ++++++++++-----
 fs/nfsd/nfs4state.c    |    7 ++++---
 fs/nfsd/state.h        |    3 ++-
 3 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 140bb36..d38ee3c 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -550,7 +550,7 @@ int set_callback_cred(void)
 
 static struct workqueue_struct *callback_wq;
 
-void do_probe_callback(struct nfs4_client *clp)
+static void do_probe_callback(struct nfs4_client *clp)
 {
 	struct nfsd4_callback *cb = &clp->cl_cb_null;
 
@@ -568,17 +568,22 @@ void do_probe_callback(struct nfs4_client *clp)
 }
 
 /*
- * Set up the callback client and put a NFSPROC4_CB_NULL on the wire...
+ * Poke the callback thread to process any updates to the callback
+ * parameters, and send a null probe.
  */
-void nfsd4_probe_callback(struct nfs4_client *clp, struct nfs4_cb_conn *conn)
+void nfsd4_probe_callback(struct nfs4_client *clp)
+{
+	set_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_cb_flags);
+	do_probe_callback(clp);
+}
+
+void nfsd4_change_callback(struct nfs4_client *clp, struct nfs4_cb_conn *conn)
 {
 	BUG_ON(atomic_read(&clp->cl_cb_set));
 
 	spin_lock(&clp->cl_lock);
 	memcpy(&clp->cl_cb_conn, conn, sizeof(struct nfs4_cb_conn));
-	set_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_cb_flags);
 	spin_unlock(&clp->cl_lock);
-	do_probe_callback(clp);
 }
 
 /*
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 59bc001..2327a8c 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
 		rpc_copy_addr((struct sockaddr *)&clp->cl_cb_conn.cb_addr, sa);
 		clp->cl_cb_conn.cb_addrlen = svc_addr_len(sa);
 		clp->cl_cb_conn.cb_minorversion = 1;
-		nfsd4_probe_callback(clp, &clp->cl_cb_conn);
+		nfsd4_probe_callback(clp);
 	}
 	return new;
 }
@@ -1912,7 +1912,8 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
 			status = nfserr_clid_inuse;
 		else {
 			atomic_set(&conf->cl_cb_set, 0);
-			nfsd4_probe_callback(conf, &unconf->cl_cb_conn);
+			nfsd4_change_callback(conf, &unconf->cl_cb_conn);
+			nfsd4_probe_callback(conf);
 			expire_client(unconf);
 			status = nfs_ok;
 
@@ -1946,7 +1947,7 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
 			}
 			move_to_confirmed(unconf);
 			conf = unconf;
-			nfsd4_probe_callback(conf, &conf->cl_cb_conn);
+			nfsd4_probe_callback(conf);
 			status = nfs_ok;
 		}
 	} else if ((!conf || (conf && !same_verf(&conf->cl_confirm, &confirm)))
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index b3bed36..bbc4d58 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -453,7 +453,8 @@ extern int nfs4_in_grace(void);
 extern __be32 nfs4_check_open_reclaim(clientid_t *clid);
 extern void nfs4_free_stateowner(struct kref *kref);
 extern int set_callback_cred(void);
-extern void nfsd4_probe_callback(struct nfs4_client *clp, struct nfs4_cb_conn *);
+extern void nfsd4_probe_callback(struct nfs4_client *clp);
+extern void nfsd4_change_callback(struct nfs4_client *clp, struct nfs4_cb_conn *);
 extern void nfsd4_do_callback_rpc(struct work_struct *);
 extern void nfsd4_cb_recall(struct nfs4_delegation *dp);
 extern int nfsd4_create_callback_queue(void);
-- 
1.7.1


  parent reply	other threads:[~2010-10-21 16:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-21 16:20 sessions patches J. Bruce Fields
2010-10-21 16:20 ` [PATCH 01/11] nfsd4: don't cache seq_misordered replies J. Bruce Fields
2010-10-21 16:20 ` [PATCH 02/11] nfsd4: move callback setup into session init code J. Bruce Fields
2010-10-27 17:26   ` Benny Halevy
2010-10-27 17:45     ` Benny Halevy
2010-10-27 17:59       ` J. Bruce Fields
2010-10-27 18:03         ` Benny Halevy
2010-10-21 16:20 ` [PATCH 03/11] nfsd4: use client pointer to backchannel session J. Bruce Fields
2010-10-21 16:20 ` [PATCH 04/11] nfsd4: make backchannel sequence number per-session J. Bruce Fields
2010-10-21 16:20 ` [PATCH 05/11] nfsd4: confirm only on succesful create_session J. Bruce Fields
2010-10-21 16:20 ` [PATCH 06/11] nfsd4: track backchannel connections J. Bruce Fields
2010-10-21 16:20 ` [PATCH 07/11] nfsd4: callback program number is per-session J. Bruce Fields
2010-10-21 16:20 ` J. Bruce Fields [this message]
2010-10-21 16:20 ` [PATCH 09/11] nfsd4: delay session removal till free_client J. Bruce Fields
2010-10-21 16:20 ` [PATCH 10/11] nfsd4: move minorversion to client J. Bruce Fields
2010-10-21 16:20 ` [PATCH 11/11] nfsd4: only require krb5 principal for NFSv4.0 callbacks J. Bruce Fields
2010-10-25  1:06 ` sessions patches J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1287678018-9266-9-git-send-email-bfields@redhat.com \
    --to=bfields@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.