Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Apr 2001 11:40:47 -0400 (EDT)
From:      Robert Watson <rwatson@FreeBSD.ORG>
To:        Matt Dillon <dillon@earth.backplane.com>
Cc:        Alfred Perlstein <bright@wintelcom.net>, Brian Somers <brian@Awfulhak.org>, freebsd-arch@FreeBSD.ORG
Subject:   Re: Eliminate crget() from nfs kernel code?
Message-ID:  <Pine.NEB.3.96L.1010404113251.14983A-100000@fledge.watson.org>
In-Reply-To: <Pine.NEB.3.96L.1010403225735.7479E-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help

For those interested in giving the p->p_ucred version a try, the simply
patch is below.  It works between FreeBSD boxes, and my tests against
Solaris 5.5.  Unfortunately, my remote NFS test box already has interop
problems with Linux due to the new mount_nfs that I haven't applied
patches to yet, so I can't test that case.

Robert N M Watson             FreeBSD Core Team, TrustedBSD Project
robert@fledge.watson.org      NAI Labs, Safeport Network Services

Index: nfs_vfsops.c
===================================================================
RCS file: /home/ncvs/src/sys/nfs/nfs_vfsops.c,v
retrieving revision 1.94
diff -u -r1.94 nfs_vfsops.c
--- nfs_vfsops.c	2001/03/01 20:59:19	1.94
+++ nfs_vfsops.c	2001/04/04 03:25:36
@@ -254,7 +254,6 @@
 	struct nfsmount *nmp = VFSTONFS(mp);
 	int error = 0, v3 = (nmp->nm_flag & NFSMNT_NFSV3), retattr;
 	struct mbuf *mreq, *mrep, *md, *mb, *mb2;
-	struct ucred *cred;
 	struct nfsnode *np;
 	u_quad_t tquad;
 
@@ -265,14 +264,12 @@
 	if (error)
 		return (error);
 	vp = NFSTOV(np);
-	cred = crget();
-	cred->cr_ngroups = 1;
 	if (v3 && (nmp->nm_state & NFSSTA_GOTFSINFO) == 0)
-		(void)nfs_fsinfo(nmp, vp, cred, p);
+		(void)nfs_fsinfo(nmp, vp, p->p_ucred, p);
 	nfsstats.rpccnt[NFSPROC_FSSTAT]++;
 	nfsm_reqhead(vp, NFSPROC_FSSTAT, NFSX_FH(v3));
 	nfsm_fhtom(vp, v3);
-	nfsm_request(vp, NFSPROC_FSSTAT, p, cred);
+	nfsm_request(vp, NFSPROC_FSSTAT, p, p->p_ucred);
 	if (v3)
 		nfsm_postop_attr(vp, retattr);
 	if (error) {
@@ -310,7 +307,6 @@
 	}
 	nfsm_reqdone;
 	vput(vp);
-	crfree(cred);
 	return (error);
 }
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1010404113251.14983A-100000>