Commit 8323c3b2 authored by J. Bruce Fields's avatar J. Bruce Fields

nfsd4: move minorversion to client

The minorversion seems more a property of the client than the callback
channel.

Some time we should probably also enforce consistent minorversion usage
from the client; for now, this is just a cosmetic change.
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 792c95dd
...@@ -496,7 +496,7 @@ int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn) ...@@ -496,7 +496,7 @@ int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn)
if (!clp->cl_principal && (clp->cl_flavor >= RPC_AUTH_GSS_KRB5)) if (!clp->cl_principal && (clp->cl_flavor >= RPC_AUTH_GSS_KRB5))
return -EINVAL; return -EINVAL;
if (conn->cb_minorversion) { if (clp->cl_minorversion) {
args.bc_xprt = conn->cb_xprt; args.bc_xprt = conn->cb_xprt;
args.prognumber = clp->cl_cb_session->se_cb_prog; args.prognumber = clp->cl_cb_session->se_cb_prog;
args.protocol = XPRT_TRANSPORT_BC_TCP; args.protocol = XPRT_TRANSPORT_BC_TCP;
...@@ -620,7 +620,7 @@ static void nfsd4_cb_prepare(struct rpc_task *task, void *calldata) ...@@ -620,7 +620,7 @@ static void nfsd4_cb_prepare(struct rpc_task *task, void *calldata)
struct nfsd4_callback *cb = calldata; struct nfsd4_callback *cb = calldata;
struct nfs4_delegation *dp = container_of(cb, struct nfs4_delegation, dl_recall); struct nfs4_delegation *dp = container_of(cb, struct nfs4_delegation, dl_recall);
struct nfs4_client *clp = dp->dl_client; struct nfs4_client *clp = dp->dl_client;
u32 minorversion = clp->cl_cb_conn.cb_minorversion; u32 minorversion = clp->cl_minorversion;
int status = 0; int status = 0;
cb->cb_minorversion = minorversion; cb->cb_minorversion = minorversion;
...@@ -645,9 +645,9 @@ static void nfsd4_cb_done(struct rpc_task *task, void *calldata) ...@@ -645,9 +645,9 @@ static void nfsd4_cb_done(struct rpc_task *task, void *calldata)
struct nfs4_client *clp = dp->dl_client; struct nfs4_client *clp = dp->dl_client;
dprintk("%s: minorversion=%d\n", __func__, dprintk("%s: minorversion=%d\n", __func__,
clp->cl_cb_conn.cb_minorversion); clp->cl_minorversion);
if (clp->cl_cb_conn.cb_minorversion) { if (clp->cl_minorversion) {
/* No need for lock, access serialized in nfsd4_cb_prepare */ /* No need for lock, access serialized in nfsd4_cb_prepare */
++clp->cl_cb_session->se_cb_seq_nr; ++clp->cl_cb_session->se_cb_seq_nr;
clear_bit(0, &clp->cl_cb_slot_busy); clear_bit(0, &clp->cl_cb_slot_busy);
......
...@@ -782,7 +782,6 @@ static struct nfsd4_session *alloc_init_session(struct svc_rqst *rqstp, struct n ...@@ -782,7 +782,6 @@ static struct nfsd4_session *alloc_init_session(struct svc_rqst *rqstp, struct n
svc_xprt_get(rqstp->rq_xprt); svc_xprt_get(rqstp->rq_xprt);
rpc_copy_addr((struct sockaddr *)&clp->cl_cb_conn.cb_addr, sa); 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_addrlen = svc_addr_len(sa);
clp->cl_cb_conn.cb_minorversion = 1;
nfsd4_probe_callback(clp); nfsd4_probe_callback(clp);
} }
return new; return new;
...@@ -1200,7 +1199,6 @@ gen_callback(struct nfs4_client *clp, struct nfsd4_setclientid *se, u32 scopeid) ...@@ -1200,7 +1199,6 @@ gen_callback(struct nfs4_client *clp, struct nfsd4_setclientid *se, u32 scopeid)
if (conn->cb_addr.ss_family == AF_INET6) if (conn->cb_addr.ss_family == AF_INET6)
((struct sockaddr_in6 *)&conn->cb_addr)->sin6_scope_id = scopeid; ((struct sockaddr_in6 *)&conn->cb_addr)->sin6_scope_id = scopeid;
conn->cb_minorversion = 0;
conn->cb_prog = se->se_callback_prog; conn->cb_prog = se->se_callback_prog;
conn->cb_ident = se->se_callback_ident; conn->cb_ident = se->se_callback_ident;
return; return;
...@@ -1540,6 +1538,11 @@ nfsd4_create_session(struct svc_rqst *rqstp, ...@@ -1540,6 +1538,11 @@ nfsd4_create_session(struct svc_rqst *rqstp,
goto out; goto out;
} }
/*
* XXX: we should probably set this at creation time, and check
* for consistent minorversion use throughout:
*/
conf->cl_minorversion = 1;
/* /*
* We do not support RDMA or persistent sessions * We do not support RDMA or persistent sessions
*/ */
...@@ -1857,6 +1860,11 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, ...@@ -1857,6 +1860,11 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
goto out; goto out;
gen_clid(new); gen_clid(new);
} }
/*
* XXX: we should probably set this at creation time, and check
* for consistent minorversion use throughout:
*/
new->cl_minorversion = 0;
gen_callback(new, setclid, rpc_get_scope_id(sa)); gen_callback(new, setclid, rpc_get_scope_id(sa));
add_to_unconfirmed(new, strhashval); add_to_unconfirmed(new, strhashval);
setclid->se_clientid.cl_boot = new->cl_clientid.cl_boot; setclid->se_clientid.cl_boot = new->cl_clientid.cl_boot;
......
...@@ -98,7 +98,6 @@ struct nfs4_cb_conn { ...@@ -98,7 +98,6 @@ struct nfs4_cb_conn {
size_t cb_addrlen; size_t cb_addrlen;
u32 cb_prog; /* used only in 4.0 case; u32 cb_prog; /* used only in 4.0 case;
per-session otherwise */ per-session otherwise */
u32 cb_minorversion;
u32 cb_ident; /* minorversion 0 only */ u32 cb_ident; /* minorversion 0 only */
struct svc_xprt *cb_xprt; /* minorversion 1 only */ struct svc_xprt *cb_xprt; /* minorversion 1 only */
}; };
...@@ -227,6 +226,7 @@ struct nfs4_client { ...@@ -227,6 +226,7 @@ struct nfs4_client {
clientid_t cl_clientid; /* generated by server */ clientid_t cl_clientid; /* generated by server */
nfs4_verifier cl_confirm; /* generated by server */ nfs4_verifier cl_confirm; /* generated by server */
u32 cl_firststate; /* recovery dir creation */ u32 cl_firststate; /* recovery dir creation */
u32 cl_minorversion;
/* for v4.0 and v4.1 callbacks: */ /* for v4.0 and v4.1 callbacks: */
struct nfs4_cb_conn cl_cb_conn; struct nfs4_cb_conn cl_cb_conn;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment