diff options
author | J. Bruce Fields <bfields@redhat.com> | 2010-10-19 17:31:50 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2010-10-21 10:11:54 -0400 |
commit | 8b5ce5cd44743af84507721fa2cb4125ae67955c (patch) | |
tree | 24a1fa7191204140283803c17780dc4bb4066bba /fs/nfsd | |
parent | d29c374cd20de620898d2936396048518809ae24 (diff) |
nfsd4: callback program number is per-session
The callback program is allowed to depend on the session which the
callback is going over.
No change in behavior yet, while we still only do callbacks over a
single session for the lifetime of the client.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4callback.c | 1 | ||||
-rw-r--r-- | fs/nfsd/nfs4state.c | 2 | ||||
-rw-r--r-- | fs/nfsd/state.h | 4 |
3 files changed, 5 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 5df9dda47bf4..140bb3656a24 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
@@ -498,6 +498,7 @@ int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn) | |||
498 | return -EINVAL; | 498 | return -EINVAL; |
499 | if (conn->cb_minorversion) { | 499 | if (conn->cb_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.protocol = XPRT_TRANSPORT_BC_TCP; | 502 | args.protocol = XPRT_TRANSPORT_BC_TCP; |
502 | } | 503 | } |
503 | /* Create RPC client */ | 504 | /* Create RPC client */ |
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index c470cb78c6c1..59bc0011516b 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -760,6 +760,7 @@ static struct nfsd4_session *alloc_init_session(struct svc_rqst *rqstp, struct n | |||
760 | 760 | ||
761 | new->se_cb_seq_nr = 1; | 761 | new->se_cb_seq_nr = 1; |
762 | new->se_flags = cses->flags; | 762 | new->se_flags = cses->flags; |
763 | new->se_cb_prog = cses->callback_prog; | ||
763 | kref_init(&new->se_ref); | 764 | kref_init(&new->se_ref); |
764 | idx = hash_sessionid(&new->se_sessionid); | 765 | idx = hash_sessionid(&new->se_sessionid); |
765 | spin_lock(&client_lock); | 766 | spin_lock(&client_lock); |
@@ -782,7 +783,6 @@ static struct nfsd4_session *alloc_init_session(struct svc_rqst *rqstp, struct n | |||
782 | 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); |
783 | clp->cl_cb_conn.cb_addrlen = svc_addr_len(sa); | 784 | clp->cl_cb_conn.cb_addrlen = svc_addr_len(sa); |
784 | clp->cl_cb_conn.cb_minorversion = 1; | 785 | clp->cl_cb_conn.cb_minorversion = 1; |
785 | clp->cl_cb_conn.cb_prog = cses->callback_prog; | ||
786 | nfsd4_probe_callback(clp, &clp->cl_cb_conn); | 786 | nfsd4_probe_callback(clp, &clp->cl_cb_conn); |
787 | } | 787 | } |
788 | return new; | 788 | return new; |
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index 7f5b2671ef18..b3bed366aba4 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h | |||
@@ -96,7 +96,8 @@ struct nfs4_cb_conn { | |||
96 | /* SETCLIENTID info */ | 96 | /* SETCLIENTID info */ |
97 | struct sockaddr_storage cb_addr; | 97 | struct sockaddr_storage cb_addr; |
98 | size_t cb_addrlen; | 98 | size_t cb_addrlen; |
99 | u32 cb_prog; | 99 | u32 cb_prog; /* used only in 4.0 case; |
100 | per-session otherwise */ | ||
100 | u32 cb_minorversion; | 101 | u32 cb_minorversion; |
101 | u32 cb_ident; /* minorversion 0 only */ | 102 | u32 cb_ident; /* minorversion 0 only */ |
102 | struct svc_xprt *cb_xprt; /* minorversion 1 only */ | 103 | struct svc_xprt *cb_xprt; /* minorversion 1 only */ |
@@ -172,6 +173,7 @@ struct nfsd4_session { | |||
172 | struct nfsd4_channel_attrs se_fchannel; | 173 | struct nfsd4_channel_attrs se_fchannel; |
173 | struct nfsd4_channel_attrs se_bchannel; | 174 | struct nfsd4_channel_attrs se_bchannel; |
174 | struct list_head se_conns; | 175 | struct list_head se_conns; |
176 | u32 se_cb_prog; | ||
175 | u32 se_cb_seq_nr; | 177 | u32 se_cb_seq_nr; |
176 | struct nfsd4_slot *se_slots[]; /* forward channel slots */ | 178 | struct nfsd4_slot *se_slots[]; /* forward channel slots */ |
177 | }; | 179 | }; |