svn commit: r234822 - in projects/nfsv4.1-client/sys/fs: nfs
nfsclient
Rick Macklem
rmacklem at FreeBSD.org
Sun Apr 29 22:29:29 UTC 2012
Author: rmacklem
Date: Sun Apr 29 22:29:28 2012
New Revision: 234822
URL: http://svn.freebsd.org/changeset/base/234822
Log:
Add a flag to nfsrpc_createsession() to indicate when it is called
for the MDS, so that it can ask for a backchannel and flag that it
got a persistent session.
Modified:
projects/nfsv4.1-client/sys/fs/nfs/nfs_var.h
projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clrpcops.c
Modified: projects/nfsv4.1-client/sys/fs/nfs/nfs_var.h
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfs/nfs_var.h Sun Apr 29 22:28:15 2012 (r234821)
+++ projects/nfsv4.1-client/sys/fs/nfs/nfs_var.h Sun Apr 29 22:29:28 2012 (r234822)
@@ -440,7 +440,7 @@ int nfsrpc_exchangeid(struct nfsmount *,
struct nfssockreq *, uint32_t, struct nfsclds **, struct ucred *,
NFSPROC_T *);
int nfsrpc_createsession(struct nfsmount *, struct nfsclsession *,
- uint32_t, struct ucred *, NFSPROC_T *);
+ uint32_t, int, struct ucred *, NFSPROC_T *);
int nfsrpc_destroysession(struct nfsmount *, struct nfsclclient *,
struct ucred *, NFSPROC_T *);
int nfsrpc_destroyclient(struct nfsmount *, struct nfsclclient *,
Modified: projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clrpcops.c
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clrpcops.c Sun Apr 29 22:28:15 2012 (r234821)
+++ projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clrpcops.c Sun Apr 29 22:29:28 2012 (r234822)
@@ -827,7 +827,7 @@ nfsrpc_setclient(struct nfsmount *nmp, s
if (error) printf("exch=%d\n",error);
if (error == 0) {
error = nfsrpc_createsession(nmp, &dsp->nfsclds_sess,
- dsp->nfsclds_sess.nfsess_sequenceid, cred, p);
+ dsp->nfsclds_sess.nfsess_sequenceid, 1, cred, p);
if (error == 0) {
KASSERT(TAILQ_FIRST(&nmp->nm_sess) == NULL,
("nfscl session non-NULL"));
@@ -4467,7 +4467,7 @@ nfsmout:
*/
int
nfsrpc_createsession(struct nfsmount *nmp, struct nfsclsession *sep,
- uint32_t sequenceid, struct ucred *cred, NFSPROC_T *p)
+ uint32_t sequenceid, int mds, struct ucred *cred, NFSPROC_T *p)
{
uint32_t crflags, *tl;
struct nfsrv_descript nfsd;
@@ -4481,7 +4481,7 @@ nfsrpc_createsession(struct nfsmount *nm
*tl++ = txdr_unsigned(sequenceid);
printf("clseq0=0x%x\n",sequenceid);
crflags = (NFSMNT_RDONLY(nmp->nm_mountp) ? 0 : NFSV4CRSESS_PERSIST);
- if (nfscl_enablecallb != 0 && nfs_numnfscbd > 0)
+ if (nfscl_enablecallb != 0 && nfs_numnfscbd > 0 && mds != 0)
crflags |= NFSV4CRSESS_CONNBACKCHAN;
*tl = txdr_unsigned(crflags);
@@ -4530,7 +4530,7 @@ printf("clseq0=0x%x\n",sequenceid);
crflags = fxdr_unsigned(uint32_t, *tl);
printf("clseq=0x%x\n",sep->nfsess_sequenceid);
printf("crfl=0x%x\n",crflags);
- if ((crflags & NFSV4CRSESS_PERSIST) != 0) {
+ if ((crflags & NFSV4CRSESS_PERSIST) != 0 && mds != 0) {
NFSLOCKMNT(nmp);
nmp->nm_state |= NFSSTA_SESSPERSIST;
NFSUNLOCKMNT(nmp);
@@ -5216,7 +5216,7 @@ nfsrpc_fillsa(struct nfsmount *nmp, stru
sequenceid = dsp->nfsclds_sess.nfsess_sequenceid;
NFSUNLOCKMNT(nmp);
error = nfsrpc_createsession(nmp, &dsp->nfsclds_sess,
- sequenceid, nrp->nr_cred, p);
+ sequenceid, 0, nrp->nr_cred, p);
} else {
NFSFREECRED(nrp->nr_cred);
NFSFREEMUTEX(&nrp->nr_mtx);
More information about the svn-src-projects
mailing list