Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys change the mountlist CIRCLEQ into a TAILQ
details: https://anonhg.NetBSD.org/src/rev/8bcfd93dd624
branches: trunk
changeset: 791550:8bcfd93dd624
user: christos <christos%NetBSD.org@localhost>
date: Sat Nov 23 13:35:36 2013 +0000
description:
change the mountlist CIRCLEQ into a TAILQ
diffstat:
sys/compat/common/vfs_syscalls_20.c | 6 ++--
sys/fs/cd9660/cd9660_vfsops.c | 8 ++---
sys/fs/filecorefs/filecore_vfsops.c | 8 ++---
sys/fs/msdosfs/msdosfs_vfsops.c | 8 ++---
sys/fs/ntfs/ntfs_vfsops.c | 8 ++---
sys/fs/v7fs/v7fs_vfsops.c | 8 ++---
sys/kern/kern_verifiedexec.c | 8 ++--
sys/kern/vfs_mount.c | 51 +++++++++++++++++++++---------------
sys/kern/vfs_subr.c | 8 ++--
sys/kern/vfs_syscalls.c | 8 ++--
sys/kern/vfs_trans.c | 6 ++--
sys/miscfs/procfs/procfs_linux.c | 6 ++--
sys/nfs/nfs_vfsops.c | 8 ++---
sys/rump/librump/rumpvfs/rumpfs.c | 8 ++---
sys/sys/mount.h | 7 ++--
sys/ufs/ext2fs/ext2fs_vfsops.c | 8 ++---
sys/ufs/ffs/ffs_vfsops.c | 8 ++---
sys/ufs/lfs/lfs_bio.c | 6 ++--
sys/ufs/lfs/lfs_vfsops.c | 10 ++----
sys/ufs/mfs/mfs_vfsops.c | 8 ++---
20 files changed, 91 insertions(+), 105 deletions(-)
diffs (truncated from 747 to 300 lines):
diff -r e8104dfb7cb1 -r 8bcfd93dd624 sys/compat/common/vfs_syscalls_20.c
--- a/sys/compat/common/vfs_syscalls_20.c Sat Nov 23 12:41:13 2013 +0000
+++ b/sys/compat/common/vfs_syscalls_20.c Sat Nov 23 13:35:36 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_syscalls_20.c,v 1.35 2010/06/24 13:03:06 hannken Exp $ */
+/* $NetBSD: vfs_syscalls_20.c,v 1.36 2013/11/23 13:35:36 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.35 2010/06/24 13:03:06 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.36 2013/11/23 13:35:36 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -214,7 +214,7 @@
sfsp = SCARG(uap, buf);
mutex_enter(&mountlist_lock);
count = 0;
- for (mp = CIRCLEQ_FIRST(&mountlist); mp != (void *)&mountlist;
+ for (mp = TAILQ_FIRST(&mountlist); mp != TAILQ_END(&mountlist);
mp = nmp) {
if (vfs_busy(mp, &nmp)) {
continue;
diff -r e8104dfb7cb1 -r 8bcfd93dd624 sys/fs/cd9660/cd9660_vfsops.c
--- a/sys/fs/cd9660/cd9660_vfsops.c Sat Nov 23 12:41:13 2013 +0000
+++ b/sys/fs/cd9660/cd9660_vfsops.c Sat Nov 23 13:35:36 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cd9660_vfsops.c,v 1.79 2013/09/30 18:57:59 hannken Exp $ */
+/* $NetBSD: cd9660_vfsops.c,v 1.80 2013/11/23 13:35:36 christos Exp $ */
/*-
* Copyright (c) 1994
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.79 2013/09/30 18:57:59 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.80 2013/11/23 13:35:36 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -202,9 +202,7 @@
vfs_destroy(mp);
return (error);
}
- mutex_enter(&mountlist_lock);
- CIRCLEQ_INSERT_TAIL(&mountlist, mp, mnt_list);
- mutex_exit(&mountlist_lock);
+ mountlist_append(mp);
(void)cd9660_statvfs(mp, &mp->mnt_stat);
vfs_unbusy(mp, false, NULL);
return (0);
diff -r e8104dfb7cb1 -r 8bcfd93dd624 sys/fs/filecorefs/filecore_vfsops.c
--- a/sys/fs/filecorefs/filecore_vfsops.c Sat Nov 23 12:41:13 2013 +0000
+++ b/sys/fs/filecorefs/filecore_vfsops.c Sat Nov 23 13:35:36 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: filecore_vfsops.c,v 1.71 2013/09/30 18:57:59 hannken Exp $ */
+/* $NetBSD: filecore_vfsops.c,v 1.72 2013/11/23 13:35:36 christos Exp $ */
/*-
* Copyright (c) 1994 The Regents of the University of California.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: filecore_vfsops.c,v 1.71 2013/09/30 18:57:59 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: filecore_vfsops.c,v 1.72 2013/11/23 13:35:36 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -216,9 +216,7 @@
vfs_destroy(mp);
return (error);
}
- mutex_enter(&mountlist_lock);
- CIRCLEQ_INSERT_TAIL(&mountlist, mp, mnt_list);
- mutex_exit(&mountlist_lock);
+ mountlist_append(mp);
(void)filecore_statvfs(mp, &mp->mnt_stat, p);
vfs_unbusy(mp, false, NULL);
return (0);
diff -r e8104dfb7cb1 -r 8bcfd93dd624 sys/fs/msdosfs/msdosfs_vfsops.c
--- a/sys/fs/msdosfs/msdosfs_vfsops.c Sat Nov 23 12:41:13 2013 +0000
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c Sat Nov 23 13:35:36 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_vfsops.c,v 1.102 2013/09/30 18:57:59 hannken Exp $ */
+/* $NetBSD: msdosfs_vfsops.c,v 1.103 2013/11/23 13:35:36 christos 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.102 2013/09/30 18:57:59 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.103 2013/11/23 13:35:36 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -269,9 +269,7 @@
return (error);
}
- mutex_enter(&mountlist_lock);
- CIRCLEQ_INSERT_TAIL(&mountlist, mp, mnt_list);
- mutex_exit(&mountlist_lock);
+ mountlist_append(mp);
(void)msdosfs_statvfs(mp, &mp->mnt_stat);
vfs_unbusy(mp, false, NULL);
return (0);
diff -r e8104dfb7cb1 -r 8bcfd93dd624 sys/fs/ntfs/ntfs_vfsops.c
--- a/sys/fs/ntfs/ntfs_vfsops.c Sat Nov 23 12:41:13 2013 +0000
+++ b/sys/fs/ntfs/ntfs_vfsops.c Sat Nov 23 13:35:36 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntfs_vfsops.c,v 1.89 2013/10/17 21:04:12 christos Exp $ */
+/* $NetBSD: ntfs_vfsops.c,v 1.90 2013/11/23 13:35:36 christos Exp $ */
/*-
* Copyright (c) 1998, 1999 Semen Ustimenko
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.89 2013/10/17 21:04:12 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.90 2013/11/23 13:35:36 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -118,9 +118,7 @@
return (error);
}
- mutex_enter(&mountlist_lock);
- CIRCLEQ_INSERT_TAIL(&mountlist, mp, mnt_list);
- mutex_exit(&mountlist_lock);
+ mountlist_append(mp);
(void)ntfs_statvfs(mp, &mp->mnt_stat);
vfs_unbusy(mp, false, NULL);
return (0);
diff -r e8104dfb7cb1 -r 8bcfd93dd624 sys/fs/v7fs/v7fs_vfsops.c
--- a/sys/fs/v7fs/v7fs_vfsops.c Sat Nov 23 12:41:13 2013 +0000
+++ b/sys/fs/v7fs/v7fs_vfsops.c Sat Nov 23 13:35:36 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: v7fs_vfsops.c,v 1.8 2013/11/20 23:44:23 rmind Exp $ */
+/* $NetBSD: v7fs_vfsops.c,v 1.9 2013/11/23 13:35:36 christos Exp $ */
/*-
* Copyright (c) 2004, 2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: v7fs_vfsops.c,v 1.8 2013/11/20 23:44:23 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: v7fs_vfsops.c,v 1.9 2013/11/23 13:35:36 christos Exp $");
#if defined _KERNEL_OPT
#include "opt_v7fs.h"
#endif
@@ -578,9 +578,7 @@
return error;
}
- mutex_enter(&mountlist_lock);
- CIRCLEQ_INSERT_TAIL(&mountlist, mp, mnt_list);
- mutex_exit(&mountlist_lock);
+ mountlist_append(mp);
vfs_unbusy(mp, false, NULL);
diff -r e8104dfb7cb1 -r 8bcfd93dd624 sys/kern/kern_verifiedexec.c
--- a/sys/kern/kern_verifiedexec.c Sat Nov 23 12:41:13 2013 +0000
+++ b/sys/kern/kern_verifiedexec.c Sat Nov 23 13:35:36 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_verifiedexec.c,v 1.129 2012/03/13 18:40:52 elad Exp $ */
+/* $NetBSD: kern_verifiedexec.c,v 1.130 2013/11/23 13:35:36 christos Exp $ */
/*-
* Copyright (c) 2005, 2006 Elad Efrat <elad%NetBSD.org@localhost>
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_verifiedexec.c,v 1.129 2012/03/13 18:40:52 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_verifiedexec.c,v 1.130 2013/11/23 13:35:36 christos Exp $");
#include "opt_veriexec.h"
@@ -1552,7 +1552,7 @@
struct mount *mp, *nmp;
mutex_enter(&mountlist_lock);
- for (mp = CIRCLEQ_FIRST(&mountlist); mp != (void *)&mountlist;
+ for (mp = TAILQ_FIRST(&mountlist); mp != TAILQ_END(&mountlist);
mp = nmp) {
/* If it fails, the file-system is [being] unmounted. */
if (vfs_busy(mp, &nmp) != 0)
@@ -1575,7 +1575,7 @@
int error = 0;
mutex_enter(&mountlist_lock);
- for (mp = CIRCLEQ_FIRST(&mountlist); mp != (void *)&mountlist;
+ for (mp = TAILQ_FIRST(&mountlist); mp != TAILQ_END(&mountlist);
mp = nmp) {
int lerror;
diff -r e8104dfb7cb1 -r 8bcfd93dd624 sys/kern/vfs_mount.c
--- a/sys/kern/vfs_mount.c Sat Nov 23 12:41:13 2013 +0000
+++ b/sys/kern/vfs_mount.c Sat Nov 23 13:35:36 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_mount.c,v 1.23 2013/10/29 09:53:51 hannken Exp $ */
+/* $NetBSD: vfs_mount.c,v 1.24 2013/11/23 13:35:36 christos Exp $ */
/*-
* Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.23 2013/10/29 09:53:51 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.24 2013/11/23 13:35:36 christos Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -115,7 +115,7 @@
vfs_mount_sysinit(void)
{
- CIRCLEQ_INIT(&mountlist);
+ TAILQ_INIT(&mountlist);
mutex_init(&mountlist_lock, MUTEX_DEFAULT, IPL_NONE);
mutex_init(&mntvnode_lock, MUTEX_DEFAULT, IPL_NONE);
mutex_init(&vfs_list_lock, MUTEX_DEFAULT, IPL_NONE);
@@ -213,7 +213,7 @@
++xxxfs_mntid;
tfsid.__fsid_val[0] = makedev(mtype & 0xff, xxxfs_mntid);
tfsid.__fsid_val[1] = mtype;
- if (!CIRCLEQ_EMPTY(&mountlist)) {
+ if (!TAILQ_EMPTY(&mountlist)) {
while (vfs_getvfs(&tfsid)) {
tfsid.__fsid_val[0]++;
xxxfs_mntid++;
@@ -235,7 +235,7 @@
struct mount *mp;
mutex_enter(&mountlist_lock);
- CIRCLEQ_FOREACH(mp, &mountlist, mnt_list) {
+ TAILQ_FOREACH(mp, &mountlist, mnt_list) {
if (mp->mnt_stat.f_fsidx.__fsid_val[0] == fsid->__fsid_val[0] &&
mp->mnt_stat.f_fsidx.__fsid_val[1] == fsid->__fsid_val[1]) {
mutex_exit(&mountlist_lock);
@@ -293,7 +293,7 @@
mutex_exit(&mp->mnt_unmounting);
if (nextp != NULL) {
KASSERT(mutex_owned(&mountlist_lock));
- *nextp = CIRCLEQ_NEXT(mp, mnt_list);
+ *nextp = TAILQ_NEXT(mp, mnt_list);
}
return ENOENT;
}
@@ -333,7 +333,7 @@
}
if (nextp != NULL) {
KASSERT(mutex_owned(&mountlist_lock));
- *nextp = CIRCLEQ_NEXT(mp, mnt_list);
+ *nextp = TAILQ_NEXT(mp, mnt_list);
}
}
@@ -455,7 +455,8 @@
* and vclean() are called.
*/
mutex_enter(&mntvnode_lock);
- for (vp = TAILQ_FIRST(&mp->mnt_vnodelist); vp != NULL;
+ for (vp = TAILQ_FIRST(&mp->mnt_vnodelist);
+ vp != TAILQ_END(&mp->mnt_nodelist);
vp = vflushnext(mvp, &when)) {
vmark(mvp, vp);
if (vp->v_mount != mp || vismarker(vp))
@@ -533,8 +534,7 @@
retry:
mutex_enter(&mntvnode_lock);
- for (vp = TAILQ_FIRST(&mp->mnt_vnodelist); vp; vp = nvp) {
- nvp = TAILQ_NEXT(vp, v_mntvnodes);
+ TAILQ_FOREACH_SAFE(vp, &mp->mnt_vnodelist, v_mntvnodes, nvp) {
mutex_enter(vp->v_interlock);
if ((vp->v_iflag & VI_CLEAN) != 0) {
TAILQ_REMOVE(&mp->mnt_vnodelist, vp, v_mntvnodes);
@@ -708,7 +708,7 @@
mp->mnt_iflag &= ~IMNT_WANTRDWR;
mutex_enter(&mountlist_lock);
- CIRCLEQ_INSERT_TAIL(&mountlist, mp, mnt_list);
+ TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list);
mutex_exit(&mountlist_lock);
if ((mp->mnt_flag & (MNT_RDONLY | MNT_ASYNC)) == 0)
error = vfs_allocate_syncvnode(mp);
Home |
Main Index |
Thread Index |
Old Index