summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>1995-08-24 10:17:39 +0000
committerdfr <dfr@FreeBSD.org>1995-08-24 10:17:39 +0000
commit8bffcb6d1a3b548b22b61ebb466088117f22dbd4 (patch)
treed90bc1e43584830baedfd1de74bbb3f81e4cf79d
parent21ab8fe695e63021b17631de9b39b8302af39240 (diff)
downloadFreeBSD-src-8bffcb6d1a3b548b22b61ebb466088117f22dbd4.zip
FreeBSD-src-8bffcb6d1a3b548b22b61ebb466088117f22dbd4.tar.gz
Add support for amd direct maps.
Reviewed by: Thomas Graichen <graichen@sirius.physik.fu-berlin.de>
-rw-r--r--sys/kern/vfs_lookup.c37
-rw-r--r--sys/nfs/nfs_bio.c4
-rw-r--r--sys/nfs/nfs_common.c4
-rw-r--r--sys/nfs/nfs_subs.c4
-rw-r--r--sys/nfs/nfs_vfsops.c10
-rw-r--r--sys/nfsclient/nfs_bio.c4
-rw-r--r--sys/nfsclient/nfs_subs.c4
-rw-r--r--sys/nfsclient/nfs_vfsops.c10
-rw-r--r--sys/nfsserver/nfs_srvsubs.c4
9 files changed, 47 insertions, 34 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index e3c7654..35a7a69 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_lookup.c 8.4 (Berkeley) 2/16/94
- * $Id: vfs_lookup.c,v 1.7 1995/05/30 08:06:33 rgrimes Exp $
+ * $Id: vfs_lookup.c,v 1.8 1995/07/31 00:35:46 bde Exp $
*/
#include <sys/param.h>
@@ -458,23 +458,6 @@ unionlookup:
}
dp = ndp->ni_vp;
- /*
- * Check for symbolic link
- */
- if ((dp->v_type == VLNK) &&
- ((cnp->cn_flags & FOLLOW) || trailing_slash ||
- *ndp->ni_next == '/')) {
- cnp->cn_flags |= ISSYMLINK;
- return (0);
- }
-
- /*
- * Check for bogus trailing slashes.
- */
- if (trailing_slash && dp->v_type != VDIR) {
- error = ENOTDIR;
- goto bad2;
- }
/*
* Check to see if the vnode has been mounted on;
@@ -494,6 +477,24 @@ unionlookup:
ndp->ni_vp = dp = tdp;
}
+ /*
+ * Check for symbolic link
+ */
+ if ((dp->v_type == VLNK) &&
+ ((cnp->cn_flags & FOLLOW) || trailing_slash ||
+ *ndp->ni_next == '/')) {
+ cnp->cn_flags |= ISSYMLINK;
+ return (0);
+ }
+
+ /*
+ * Check for bogus trailing slashes.
+ */
+ if (trailing_slash && dp->v_type != VDIR) {
+ error = ENOTDIR;
+ goto bad2;
+ }
+
nextname:
/*
* Not a symbolic link. If more pathname,
diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c
index 8507783..d48a020 100644
--- a/sys/nfs/nfs_bio.c
+++ b/sys/nfs/nfs_bio.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_bio.c 8.5 (Berkeley) 1/4/94
- * $Id: nfs_bio.c,v 1.15 1995/06/27 11:06:34 dfr Exp $
+ * $Id: nfs_bio.c,v 1.16 1995/07/07 11:01:30 dfr Exp $
*/
#include <sys/param.h>
@@ -125,7 +125,7 @@ nfs_bioread(vp, uio, ioflag, cred)
* attributes this could be forced by setting n_attrstamp to 0 before
* the VOP_GETATTR() call.
*/
- if ((nmp->nm_flag & NFSMNT_NQNFS) == 0 && vp->v_type != VLNK) {
+ if ((nmp->nm_flag & NFSMNT_NQNFS) == 0) {
if (np->n_flag & NMODIFIED) {
if (vp->v_type != VREG) {
if (vp->v_type != VDIR)
diff --git a/sys/nfs/nfs_common.c b/sys/nfs/nfs_common.c
index 4c6d4bb..5bdda4a 100644
--- a/sys/nfs/nfs_common.c
+++ b/sys/nfs/nfs_common.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
- * $Id: nfs_subs.c,v 1.21 1995/07/20 09:43:12 davidg Exp $
+ * $Id: nfs_subs.c,v 1.22 1995/07/29 11:42:22 bde Exp $
*/
/*
@@ -1243,7 +1243,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
* information.
*/
np = VTONFS(vp);
- if (vp->v_type == VNON) {
+ if (vp->v_type != vtyp) {
/*
* If we had a lock and it turns out that the vnode
* is an object which we don't want to lock (e.g. VDIR)
diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c
index 4c6d4bb..5bdda4a 100644
--- a/sys/nfs/nfs_subs.c
+++ b/sys/nfs/nfs_subs.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
- * $Id: nfs_subs.c,v 1.21 1995/07/20 09:43:12 davidg Exp $
+ * $Id: nfs_subs.c,v 1.22 1995/07/29 11:42:22 bde Exp $
*/
/*
@@ -1243,7 +1243,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
* information.
*/
np = VTONFS(vp);
- if (vp->v_type == VNON) {
+ if (vp->v_type != vtyp) {
/*
* If we had a lock and it turns out that the vnode
* is an object which we don't want to lock (e.g. VDIR)
diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c
index cc14093..2f94027 100644
--- a/sys/nfs/nfs_vfsops.c
+++ b/sys/nfs/nfs_vfsops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vfsops.c 8.3 (Berkeley) 1/4/94
- * $Id: nfs_vfsops.c,v 1.17 1995/07/07 11:01:31 dfr Exp $
+ * $Id: nfs_vfsops.c,v 1.18 1995/08/11 11:31:12 davidg Exp $
*/
#include <sys/param.h>
@@ -538,6 +538,7 @@ mountnfs(argp, mp, nam, pth, hst, vpp)
register struct nfsmount *nmp;
struct nfsnode *np;
int error, maxio;
+ struct vattr attrs;
if (mp->mnt_flag & MNT_UPDATE) {
nmp = VFSTONFS(mp);
@@ -689,6 +690,12 @@ mountnfs(argp, mp, nam, pth, hst, vpp)
*vpp = NFSTOV(np);
/*
+ * Get file attributes for the mountpoint. This has the side
+ * effect of filling in (*vpp)->v_type with the correct value.
+ */
+ VOP_GETATTR(*vpp, &attrs, curproc->p_ucred, curproc);
+
+ /*
* Lose the lock but keep the ref.
*/
VOP_UNLOCK(*vpp);
@@ -797,7 +804,6 @@ nfs_root(mp, vpp)
return (error);
vp = NFSTOV(np);
VOP_UNLOCK(vp);
- vp->v_type = VDIR;
vp->v_flag = VROOT;
*vpp = vp;
return (0);
diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c
index 8507783..d48a020 100644
--- a/sys/nfsclient/nfs_bio.c
+++ b/sys/nfsclient/nfs_bio.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_bio.c 8.5 (Berkeley) 1/4/94
- * $Id: nfs_bio.c,v 1.15 1995/06/27 11:06:34 dfr Exp $
+ * $Id: nfs_bio.c,v 1.16 1995/07/07 11:01:30 dfr Exp $
*/
#include <sys/param.h>
@@ -125,7 +125,7 @@ nfs_bioread(vp, uio, ioflag, cred)
* attributes this could be forced by setting n_attrstamp to 0 before
* the VOP_GETATTR() call.
*/
- if ((nmp->nm_flag & NFSMNT_NQNFS) == 0 && vp->v_type != VLNK) {
+ if ((nmp->nm_flag & NFSMNT_NQNFS) == 0) {
if (np->n_flag & NMODIFIED) {
if (vp->v_type != VREG) {
if (vp->v_type != VDIR)
diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c
index 4c6d4bb..5bdda4a 100644
--- a/sys/nfsclient/nfs_subs.c
+++ b/sys/nfsclient/nfs_subs.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
- * $Id: nfs_subs.c,v 1.21 1995/07/20 09:43:12 davidg Exp $
+ * $Id: nfs_subs.c,v 1.22 1995/07/29 11:42:22 bde Exp $
*/
/*
@@ -1243,7 +1243,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
* information.
*/
np = VTONFS(vp);
- if (vp->v_type == VNON) {
+ if (vp->v_type != vtyp) {
/*
* If we had a lock and it turns out that the vnode
* is an object which we don't want to lock (e.g. VDIR)
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index cc14093..2f94027 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vfsops.c 8.3 (Berkeley) 1/4/94
- * $Id: nfs_vfsops.c,v 1.17 1995/07/07 11:01:31 dfr Exp $
+ * $Id: nfs_vfsops.c,v 1.18 1995/08/11 11:31:12 davidg Exp $
*/
#include <sys/param.h>
@@ -538,6 +538,7 @@ mountnfs(argp, mp, nam, pth, hst, vpp)
register struct nfsmount *nmp;
struct nfsnode *np;
int error, maxio;
+ struct vattr attrs;
if (mp->mnt_flag & MNT_UPDATE) {
nmp = VFSTONFS(mp);
@@ -689,6 +690,12 @@ mountnfs(argp, mp, nam, pth, hst, vpp)
*vpp = NFSTOV(np);
/*
+ * Get file attributes for the mountpoint. This has the side
+ * effect of filling in (*vpp)->v_type with the correct value.
+ */
+ VOP_GETATTR(*vpp, &attrs, curproc->p_ucred, curproc);
+
+ /*
* Lose the lock but keep the ref.
*/
VOP_UNLOCK(*vpp);
@@ -797,7 +804,6 @@ nfs_root(mp, vpp)
return (error);
vp = NFSTOV(np);
VOP_UNLOCK(vp);
- vp->v_type = VDIR;
vp->v_flag = VROOT;
*vpp = vp;
return (0);
diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c
index 4c6d4bb..5bdda4a 100644
--- a/sys/nfsserver/nfs_srvsubs.c
+++ b/sys/nfsserver/nfs_srvsubs.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
- * $Id: nfs_subs.c,v 1.21 1995/07/20 09:43:12 davidg Exp $
+ * $Id: nfs_subs.c,v 1.22 1995/07/29 11:42:22 bde Exp $
*/
/*
@@ -1243,7 +1243,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
* information.
*/
np = VTONFS(vp);
- if (vp->v_type == VNON) {
+ if (vp->v_type != vtyp) {
/*
* If we had a lock and it turns out that the vnode
* is an object which we don't want to lock (e.g. VDIR)
OpenPOWER on IntegriCloud