aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2010-10-19 19:36:51 -0400
committerJ. Bruce Fields <bfields@redhat.com>2010-10-21 10:12:02 -0400
commit8323c3b2a6b6543919d5ebdddc7d52f192126161 (patch)
tree35976d6ba2f1917f569e44056c43f2bf724af7ef /fs/nfsd
parent792c95dd519c54d6b0fd6401b3da7ea67b0d6b72 (diff)
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: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4callback.c8
-rw-r--r--fs/nfsd/nfs4state.c12
-rw-r--r--fs/nfsd/state.h2
3 files changed, 15 insertions, 7 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index d38ee3c55a08..67bcd2c72623 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -496,7 +496,7 @@ int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn)
496 496
497 if (!clp->cl_principal && (clp->cl_flavor >= RPC_AUTH_GSS_KRB5)) 497 if (!clp->cl_principal && (clp->cl_flavor >= RPC_AUTH_GSS_KRB5))
498 return -EINVAL; 498 return -EINVAL;
499 if (conn->cb_minorversion) { 499 if (clp->cl_minorversion) {
500 args.bc_xprt = conn->cb_xprt; 500 args.bc_xprt = conn->cb_xprt;
501 args.prognumber = clp->cl_cb_session->se_cb_prog; 501 args.prognumber = clp->cl_cb_session->se_cb_prog;
502 args.protocol = XPRT_TRANSPORT_BC_TCP; 502 args.protocol = XPRT_TRANSPORT_BC_TCP;
@@ -620,7 +620,7 @@ static void nfsd4_cb_prepare(struct rpc_task *task, void *calldata)
620 struct nfsd4_callback *cb = calldata; 620 struct nfsd4_callback *cb = calldata;
621 struct nfs4_delegation *dp = container_of(cb, struct nfs4_delegation, dl_recall); 621 struct nfs4_delegation *dp = container_of(cb, struct nfs4_delegation, dl_recall);
622 struct nfs4_client *clp = dp->dl_client; 622 struct nfs4_client *clp = dp->dl_client;
623 u32 minorversion = clp->cl_cb_conn.cb_minorversion; 623 u32 minorversion = clp->cl_minorversion;
624 int status = 0; 624 int status = 0;
625 625
626 cb->cb_minorversion = minorversion; 626 cb->cb_minorversion = minorversion;
@@ -645,9 +645,9 @@ static void nfsd4_cb_done(struct rpc_task *task, void *calldata)
645 struct nfs4_client *clp = dp->dl_client; 645 struct nfs4_client *clp = dp->dl_client;
646 646
647 dprintk("%s: minorversion=%d\n", __func__, 647 dprintk("%s: minorversion=%d\n", __func__,
648 clp->cl_cb_conn.cb_minorversion); 648 clp->cl_minorversion);
649 649
650 if (clp->cl_cb_conn.cb_minorversion) { 650 if (clp->cl_minorversion) {
651 /* No need for lock, access serialized in nfsd4_cb_prepare */ 651 /* No need for lock, access serialized in nfsd4_cb_prepare */
652 ++clp->cl_cb_session->se_cb_seq_nr; 652 ++clp->cl_cb_session->se_cb_seq_nr;
653 clear_bit(0, &clp->cl_cb_slot_busy); 653 clear_bit(0, &clp->cl_cb_slot_busy);
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 0f2643dac22a..ce0412fd23eb 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -782,7 +782,6 @@ static struct nfsd4_session *alloc_init_session(struct svc_rqst *rqstp, struct n
782 svc_xprt_get(rqstp->rq_xprt); 782 svc_xprt_get(rqstp->rq_xprt);
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;
786 nfsd4_probe_callback(clp); 785 nfsd4_probe_callback(clp);
787 } 786 }
788 return new; 787 return new;
@@ -1200,7 +1199,6 @@ gen_callback(struct nfs4_client *clp, struct nfsd4_setclientid *se, u32 scopeid)
1200 if (conn->cb_addr.ss_family == AF_INET6) 1199 if (conn->cb_addr.ss_family == AF_INET6)
1201 ((struct sockaddr_in6 *)&conn->cb_addr)->sin6_scope_id = scopeid; 1200 ((struct sockaddr_in6 *)&conn->cb_addr)->sin6_scope_id = scopeid;
1202 1201
1203 conn->cb_minorversion = 0;
1204 conn->cb_prog = se->se_callback_prog; 1202 conn->cb_prog = se->se_callback_prog;
1205 conn->cb_ident = se->se_callback_ident; 1203 conn->cb_ident = se->se_callback_ident;
1206 return; 1204 return;
@@ -1541,6 +1539,11 @@ nfsd4_create_session(struct svc_rqst *rqstp,
1541 } 1539 }
1542 1540
1543 /* 1541 /*
1542 * XXX: we should probably set this at creation time, and check
1543 * for consistent minorversion use throughout:
1544 */
1545 conf->cl_minorversion = 1;
1546 /*
1544 * We do not support RDMA or persistent sessions 1547 * We do not support RDMA or persistent sessions
1545 */ 1548 */
1546 cr_ses->flags &= ~SESSION4_PERSIST; 1549 cr_ses->flags &= ~SESSION4_PERSIST;
@@ -1857,6 +1860,11 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
1857 goto out; 1860 goto out;
1858 gen_clid(new); 1861 gen_clid(new);
1859 } 1862 }
1863 /*
1864 * XXX: we should probably set this at creation time, and check
1865 * for consistent minorversion use throughout:
1866 */
1867 new->cl_minorversion = 0;
1860 gen_callback(new, setclid, rpc_get_scope_id(sa)); 1868 gen_callback(new, setclid, rpc_get_scope_id(sa));
1861 add_to_unconfirmed(new, strhashval); 1869 add_to_unconfirmed(new, strhashval);
1862 setclid->se_clientid.cl_boot = new->cl_clientid.cl_boot; 1870 setclid->se_clientid.cl_boot = new->cl_clientid.cl_boot;
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index bbc4d587b341..39adc27b0685 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -98,7 +98,6 @@ struct nfs4_cb_conn {
98 size_t cb_addrlen; 98 size_t cb_addrlen;
99 u32 cb_prog; /* used only in 4.0 case; 99 u32 cb_prog; /* used only in 4.0 case;
100 per-session otherwise */ 100 per-session otherwise */
101 u32 cb_minorversion;
102 u32 cb_ident; /* minorversion 0 only */ 101 u32 cb_ident; /* minorversion 0 only */
103 struct svc_xprt *cb_xprt; /* minorversion 1 only */ 102 struct svc_xprt *cb_xprt; /* minorversion 1 only */
104}; 103};
@@ -227,6 +226,7 @@ struct nfs4_client {
227 clientid_t cl_clientid; /* generated by server */ 226 clientid_t cl_clientid; /* generated by server */
228 nfs4_verifier cl_confirm; /* generated by server */ 227 nfs4_verifier cl_confirm; /* generated by server */
229 u32 cl_firststate; /* recovery dir creation */ 228 u32 cl_firststate; /* recovery dir creation */
229 u32 cl_minorversion;
230 230
231 /* for v4.0 and v4.1 callbacks: */ 231 /* for v4.0 and v4.1 callbacks: */
232 struct nfs4_cb_conn cl_cb_conn; 232 struct nfs4_cb_conn cl_cb_conn;