From: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
To: trond.myklebust@netapp.com
Cc: bhalevy@panasas.com, pnfs@linux-nfs.org,
linux-nfs@vger.kernel.org,
Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
Subject: [PATCH 1/3] nfs41: SQUASHME: Update to removal of ugly #ifdefs
Date: Tue, 16 Jun 2009 11:26:38 -0700 [thread overview]
Message-ID: <1245176800-10595-1-git-send-email-Ricardo.Labiaga@netapp.com> (raw)
In-Reply-To: <>
Moves the non-v4.1 version handling into common code.
[squash with: nfs41: Implement NFSv4.1 callback service process]
Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
---
fs/nfs/callback.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index 116424e..f874640 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -210,17 +210,15 @@ out:
return rqstp;
}
-static inline void nfs_callback_svc_setup(u32 minorversion,
+static inline int nfs_minorversion_callback_svc_setup(u32 minorversion,
struct svc_serv *serv, struct rpc_xprt *xprt,
struct svc_rqst **rqstpp, int (**callback_svc)(void *vrqstp))
{
if (minorversion) {
*rqstpp = nfs41_callback_up(serv, xprt);
*callback_svc = nfs41_callback_svc;
- } else {
- *rqstpp = nfs4_callback_up(serv);
- *callback_svc = nfs4_callback_svc;
}
+ return minorversion;
}
static inline void nfs_callback_bc_serv(u32 minorversion, struct rpc_xprt *xprt,
@@ -230,12 +228,11 @@ static inline void nfs_callback_bc_serv(u32 minorversion, struct rpc_xprt *xprt,
xprt->bc_serv = cb_info->serv;
}
#else
-static inline void nfs_callback_svc_setup(u32 minorversion,
+static inline int nfs_minorversion_callback_svc_setup(u32 minorversion,
struct svc_serv *serv, struct rpc_xprt *xprt,
struct svc_rqst **rqstpp, int (**callback_svc)(void *vrqstp))
{
- *rqstpp = nfs4_callback_up(serv);
- *callback_svc = nfs4_callback_svc;
+ return 0;
}
static inline void nfs_callback_bc_serv(u32 minorversion, struct rpc_xprt *xprt,
@@ -255,6 +252,7 @@ int nfs_callback_up(u32 minorversion, struct rpc_xprt *xprt)
struct nfs_callback_data *cb_info = &nfs_callback_info[minorversion];
char svc_name[12];
int ret = 0;
+ int minorversion_setup;
mutex_lock(&nfs_callback_mutex);
if (cb_info->users++ || cb_info->task != NULL) {
@@ -269,7 +267,13 @@ int nfs_callback_up(u32 minorversion, struct rpc_xprt *xprt)
/* FIXME: either 4.0 or 4.1 callback service can be up at a time
* need to monitor and control them both */
- nfs_callback_svc_setup(minorversion, serv, xprt, &rqstp, &callback_svc);
+ minorversion_setup = nfs_minorversion_callback_svc_setup(minorversion,
+ serv, xprt, &rqstp, &callback_svc);
+ if (!minorversion_setup) {
+ /* v4.0 callback setup */
+ rqstp = nfs4_callback_up(serv);
+ callback_svc = nfs4_callback_svc;
+ }
if (IS_ERR(rqstp)) {
ret = PTR_ERR(rqstp);
--
1.5.4.3
next reply other threads:[~2009-06-16 18:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-16 18:26 Ricardo Labiaga [this message]
2009-06-16 18:26 ` [PATCH 2/3] SQUASHME: nfs41: Backchannel: Remove FIXME comment Ricardo Labiaga
2009-06-16 18:26 ` [PATCH 3/3] SQUASHME: nfs41: Backchannel: Be more obvious about the return value Ricardo Labiaga
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=1245176800-10595-1-git-send-email-Ricardo.Labiaga@netapp.com \
--to=ricardo.labiaga@netapp.com \
--cc=bhalevy@panasas.com \
--cc=linux-nfs@vger.kernel.org \
--cc=pnfs@linux-nfs.org \
--cc=trond.myklebust@netapp.com \
/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.