Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Bump osrelease to 1.4E. Add layerfs files, remove null_s...
details: https://anonhg.NetBSD.org/src/rev/1a08a4d97352
branches: trunk
changeset: 474480:1a08a4d97352
user: wrstuden <wrstuden%NetBSD.org@localhost>
date: Thu Jul 08 01:26:21 1999 +0000
description:
Bump osrelease to 1.4E. Add layerfs files, remove null_subr.c.
Update coda to new struct lock in struct vnode.
make fdescfs, kernfs, portalfs, and procfs actually lock their vnodes.
It's not that hard.
Make unionfs set v_vnlock = NULL so any overlayed fs will call its
VOP_LOCK.
diffstat:
sys/coda/cnode.h | 14 +++++-
sys/coda/coda_vnops.c | 26 +++++++--
sys/conf/files | 6 +-
sys/conf/osrelease.sh | 4 +-
sys/miscfs/fdesc/fdesc_vfsops.c | 3 +-
sys/miscfs/fdesc/fdesc_vnops.c | 64 +++++++++++++++++---------
sys/miscfs/kernfs/kernfs_vnops.c | 45 +++++++++++-------
sys/miscfs/portal/portal_vnops.c | 31 +++++++-----
sys/miscfs/procfs/procfs_subr.c | 8 ++-
sys/miscfs/procfs/procfs_vnops.c | 96 ++++++++++++++++++++++++++++++----------
sys/miscfs/union/union_subr.c | 3 +-
11 files changed, 207 insertions(+), 93 deletions(-)
diffs (truncated from 816 to 300 lines):
diff -r 293717beda2b -r 1a08a4d97352 sys/coda/cnode.h
--- a/sys/coda/cnode.h Thu Jul 08 01:18:59 1999 +0000
+++ b/sys/coda/cnode.h Thu Jul 08 01:26:21 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cnode.h,v 1.5 1998/11/11 19:22:08 rvb Exp $ */
+/* $NetBSD: cnode.h,v 1.6 1999/07/08 01:26:23 wrstuden Exp $ */
/*
*
@@ -47,6 +47,17 @@
/*
* HISTORY
* $Log: cnode.h,v $
+ * Revision 1.6 1999/07/08 01:26:23 wrstuden
+ * Bump osrelease to 1.4E. Add layerfs files, remove null_subr.c.
+ *
+ * Update coda to new struct lock in struct vnode.
+ *
+ * make fdescfs, kernfs, portalfs, and procfs actually lock their vnodes.
+ * It's not that hard.
+ *
+ * Make unionfs set v_vnlock = NULL so any overlayed fs will call its
+ * VOP_LOCK.
+ *
* Revision 1.5 1998/11/11 19:22:08 rvb
* Lookup now passes up an extra flag. But old veni will
* be ok; new veni will check /dev/cfs0 to make sure that a new
@@ -216,7 +227,6 @@
struct vnode *c_vnode;
u_short c_flags; /* flags (see below) */
ViceFid c_fid; /* file handle */
- struct lock c_lock; /* new lock protocol */
struct vnode *c_ovp; /* open vnode pointer */
u_short c_ocount; /* count of openers */
u_short c_owrite; /* count of open for write */
diff -r 293717beda2b -r 1a08a4d97352 sys/coda/coda_vnops.c
--- a/sys/coda/coda_vnops.c Thu Jul 08 01:18:59 1999 +0000
+++ b/sys/coda/coda_vnops.c Thu Jul 08 01:26:21 1999 +0000
@@ -6,7 +6,7 @@
rmdir
symlink
*/
-/* $NetBSD: coda_vnops.c,v 1.9 1998/12/10 02:22:52 rvb Exp $ */
+/* $NetBSD: coda_vnops.c,v 1.10 1999/07/08 01:26:23 wrstuden Exp $ */
/*
*
@@ -56,6 +56,17 @@
/*
* HISTORY
* $Log: coda_vnops.c,v $
+ * Revision 1.10 1999/07/08 01:26:23 wrstuden
+ * Bump osrelease to 1.4E. Add layerfs files, remove null_subr.c.
+ *
+ * Update coda to new struct lock in struct vnode.
+ *
+ * make fdescfs, kernfs, portalfs, and procfs actually lock their vnodes.
+ * It's not that hard.
+ *
+ * Make unionfs set v_vnlock = NULL so any overlayed fs will call its
+ * VOP_LOCK.
+ *
* Revision 1.9 1998/12/10 02:22:52 rvb
* Commit a couple of old fixes
*
@@ -1080,7 +1091,7 @@
printf("coda_inactive: cp->ovp != NULL use %d: vp %p, cp %p\n",
vp->v_usecount, vp, cp);
#endif
- lockmgr(&cp->c_lock, LK_RELEASE, &vp->v_interlock);
+ lockmgr(&vp->v_lock, LK_RELEASE, &vp->v_interlock);
} else {
#ifdef OLD_DIAGNOSTIC
if (CTOV(cp)->v_usecount) {
@@ -1131,6 +1142,8 @@
int vtype;
int error = 0;
+ cnp->cn_flags &= ~PDIRUNLOCK;
+
MARK_ENTRY(CODA_LOOKUP_STATS);
CODADEBUG(CODA_LOOKUP, myprintf(("lookup: %s in %lx.%lx.%lx\n",
@@ -1239,6 +1252,7 @@
if ((error = VOP_UNLOCK(dvp, 0))) {
return error;
}
+ cnp->cn_flags |= PDIRUNLOCK;
/*
* The parent is unlocked. As long as there is a child,
* lock it without bothering to check anything else.
@@ -2043,7 +2057,7 @@
cp->c_fid.Volume, cp->c_fid.Vnode, cp->c_fid.Unique));
}
- return (lockmgr(&cp->c_lock, ap->a_flags, &vp->v_interlock));
+ return (lockmgr(&vp->v_lock, ap->a_flags, &vp->v_interlock));
}
int
@@ -2063,7 +2077,7 @@
cp->c_fid.Volume, cp->c_fid.Vnode, cp->c_fid.Unique));
}
- return (lockmgr(&cp->c_lock, ap->a_flags | LK_RELEASE, &vp->v_interlock));
+ return (lockmgr(&vp->v_lock, ap->a_flags | LK_RELEASE, &vp->v_interlock));
}
int
@@ -2072,10 +2086,9 @@
{
/* true args */
struct vop_islocked_args *ap = v;
- struct cnode *cp = VTOC(ap->a_vp);
ENTRY;
- return (lockstatus(&cp->c_lock));
+ return (lockstatus(&ap->a_vp->v_lock));
}
/* How one looks up a vnode given a device/inode pair: */
@@ -2194,7 +2207,6 @@
struct vnode *vp;
cp = coda_alloc();
- lockinit(&cp->c_lock, PINOD, "cnode", 0, 0);
cp->c_fid = *fid;
err = getnewvnode(VT_CODA, vfsp, coda_vnodeop_p, &vp);
diff -r 293717beda2b -r 1a08a4d97352 sys/conf/files
--- a/sys/conf/files Thu Jul 08 01:18:59 1999 +0000
+++ b/sys/conf/files Thu Jul 08 01:26:21 1999 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files,v 1.298 1999/07/07 00:05:30 thorpej Exp $
+# $NetBSD: files,v 1.299 1999/07/08 01:26:21 wrstuden Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
@@ -677,9 +677,11 @@
file miscfs/fdesc/fdesc_vnops.c fdesc
file miscfs/fifofs/fifo_vnops.c
file miscfs/genfs/genfs_vnops.c
+file miscfs/genfs/layer_subr.c
+file miscfs/genfs/layer_vfsops.c
+file miscfs/genfs/layer_vnops.c
file miscfs/kernfs/kernfs_vfsops.c kernfs
file miscfs/kernfs/kernfs_vnops.c kernfs
-file miscfs/nullfs/null_subr.c nullfs
file miscfs/nullfs/null_vfsops.c nullfs
file miscfs/nullfs/null_vnops.c nullfs
file miscfs/portal/portal_vfsops.c portal
diff -r 293717beda2b -r 1a08a4d97352 sys/conf/osrelease.sh
--- a/sys/conf/osrelease.sh Thu Jul 08 01:18:59 1999 +0000
+++ b/sys/conf/osrelease.sh Thu Jul 08 01:26:21 1999 +0000
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: osrelease.sh,v 1.19 1999/06/16 23:10:52 thorpej Exp $
+# $NetBSD: osrelease.sh,v 1.20 1999/07/08 01:26:22 wrstuden Exp $
#
# Copyright (c) 1997 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -38,7 +38,7 @@
#
# Release number to use
-release=1.4D
+release=1.4E
case $1 in
diff -r 293717beda2b -r 1a08a4d97352 sys/miscfs/fdesc/fdesc_vfsops.c
--- a/sys/miscfs/fdesc/fdesc_vfsops.c Thu Jul 08 01:18:59 1999 +0000
+++ b/sys/miscfs/fdesc/fdesc_vfsops.c Thu Jul 08 01:26:21 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdesc_vfsops.c,v 1.27 1999/02/26 23:44:45 wrstuden Exp $ */
+/* $NetBSD: fdesc_vfsops.c,v 1.28 1999/07/08 01:26:26 wrstuden Exp $ */
/*
* Copyright (c) 1992, 1993, 1995
@@ -117,6 +117,7 @@
memset(mp->mnt_stat.f_mntonname + size, 0, MNAMELEN - size);
memset(mp->mnt_stat.f_mntfromname, 0, MNAMELEN);
memcpy(mp->mnt_stat.f_mntfromname, "fdesc", sizeof("fdesc"));
+ VOP_UNLOCK(rvp, 0);
return (0);
}
diff -r 293717beda2b -r 1a08a4d97352 sys/miscfs/fdesc/fdesc_vnops.c
--- a/sys/miscfs/fdesc/fdesc_vnops.c Thu Jul 08 01:18:59 1999 +0000
+++ b/sys/miscfs/fdesc/fdesc_vnops.c Thu Jul 08 01:26:21 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdesc_vnops.c,v 1.47 1998/08/13 10:06:32 kleink Exp $ */
+/* $NetBSD: fdesc_vnops.c,v 1.48 1999/07/08 01:26:26 wrstuden Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -87,8 +87,8 @@
u_long fdhash;
int fdesc_lookup __P((void *));
-#define fdesc_create genfs_eopnotsupp
-#define fdesc_mknod genfs_eopnotsupp
+#define fdesc_create genfs_eopnotsupp_rele
+#define fdesc_mknod genfs_eopnotsupp_rele
int fdesc_open __P((void *));
#define fdesc_close genfs_nullop
#define fdesc_access genfs_nullop
@@ -101,24 +101,24 @@
#define fdesc_mmap genfs_eopnotsupp
#define fdesc_fsync genfs_nullop
#define fdesc_seek genfs_seek
-#define fdesc_remove genfs_eopnotsupp
+#define fdesc_remove genfs_eopnotsupp_rele
int fdesc_link __P((void *));
-#define fdesc_rename genfs_eopnotsupp
-#define fdesc_mkdir genfs_eopnotsupp
-#define fdesc_rmdir genfs_eopnotsupp
+#define fdesc_rename genfs_eopnotsupp_rele
+#define fdesc_mkdir genfs_eopnotsupp_rele
+#define fdesc_rmdir genfs_eopnotsupp_rele
int fdesc_symlink __P((void *));
int fdesc_readdir __P((void *));
int fdesc_readlink __P((void *));
#define fdesc_abortop genfs_abortop
int fdesc_inactive __P((void *));
int fdesc_reclaim __P((void *));
-#define fdesc_lock genfs_nolock
-#define fdesc_unlock genfs_nounlock
+#define fdesc_lock genfs_lock
+#define fdesc_unlock genfs_unlock
#define fdesc_bmap genfs_badop
#define fdesc_strategy genfs_badop
int fdesc_print __P((void *));
int fdesc_pathconf __P((void *));
-#define fdesc_islocked genfs_noislocked
+#define fdesc_islocked genfs_islocked
#define fdesc_advlock genfs_einval
#define fdesc_blkatoff genfs_eopnotsupp
#define fdesc_valloc genfs_eopnotsupp
@@ -196,6 +196,9 @@
fdhashtbl = hashinit(NFDCACHE, M_CACHE, M_NOWAIT, &fdhash);
}
+/*
+ * Return a locked vnode of the correct type.
+ */
int
fdesc_allocvp(ftype, ix, mp, vpp)
fdntype ftype;
@@ -211,7 +214,7 @@
loop:
for (fd = fc->lh_first; fd != 0; fd = fd->fd_hash.le_next) {
if (fd->fd_ix == ix && fd->fd_vnode->v_mount == mp) {
- if (vget(fd->fd_vnode, 0))
+ if (vget(fd->fd_vnode, LK_EXCLUSIVE))
goto loop;
*vpp = fd->fd_vnode;
return (error);
@@ -239,6 +242,7 @@
fd->fd_fd = -1;
fd->fd_link = 0;
fd->fd_ix = ix;
+ VOP_LOCK(*vpp, LK_EXCLUSIVE);
LIST_INSERT_HEAD(fc, fd, fd_hash);
out:;
@@ -279,7 +283,6 @@
if (cnp->cn_namelen == 1 && *pname == '.') {
*vpp = dvp;
VREF(dvp);
- vn_lock(dvp, LK_SHARED | LK_RETRY);
return (0);
}
@@ -298,8 +301,7 @@
goto bad;
*vpp = fvp;
fvp->v_type = VDIR;
- vn_lock(dvp, LK_SHARED | LK_RETRY);
- return (0);
+ goto good;
}
if (cnp->cn_namelen == 3 && memcmp(pname, "tty", 3) == 0) {
@@ -313,8 +315,7 @@
goto bad;
*vpp = fvp;
fvp->v_type = VCHR;
- vn_lock(dvp, LK_SHARED | LK_RETRY);
- return (0);
+ goto good;
}
ln = 0;
@@ -344,8 +345,7 @@
VTOFDESC(fvp)->fd_link = ln;
*vpp = fvp;
fvp->v_type = VLNK;
- vn_lock(fvp, LK_SHARED | LK_RETRY);
Home |
Main Index |
Thread Index |
Old Index