Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Change layered file systems to always pass the locking VOP's...
details: https://anonhg.NetBSD.org/src/rev/7a52e93e384d
branches: trunk
changeset: 755443:7a52e93e384d
user: hannken <hannken%NetBSD.org@localhost>
date: Sun Jun 06 08:01:30 2010 +0000
description:
Change layered file systems to always pass the locking VOP's down to the
leaf file system. Remove now unused member v_vnlock from struct vnode.
Welcome to 5.99.30
Discussed on tech-kern.
diffstat:
doc/CHANGES | 3 +-
share/man/man9/vnode.9 | 26 ++-----------
sys/fs/udf/udf_subr.c | 10 ++--
sys/fs/union/union_subr.c | 5 +-
sys/fs/unionfs/unionfs_subr.c | 10 +----
sys/kern/vfs_subr.c | 10 ++---
sys/kern/vfs_vnops.c | 12 ++----
sys/miscfs/genfs/genfs_vnops.c | 10 ++--
sys/miscfs/genfs/layer.h | 29 +--------------
sys/miscfs/genfs/layer_subr.c | 25 +-----------
sys/miscfs/genfs/layer_vnops.c | 81 ++++++-----------------------------------
sys/miscfs/umapfs/umap_vnops.c | 8 +--
sys/sys/param.h | 4 +-
sys/sys/vnode.h | 16 ++------
14 files changed, 53 insertions(+), 196 deletions(-)
diffs (truncated from 684 to 300 lines):
diff -r e551d3fae024 -r 7a52e93e384d doc/CHANGES
--- a/doc/CHANGES Sun Jun 06 07:46:17 2010 +0000
+++ b/doc/CHANGES Sun Jun 06 08:01:30 2010 +0000
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1399 $>
+# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1400 $>
#
#
# [Note: This file does not mention every change made to the NetBSD source tree.
@@ -624,3 +624,4 @@
[mrg 20100527]
atf(7): Import 0.9. [jmmv 20100604]
dhcpcd(8): Import dhcpcd-5.2.4. [roy 20100604]
+ vnode(9): Remove member v_vnlock. [hannken 20100605]
diff -r e551d3fae024 -r 7a52e93e384d share/man/man9/vnode.9
--- a/share/man/man9/vnode.9 Sun Jun 06 07:46:17 2010 +0000
+++ b/share/man/man9/vnode.9 Sun Jun 06 08:01:30 2010 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: vnode.9,v 1.48 2010/05/30 13:50:16 ahoka Exp $
+.\" $NetBSD: vnode.9,v 1.49 2010/06/06 08:01:31 hannken Exp $
.\"
.\" Copyright (c) 2001, 2005, 2006 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -27,7 +27,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd May 30, 2010
+.Dd June 6, 2010
.Dt VNODE 9
.Os
.Sh NAME
@@ -161,7 +161,6 @@
enum vtype v_type; /* vnode type */
enum vtagtype v_tag; /* type of underlying data */
struct vnlock v_lock; /* lock for this vnode */
- struct vnlock *v_vnlock; /* pointer to lock */
void *v_data; /* private data for fs */
struct klist v_klist; /* notes attached to vnode */
};
@@ -434,7 +433,7 @@
.El
.Pp
All vnode locking operations use
-.Em v_vnlock .
+.Em v_lock .
This lock is acquired by calling
.Xr vn_lock 9
and released by calling
@@ -462,7 +461,7 @@
of big-lock SMP locking or a uni-processor machine.
The lock may be held while sleeping.
While the
-.Em v_vnlock
+.Em v_lock
is acquired, the holder is guaranteed that the vnode will not be
reclaimed or invalidated.
Most file system functions require that you hold the vnode lock on entry.
@@ -470,23 +469,6 @@
.Xr lock 9
for details on the kernel locking API.
.Pp
-For leaf file systems (such as ffs, lfs, msdosfs, etc),
-.Em v_vnlock
-will point to
-.Em v_lock .
-For stacked file systems,
-.Em v_vnlock
-will generally point to
-.Em v_vlock
-of the lowest file system.
-Additionally, the implementation of the vnode lock is the
-responsibility of the individual file systems and
-.Em v_vnlock
-may also be NULL indicating that a leaf node does not export a lock
-for vnode locking.
-In this case, stacked file systems (such as nullfs) must call the
-underlying file system directly for locking.
-.Pp
Each file system underlying a vnode allocates its own private area and
hangs it from
.Em v_data .
diff -r e551d3fae024 -r 7a52e93e384d sys/fs/udf/udf_subr.c
--- a/sys/fs/udf/udf_subr.c Sun Jun 06 07:46:17 2010 +0000
+++ b/sys/fs/udf/udf_subr.c Sun Jun 06 08:01:30 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_subr.c,v 1.104 2010/02/25 16:15:57 reinoud Exp $ */
+/* $NetBSD: udf_subr.c,v 1.105 2010/06/06 08:01:31 hannken Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -29,7 +29,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.104 2010/02/25 16:15:57 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.105 2010/06/06 08:01:31 hannken Exp $");
#endif /* not lint */
@@ -5452,7 +5452,7 @@
/* recycle udf_node */
udf_dispose_node(udf_node);
- vlockmgr(nvp->v_vnlock, LK_RELEASE);
+ vlockmgr(&nvp->v_lock, LK_RELEASE);
nvp->v_data = NULL;
ungetnewvnode(nvp);
@@ -5548,7 +5548,7 @@
/* recycle udf_node */
udf_dispose_node(udf_node);
- vlockmgr(nvp->v_vnlock, LK_RELEASE);
+ vlockmgr(&nvp->v_lock, LK_RELEASE);
nvp->v_data = NULL;
ungetnewvnode(nvp);
@@ -5883,7 +5883,7 @@
udf_do_unreserve_space(ump, NULL, vpart_num, 1);
error_out_unlock:
- vlockmgr(nvp->v_vnlock, LK_RELEASE);
+ vlockmgr(&nvp->v_lock, LK_RELEASE);
error_out_unget:
nvp->v_data = NULL;
diff -r e551d3fae024 -r 7a52e93e384d sys/fs/union/union_subr.c
--- a/sys/fs/union/union_subr.c Sun Jun 06 07:46:17 2010 +0000
+++ b/sys/fs/union/union_subr.c Sun Jun 06 08:01:30 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: union_subr.c,v 1.35 2010/01/08 11:35:09 pooka Exp $ */
+/* $NetBSD: union_subr.c,v 1.36 2010/06/06 08:01:31 hannken Exp $ */
/*
* Copyright (c) 1994
@@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: union_subr.c,v 1.35 2010/01/08 11:35:09 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_subr.c,v 1.36 2010/06/06 08:01:31 hannken Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -532,7 +532,6 @@
(*vpp)->v_vflag |= vflag;
(*vpp)->v_iflag |= iflag;
- (*vpp)->v_vnlock = NULL; /* Make upper layers call VOP_LOCK */
if (uppervp)
(*vpp)->v_type = uppervp->v_type;
else
diff -r e551d3fae024 -r 7a52e93e384d sys/fs/unionfs/unionfs_subr.c
--- a/sys/fs/unionfs/unionfs_subr.c Sun Jun 06 07:46:17 2010 +0000
+++ b/sys/fs/unionfs/unionfs_subr.c Sun Jun 06 08:01:30 2010 +0000
@@ -110,10 +110,6 @@
unp->un_uppervp = uppervp;
unp->un_lowervp = lowervp;
unp->un_dvp = dvp;
- if (uppervp != NULLVP)
- vp->v_vnlock = uppervp->v_vnlock;
- else
- vp->v_vnlock = lowervp->v_vnlock;
if (path != NULL) {
unp->un_path = (char *)
@@ -156,7 +152,6 @@
lvp = unp->un_lowervp;
uvp = unp->un_uppervp;
unp->un_lowervp = unp->un_uppervp = NULLVP;
- vp->v_vnlock = &(vp->v_lock);
vp->v_data = NULL;
if (lvp != NULLVP)
@@ -490,9 +485,8 @@
*/
mutex_enter(&vp->v_interlock);
unp->un_uppervp = uvp;
- vp->v_vnlock = uvp->v_vnlock;
- lockcnt = lvp->v_vnlock->vl_recursecnt +
- rw_write_held(&lvp->v_vnlock->vl_lock);
+ lockcnt = lvp->v_lock.vl_recursecnt +
+ rw_write_held(&lvp->v_lock.vl_lock);
if (lockcnt <= 0)
panic("unionfs: no exclusive lock");
mutex_exit(&vp->v_interlock);
diff -r e551d3fae024 -r 7a52e93e384d sys/kern/vfs_subr.c
--- a/sys/kern/vfs_subr.c Sun Jun 06 07:46:17 2010 +0000
+++ b/sys/kern/vfs_subr.c Sun Jun 06 08:01:30 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_subr.c,v 1.403 2010/05/27 23:58:38 pooka Exp $ */
+/* $NetBSD: vfs_subr.c,v 1.404 2010/06/06 08:01:31 hannken Exp $ */
/*-
* Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.403 2010/05/27 23:58:38 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.404 2010/06/06 08:01:31 hannken Exp $");
#include "opt_ddb.h"
#include "opt_compat_netbsd.h"
@@ -649,7 +649,6 @@
KASSERT(LIST_EMPTY(&vp->v_dnclist));
vp->v_type = VNON;
- vp->v_vnlock = &vp->v_lock;
vp->v_tag = tag;
vp->v_op = vops;
insmntque(vp, mp);
@@ -1951,7 +1950,6 @@
mutex_enter(&vp->v_interlock);
vp->v_op = dead_vnodeop_p;
vp->v_tag = VT_NON;
- vp->v_vnlock = &vp->v_lock;
KNOTE(&vp->v_klist, NOTE_REVOKE);
vp->v_iflag &= ~(VI_XLOCK | VI_FREEING);
vp->v_vflag &= ~VV_LOCKSWORK;
@@ -2732,7 +2730,7 @@
char bf[96];
int flag;
- vl = (vp->v_vnlock != NULL ? vp->v_vnlock : &vp->v_lock);
+ vl = &vp->v_lock;
flag = vp->v_iflag | vp->v_vflag | vp->v_uflag;
snprintb(bf, sizeof(bf), vnode_flagbits, flag);
@@ -3300,7 +3298,7 @@
ARRAY_PRINT(vp->v_type, vnode_types), vp->v_type,
vp->v_mount, vp->v_mountedhere);
- (*pr)("v_lock %p v_vnlock %p\n", &vp->v_lock, vp->v_vnlock);
+ (*pr)("v_lock %p\n", &vp->v_lock);
if (full) {
struct buf *bp;
diff -r e551d3fae024 -r 7a52e93e384d sys/kern/vfs_vnops.c
--- a/sys/kern/vfs_vnops.c Sun Jun 06 07:46:17 2010 +0000
+++ b/sys/kern/vfs_vnops.c Sun Jun 06 08:01:30 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_vnops.c,v 1.171 2010/04/23 15:38:46 pooka Exp $ */
+/* $NetBSD: vfs_vnops.c,v 1.172 2010/06/06 08:01:31 hannken Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.171 2010/04/23 15:38:46 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.172 2010/06/06 08:01:31 hannken Exp $");
#include "veriexec.h"
@@ -827,10 +827,8 @@
u_int
vn_setrecurse(struct vnode *vp)
{
- struct vnlock *lkp;
- lkp = (vp->v_vnlock != NULL ? vp->v_vnlock : &vp->v_lock);
- atomic_inc_uint(&lkp->vl_canrecurse);
+ atomic_inc_uint(&vp->v_lock.vl_canrecurse);
return 0;
}
@@ -841,10 +839,8 @@
void
vn_restorerecurse(struct vnode *vp, u_int flags)
{
- struct vnlock *lkp;
- lkp = (vp->v_vnlock != NULL ? vp->v_vnlock : &vp->v_lock);
- atomic_dec_uint(&lkp->vl_canrecurse);
+ atomic_dec_uint(&vp->v_lock.vl_canrecurse);
}
/*
diff -r e551d3fae024 -r 7a52e93e384d sys/miscfs/genfs/genfs_vnops.c
--- a/sys/miscfs/genfs/genfs_vnops.c Sun Jun 06 07:46:17 2010 +0000
+++ b/sys/miscfs/genfs/genfs_vnops.c Sun Jun 06 08:01:30 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: genfs_vnops.c,v 1.177 2010/04/08 15:56:26 pooka Exp $ */
+/* $NetBSD: genfs_vnops.c,v 1.178 2010/06/06 08:01:31 hannken Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.177 2010/04/08 15:56:26 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.178 2010/06/06 08:01:31 hannken Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -294,7 +294,7 @@
Home |
Main Index |
Thread Index |
Old Index