Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Make holding v_interlock mandatory for callers of vget().



details:   https://anonhg.NetBSD.org/src/rev/1cb375ecd858
branches:  trunk
changeset: 756537:1cb375ecd858
user:      hannken <hannken%NetBSD.org@localhost>
date:      Wed Jul 21 17:52:09 2010 +0000

description:
Make holding v_interlock mandatory for callers of vget().

Announced some time ago on tech-kern.

diffstat:

 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c |   2 +-
 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c  |   2 +-
 sys/fs/adosfs/adutil.c                                  |   6 +++---
 sys/fs/cd9660/cd9660_node.c                             |   6 +++---
 sys/fs/efs/efs_ihash.c                                  |   6 +++---
 sys/fs/filecorefs/filecore_node.c                       |   6 +++---
 sys/fs/hfs/hfs_nhash.c                                  |   6 +++---
 sys/fs/msdosfs/msdosfs_denode.c                         |   6 +++---
 sys/fs/msdosfs/msdosfs_vfsops.c                         |   8 ++++----
 sys/fs/nilfs/nilfs_subr.c                               |   6 +++---
 sys/fs/ntfs/ntfs_vfsops.c                               |   6 +++---
 sys/fs/ptyfs/ptyfs_subr.c                               |   6 +++---
 sys/fs/puffs/puffs_node.c                               |   8 ++++----
 sys/fs/puffs/puffs_vfsops.c                             |   6 +++---
 sys/fs/smbfs/smbfs_node.c                               |   6 +++---
 sys/fs/smbfs/smbfs_vfsops.c                             |   6 +++---
 sys/fs/sysvbfs/sysvbfs_vfsops.c                         |   8 ++++----
 sys/fs/tmpfs/tmpfs_subr.c                               |   6 +++---
 sys/fs/udf/udf_subr.c                                   |   8 ++++----
 sys/fs/union/union_subr.c                               |   6 +++---
 sys/kern/vfs_cache.c                                    |  10 +++++-----
 sys/kern/vfs_subr.c                                     |  13 ++++++-------
 sys/miscfs/fdesc/fdesc_vnops.c                          |   6 +++---
 sys/miscfs/genfs/layer_subr.c                           |   6 +++---
 sys/miscfs/kernfs/kernfs_subr.c                         |   6 +++---
 sys/miscfs/procfs/procfs_subr.c                         |   6 +++---
 sys/miscfs/syncfs/sync_subr.c                           |   7 +++----
 sys/nfs/nfs_node.c                                      |   6 +++---
 sys/nfs/nfs_vfsops.c                                    |   6 +++---
 sys/rump/librump/rumpvfs/rumpfs.c                       |   6 +++---
 sys/ufs/ext2fs/ext2fs_vfsops.c                          |   8 ++++----
 sys/ufs/ffs/ffs_vfsops.c                                |  10 +++++-----
 sys/ufs/lfs/lfs_segment.c                               |   6 +++---
 sys/ufs/ufs/ufs_ihash.c                                 |   6 +++---
 sys/ufs/ufs/ufs_quota.c                                 |  10 +++++-----
 35 files changed, 115 insertions(+), 117 deletions(-)

diffs (truncated from 1031 to 300 lines):

diff -r 0c29389588a8 -r 1cb375ecd858 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c   Wed Jul 21 17:23:08 2010 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c   Wed Jul 21 17:52:09 2010 +0000
@@ -207,7 +207,7 @@
                }
                vmark(mvp, vp);
                mutex_exit(&mntvnode_lock);
-               error = vget(vp, LK_EXCLUSIVE | LK_INTERLOCK);
+               error = vget(vp, LK_EXCLUSIVE);
                if (error) {
                        mutex_enter(&mntvnode_lock);
                        nvp = vunmark(mvp);
diff -r 0c29389588a8 -r 1cb375ecd858 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c    Wed Jul 21 17:23:08 2010 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c    Wed Jul 21 17:52:09 2010 +0000
@@ -949,7 +949,7 @@
                        if ((vp = ZTOV(zp)) != NULL) {
                                mutex_enter(&vp->v_interlock);
                                mutex_exit(&zp->z_lock);
-                               if (vget(vp, LK_INTERLOCK) != 0) {
+                               if (vget(vp, 0) != 0) {
                                        dmu_buf_rele(db, NULL);
                                        mutex_exit(&vp->v_interlock);
                                        goto again;
diff -r 0c29389588a8 -r 1cb375ecd858 sys/fs/adosfs/adutil.c
--- a/sys/fs/adosfs/adutil.c    Wed Jul 21 17:23:08 2010 +0000
+++ b/sys/fs/adosfs/adutil.c    Wed Jul 21 17:52:09 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: adutil.c,v 1.12 2010/07/01 13:00:55 hannken Exp $      */
+/*     $NetBSD: adutil.c,v 1.13 2010/07/21 17:52:09 hannken Exp $      */
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adutil.c,v 1.12 2010/07/01 13:00:55 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adutil.c,v 1.13 2010/07/21 17:52:09 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/vnode.h>
@@ -70,7 +70,7 @@
                        vp = ATOV(ap);
                        mutex_enter(&vp->v_interlock);
                        simple_unlock(&adosfs_hashlock);
-                       if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK))
+                       if (vget(vp, LK_EXCLUSIVE))
                                goto start_over;
                        return (ATOV(ap));
                }
diff -r 0c29389588a8 -r 1cb375ecd858 sys/fs/cd9660/cd9660_node.c
--- a/sys/fs/cd9660/cd9660_node.c       Wed Jul 21 17:23:08 2010 +0000
+++ b/sys/fs/cd9660/cd9660_node.c       Wed Jul 21 17:52:09 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd9660_node.c,v 1.26 2010/07/01 13:00:55 hannken Exp $ */
+/*     $NetBSD: cd9660_node.c,v 1.27 2010/07/21 17:52:09 hannken Exp $ */
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1994
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd9660_node.c,v 1.26 2010/07/01 13:00:55 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd9660_node.c,v 1.27 2010/07/21 17:52:09 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -151,7 +151,7 @@
                        } else {
                                mutex_enter(&vp->v_interlock);
                                mutex_exit(&cd9660_ihash_lock);
-                               if (vget(vp, flags | LK_INTERLOCK))
+                               if (vget(vp, flags))
                                        goto loop;
                        }
                        return (vp);
diff -r 0c29389588a8 -r 1cb375ecd858 sys/fs/efs/efs_ihash.c
--- a/sys/fs/efs/efs_ihash.c    Wed Jul 21 17:23:08 2010 +0000
+++ b/sys/fs/efs/efs_ihash.c    Wed Jul 21 17:52:09 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: efs_ihash.c,v 1.5 2010/07/01 13:00:55 hannken Exp $    */
+/*     $NetBSD: efs_ihash.c,v 1.6 2010/07/21 17:52:09 hannken Exp $    */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: efs_ihash.c,v 1.5 2010/07/01 13:00:55 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: efs_ihash.c,v 1.6 2010/07/21 17:52:09 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -146,7 +146,7 @@
                        } else {
                                mutex_enter(&vp->v_interlock);
                                mutex_exit(&efs_ihash_lock);
-                               if (vget(vp, flags | LK_INTERLOCK))
+                               if (vget(vp, flags))
                                        goto loop;
                        }
                        return (vp);
diff -r 0c29389588a8 -r 1cb375ecd858 sys/fs/filecorefs/filecore_node.c
--- a/sys/fs/filecorefs/filecore_node.c Wed Jul 21 17:23:08 2010 +0000
+++ b/sys/fs/filecorefs/filecore_node.c Wed Jul 21 17:52:09 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: filecore_node.c,v 1.21 2010/07/01 13:00:55 hannken Exp $       */
+/*     $NetBSD: filecore_node.c,v 1.22 2010/07/21 17:52:09 hannken Exp $       */
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1994
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: filecore_node.c,v 1.21 2010/07/01 13:00:55 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: filecore_node.c,v 1.22 2010/07/21 17:52:09 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -174,7 +174,7 @@
                        vp = ITOV(ip);
                        mutex_enter(&vp->v_interlock);
                        simple_unlock(&filecore_ihash_slock);
-                       if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK))
+                       if (vget(vp, LK_EXCLUSIVE))
                                goto loop;
                        return (vp);
                }
diff -r 0c29389588a8 -r 1cb375ecd858 sys/fs/hfs/hfs_nhash.c
--- a/sys/fs/hfs/hfs_nhash.c    Wed Jul 21 17:23:08 2010 +0000
+++ b/sys/fs/hfs/hfs_nhash.c    Wed Jul 21 17:52:09 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hfs_nhash.c,v 1.10 2010/07/01 13:00:55 hannken Exp $   */
+/*     $NetBSD: hfs_nhash.c,v 1.11 2010/07/21 17:52:10 hannken Exp $   */
 
 /*-
  * Copyright (c) 2005, 2007 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hfs_nhash.c,v 1.10 2010/07/01 13:00:55 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hfs_nhash.c,v 1.11 2010/07/21 17:52:10 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -131,7 +131,7 @@
                        } else {
                                mutex_enter(&vp->v_interlock);
                                mutex_exit(&hfs_nhash_lock);
-                               if (vget(vp, flags | LK_INTERLOCK))
+                               if (vget(vp, flags))
                                        goto loop;
                        }
                        return vp;
diff -r 0c29389588a8 -r 1cb375ecd858 sys/fs/msdosfs/msdosfs_denode.c
--- a/sys/fs/msdosfs/msdosfs_denode.c   Wed Jul 21 17:23:08 2010 +0000
+++ b/sys/fs/msdosfs/msdosfs_denode.c   Wed Jul 21 17:52:09 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msdosfs_denode.c,v 1.39 2010/06/24 13:03:09 hannken Exp $      */
+/*     $NetBSD: msdosfs_denode.c,v 1.40 2010/07/21 17:52:10 hannken Exp $      */
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_denode.c,v 1.39 2010/06/24 13:03:09 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_denode.c,v 1.40 2010/07/21 17:52:10 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -173,7 +173,7 @@
                        } else {
                                mutex_enter(&vp->v_interlock);
                                mutex_exit(&msdosfs_ihash_lock);
-                               if (vget(vp, flags | LK_INTERLOCK))
+                               if (vget(vp, flags))
                                        goto loop;
                        }
                        return (dep);
diff -r 0c29389588a8 -r 1cb375ecd858 sys/fs/msdosfs/msdosfs_vfsops.c
--- a/sys/fs/msdosfs/msdosfs_vfsops.c   Wed Jul 21 17:23:08 2010 +0000
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c   Wed Jul 21 17:52:09 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msdosfs_vfsops.c,v 1.86 2010/06/24 13:03:09 hannken Exp $      */
+/*     $NetBSD: msdosfs_vfsops.c,v 1.87 2010/07/21 17:52:10 hannken Exp $      */
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.86 2010/06/24 13:03:09 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.87 2010/07/21 17:52:10 hannken Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -962,9 +962,9 @@
         * threads waiting on fstrans may have locked vnodes.
         */
        if (is_suspending)
-               lk_flags = LK_INTERLOCK;
+               lk_flags = 0;
        else
-               lk_flags = LK_INTERLOCK | LK_EXCLUSIVE | LK_NOWAIT;
+               lk_flags = LK_EXCLUSIVE | LK_NOWAIT;
        /*
         * Write back each (modified) denode.
         */
diff -r 0c29389588a8 -r 1cb375ecd858 sys/fs/nilfs/nilfs_subr.c
--- a/sys/fs/nilfs/nilfs_subr.c Wed Jul 21 17:23:08 2010 +0000
+++ b/sys/fs/nilfs/nilfs_subr.c Wed Jul 21 17:52:09 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nilfs_subr.c,v 1.5 2010/06/24 12:15:46 reinoud Exp $ */
+/* $NetBSD: nilfs_subr.c,v 1.6 2010/07/21 17:52:10 hannken Exp $ */
 
 /*
  * Copyright (c) 2008, 2009 Reinoud Zandijk
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: nilfs_subr.c,v 1.5 2010/06/24 12:15:46 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nilfs_subr.c,v 1.6 2010/07/21 17:52:10 hannken Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -784,7 +784,7 @@
                        assert(vp);
                        mutex_enter(&vp->v_interlock);
                        mutex_exit(&ump->ihash_lock);
-                       if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK))
+                       if (vget(vp, LK_EXCLUSIVE))
                                goto loop;
                        return node;
                }
diff -r 0c29389588a8 -r 1cb375ecd858 sys/fs/ntfs/ntfs_vfsops.c
--- a/sys/fs/ntfs/ntfs_vfsops.c Wed Jul 21 17:23:08 2010 +0000
+++ b/sys/fs/ntfs/ntfs_vfsops.c Wed Jul 21 17:52:09 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntfs_vfsops.c,v 1.83 2010/07/19 08:17:44 hannken Exp $ */
+/*     $NetBSD: ntfs_vfsops.c,v 1.84 2010/07/21 17:52:10 hannken Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999 Semen Ustimenko
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.83 2010/07/19 08:17:44 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.84 2010/07/21 17:52:10 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -785,7 +785,7 @@
        if (vp) {
                mutex_enter(&vp->v_interlock);
                ntfs_ntput(ip);
-               if (vget(vp, LK_INTERLOCK | lkflags) != 0)
+               if (vget(vp, lkflags) != 0)
                        goto loop;
                *vpp = vp;
                return 0;
diff -r 0c29389588a8 -r 1cb375ecd858 sys/fs/ptyfs/ptyfs_subr.c
--- a/sys/fs/ptyfs/ptyfs_subr.c Wed Jul 21 17:23:08 2010 +0000
+++ b/sys/fs/ptyfs/ptyfs_subr.c Wed Jul 21 17:52:09 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ptyfs_subr.c,v 1.20 2010/07/01 13:00:55 hannken Exp $  */
+/*     $NetBSD: ptyfs_subr.c,v 1.21 2010/07/21 17:52:10 hannken Exp $  */
 
 /*
  * Copyright (c) 1993
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ptyfs_subr.c,v 1.20 2010/07/01 13:00:55 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ptyfs_subr.c,v 1.21 2010/07/21 17:52:10 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -369,7 +369,7 @@
                        } else {
                                mutex_enter(&vp->v_interlock);
                                mutex_exit(&ptyfs_used_slock);
-                               if (vget(vp, flags | LK_INTERLOCK))
+                               if (vget(vp, flags))
                                        goto loop;
                        }
                        return vp;
diff -r 0c29389588a8 -r 1cb375ecd858 sys/fs/puffs/puffs_node.c
--- a/sys/fs/puffs/puffs_node.c Wed Jul 21 17:23:08 2010 +0000
+++ b/sys/fs/puffs/puffs_node.c Wed Jul 21 17:52:09 2010 +0000



Home | Main Index | Thread Index | Old Index