diff options
-rw-r--r-- | sys/coda/coda_vfsops.c | 7 | ||||
-rw-r--r-- | sys/contrib/softupdates/ffs_softdep.c | 3 | ||||
-rw-r--r-- | sys/fs/coda/coda_vfsops.c | 7 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vfsops.c | 2 | ||||
-rw-r--r-- | sys/gnu/ext2fs/ext2_vfsops.c | 2 | ||||
-rw-r--r-- | sys/gnu/fs/ext2fs/ext2_vfsops.c | 2 | ||||
-rw-r--r-- | sys/kern/init_main.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_shutdown.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_conf.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_export.c | 28 | ||||
-rw-r--r-- | sys/kern/vfs_extattr.c | 20 | ||||
-rw-r--r-- | sys/kern/vfs_mount.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 28 | ||||
-rw-r--r-- | sys/kern/vfs_syscalls.c | 20 | ||||
-rw-r--r-- | sys/miscfs/devfs/devfs_vfsops.c | 2 | ||||
-rw-r--r-- | sys/msdosfs/msdosfs_vfsops.c | 2 | ||||
-rw-r--r-- | sys/nfs/nfs_nqlease.c | 6 | ||||
-rw-r--r-- | sys/sys/mount.h | 4 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 3 | ||||
-rw-r--r-- | usr.sbin/pstat/pstat.c | 6 |
20 files changed, 71 insertions, 79 deletions
diff --git a/sys/coda/coda_vfsops.c b/sys/coda/coda_vfsops.c index 22808ed..229822a 100644 --- a/sys/coda/coda_vfsops.c +++ b/sys/coda/coda_vfsops.c @@ -507,10 +507,9 @@ getNewVnode(vpp) struct mount *devtomp(dev) dev_t dev; { - struct mount *mp, *nmp; - - for (mp = mountlist.cqh_first; mp != (void*)&mountlist; mp = nmp) { - nmp = mp->mnt_list.cqe_next; + struct mount *mp; + + TAILQ_FOREACH(mp, &mountlist, mnt_list) { if (((VFSTOUFS(mp))->um_dev == dev)) { /* mount corresponds to UFS and the device matches one we want */ return(mp); diff --git a/sys/contrib/softupdates/ffs_softdep.c b/sys/contrib/softupdates/ffs_softdep.c index 207f3ca..5d7f766 100644 --- a/sys/contrib/softupdates/ffs_softdep.c +++ b/sys/contrib/softupdates/ffs_softdep.c @@ -4363,8 +4363,7 @@ clear_inodedeps(p) * Ugly code to find mount point given pointer to superblock. */ fs = inodedep->id_fs; - for (mp = CIRCLEQ_FIRST(&mountlist); mp != (void *)&mountlist; - mp = CIRCLEQ_NEXT(mp, mnt_list)) + TAILQ_FOREACH(mp, &mountlist, mnt_list) if ((mp->mnt_flag & MNT_SOFTDEP) && fs == VFSTOUFS(mp)->um_fs) break; /* diff --git a/sys/fs/coda/coda_vfsops.c b/sys/fs/coda/coda_vfsops.c index 22808ed..229822a 100644 --- a/sys/fs/coda/coda_vfsops.c +++ b/sys/fs/coda/coda_vfsops.c @@ -507,10 +507,9 @@ getNewVnode(vpp) struct mount *devtomp(dev) dev_t dev; { - struct mount *mp, *nmp; - - for (mp = mountlist.cqh_first; mp != (void*)&mountlist; mp = nmp) { - nmp = mp->mnt_list.cqe_next; + struct mount *mp; + + TAILQ_FOREACH(mp, &mountlist, mnt_list) { if (((VFSTOUFS(mp))->um_dev == dev)) { /* mount corresponds to UFS and the device matches one we want */ return(mp); diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index efece99..5005de3 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -188,7 +188,7 @@ msdosfs_mountroot() return (error); } - CIRCLEQ_INSERT_TAIL(&mountlist, mp, mnt_list); + TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list); mp->mnt_vnodecovered = NULLVP; (void) copystr("/", mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size); diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c index daa7e05..30b5d45 100644 --- a/sys/gnu/ext2fs/ext2_vfsops.c +++ b/sys/gnu/ext2fs/ext2_vfsops.c @@ -144,7 +144,7 @@ ext2_mountroot() bsd_free(mp, M_MOUNT); return (error); } - CIRCLEQ_INSERT_HEAD(&mountlist, mp, mnt_list); + TAILQ_INSERT_HEAD(&mountlist, mp, mnt_list); mp->mnt_flag |= MNT_ROOTFS; mp->mnt_vnodecovered = NULLVP; ump = VFSTOUFS(mp); diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c index daa7e05..30b5d45 100644 --- a/sys/gnu/fs/ext2fs/ext2_vfsops.c +++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c @@ -144,7 +144,7 @@ ext2_mountroot() bsd_free(mp, M_MOUNT); return (error); } - CIRCLEQ_INSERT_HEAD(&mountlist, mp, mnt_list); + TAILQ_INSERT_HEAD(&mountlist, mp, mnt_list); mp->mnt_flag |= MNT_ROOTFS; mp->mnt_vnodecovered = NULLVP; ump = VFSTOUFS(mp); diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index ec9cf85..484cfa4 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -447,7 +447,7 @@ xxx_vfs_root_fdtab(dummy) register struct filedesc0 *fdp = &filedesc0; /* Get the vnode for '/'. Set fdp->fd_fd.fd_cdir to reference it. */ - if (VFS_ROOT(CIRCLEQ_FIRST(&mountlist), &rootvnode)) + if (VFS_ROOT(TAILQ_FIRST(&mountlist), &rootvnode)) panic("cannot find root vnode"); fdp->fd_fd.fd_cdir = rootvnode; VREF(fdp->fd_fd.fd_cdir); diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 7ee7cc6..cc7e9ff 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -229,7 +229,7 @@ boot(howto) if (((bp->b_flags&B_INVAL) == 0 && BUF_REFCNT(bp)) || ((bp->b_flags & (B_DELWRI|B_INVAL)) == B_DELWRI)) { if (bp->b_dev == NODEV) { - CIRCLEQ_REMOVE(&mountlist, + TAILQ_REMOVE(&mountlist, bp->b_vp->v_mount, mnt_list); continue; } diff --git a/sys/kern/vfs_conf.c b/sys/kern/vfs_conf.c index 8932e41..c2fa605 100644 --- a/sys/kern/vfs_conf.c +++ b/sys/kern/vfs_conf.c @@ -213,7 +213,7 @@ done: /* register with list of mounted filesystems */ simple_lock(&mountlist_slock); - CIRCLEQ_INSERT_HEAD(&mountlist, mp, mnt_list); + TAILQ_INSERT_HEAD(&mountlist, mp, mnt_list); simple_unlock(&mountlist_slock); /* sanity check system clock against root filesystem timestamp */ diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index 6d339cf..fc850ff 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -116,7 +116,7 @@ int vfs_ioopt = 0; SYSCTL_INT(_vfs, OID_AUTO, ioopt, CTLFLAG_RW, &vfs_ioopt, 0, ""); #endif -struct mntlist mountlist; /* mounted filesystem list */ +struct mntlist mountlist = TAILQ_HEAD_INITIALIZER(mountlist); /* mounted fs */ struct simplelock mountlist_slock; struct simplelock mntvnode_slock; int nfs_mount_type = -1; @@ -172,7 +172,6 @@ vntblinit() TAILQ_INIT(&vnode_free_list); TAILQ_INIT(&vnode_tobefree_list); simple_lock_init(&vnode_free_list_slock); - CIRCLEQ_INIT(&mountlist); vnode_zone = zinit("VNODE", sizeof (struct vnode), 0, 0, 5); /* * Initialize the filesystem syncer. @@ -315,7 +314,7 @@ vfs_getvfs(fsid) register struct mount *mp; simple_lock(&mountlist_slock); - CIRCLEQ_FOREACH(mp, &mountlist, mnt_list) { + TAILQ_FOREACH(mp, &mountlist, mnt_list) { if (mp->mnt_stat.f_fsid.val[0] == fsid->val[0] && mp->mnt_stat.f_fsid.val[1] == fsid->val[1]) { simple_unlock(&mountlist_slock); @@ -1973,9 +1972,9 @@ DB_SHOW_COMMAND(lockedvnodes, lockedvnodes) printf("Locked vnodes\n"); simple_lock(&mountlist_slock); - for (mp = CIRCLEQ_FIRST(&mountlist); mp != (void *)&mountlist; mp = nmp) { + for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { if (vfs_busy(mp, LK_NOWAIT, &mountlist_slock, p)) { - nmp = CIRCLEQ_NEXT(mp, mnt_list); + nmp = TAILQ_NEXT(mp, mnt_list); continue; } LIST_FOREACH(vp, &mp->mnt_vnodelist, v_mntvnodes) { @@ -1983,7 +1982,7 @@ DB_SHOW_COMMAND(lockedvnodes, lockedvnodes) vprint((char *)0, vp); } simple_lock(&mountlist_slock); - nmp = CIRCLEQ_NEXT(mp, mnt_list); + nmp = TAILQ_NEXT(mp, mnt_list); vfs_unbusy(mp, p); } simple_unlock(&mountlist_slock); @@ -2091,10 +2090,9 @@ sysctl_vnode SYSCTL_HANDLER_ARGS (numvnodes + KINFO_VNODESLOP) * (VPTRSZ + VNODESZ))); simple_lock(&mountlist_slock); - mp = CIRCLEQ_FIRST(&mountlist); - for (; mp != (void *)&mountlist; mp = nmp) { + for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { if (vfs_busy(mp, LK_NOWAIT, &mountlist_slock, p)) { - nmp = CIRCLEQ_NEXT(mp, mnt_list); + nmp = TAILQ_NEXT(mp, mnt_list); continue; } again: @@ -2120,7 +2118,7 @@ again: } simple_unlock(&mntvnode_slock); simple_lock(&mountlist_slock); - nmp = CIRCLEQ_NEXT(mp, mnt_list); + nmp = TAILQ_NEXT(mp, mnt_list); vfs_unbusy(mp, p); } simple_unlock(&mountlist_slock); @@ -2159,7 +2157,7 @@ vfs_mountedon(vp) void vfs_unmountall() { - struct mount *mp, *nmp; + struct mount *mp; struct proc *p; int error; @@ -2170,17 +2168,19 @@ vfs_unmountall() /* * Since this only runs when rebooting, it is not interlocked. */ - mp = CIRCLEQ_LAST(&mountlist); - for (; mp != (void *)&mountlist; mp = nmp) { - nmp = CIRCLEQ_PREV(mp, mnt_list); + while(!TAILQ_EMPTY(&mountlist)) { + mp = TAILQ_LAST(&mountlist, mntlist); error = dounmount(mp, MNT_FORCE, p); if (error) { + TAILQ_REMOVE(&mountlist, mp, mnt_list); printf("unmount of %s failed (", mp->mnt_stat.f_mntonname); if (error == EBUSY) printf("BUSY)\n"); else printf("%d)\n", error); + } else { + /* The unmount has removed mp from the mountlist */ } } } diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index e0045c1..4d5d394 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -331,7 +331,7 @@ update: vp->v_mountedhere = mp; simple_unlock(&vp->v_interlock); simple_lock(&mountlist_slock); - CIRCLEQ_INSERT_TAIL(&mountlist, mp, mnt_list); + TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list); simple_unlock(&mountlist_slock); checkdirs(vp); VOP_UNLOCK(vp, 0, p); @@ -494,7 +494,7 @@ dounmount(mp, flags, p) wakeup((caddr_t)mp); return (error); } - CIRCLEQ_REMOVE(&mountlist, mp, mnt_list); + TAILQ_REMOVE(&mountlist, mp, mnt_list); if ((coveredvp = mp->mnt_vnodecovered) != NULLVP) { coveredvp->v_mountedhere = (struct mount *)0; vrele(coveredvp); @@ -533,10 +533,9 @@ sync(p, uap) int asyncflag; simple_lock(&mountlist_slock); - mp = CIRCLEQ_FIRST(&mountlist); - for (; mp != (void *)&mountlist; mp = nmp) { + for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { if (vfs_busy(mp, LK_NOWAIT, &mountlist_slock, p)) { - nmp = CIRCLEQ_NEXT(mp, mnt_list); + nmp = TAILQ_NEXT(mp, mnt_list); continue; } if ((mp->mnt_flag & MNT_RDONLY) == 0) { @@ -548,7 +547,7 @@ sync(p, uap) mp->mnt_flag |= asyncflag; } simple_lock(&mountlist_slock); - nmp = CIRCLEQ_NEXT(mp, mnt_list); + nmp = TAILQ_NEXT(mp, mnt_list); vfs_unbusy(mp, p); } simple_unlock(&mountlist_slock); @@ -718,10 +717,9 @@ getfsstat(p, uap) sfsp = (caddr_t)SCARG(uap, buf); count = 0; simple_lock(&mountlist_slock); - mp = CIRCLEQ_FIRST(&mountlist); - for (; mp != (void *)&mountlist; mp = nmp) { + for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { if (vfs_busy(mp, LK_NOWAIT, &mountlist_slock, p)) { - nmp = CIRCLEQ_NEXT(mp, mnt_list); + nmp = TAILQ_NEXT(mp, mnt_list); continue; } if (sfsp && count < maxcount) { @@ -735,7 +733,7 @@ getfsstat(p, uap) (SCARG(uap, flags) & MNT_WAIT)) && (error = VFS_STATFS(mp, sp, p))) { simple_lock(&mountlist_slock); - nmp = CIRCLEQ_NEXT(mp, mnt_list); + nmp = TAILQ_NEXT(mp, mnt_list); vfs_unbusy(mp, p); continue; } @@ -749,7 +747,7 @@ getfsstat(p, uap) } count++; simple_lock(&mountlist_slock); - nmp = CIRCLEQ_NEXT(mp, mnt_list); + nmp = TAILQ_NEXT(mp, mnt_list); vfs_unbusy(mp, p); } simple_unlock(&mountlist_slock); diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 8932e41..c2fa605 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -213,7 +213,7 @@ done: /* register with list of mounted filesystems */ simple_lock(&mountlist_slock); - CIRCLEQ_INSERT_HEAD(&mountlist, mp, mnt_list); + TAILQ_INSERT_HEAD(&mountlist, mp, mnt_list); simple_unlock(&mountlist_slock); /* sanity check system clock against root filesystem timestamp */ diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 6d339cf..fc850ff 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -116,7 +116,7 @@ int vfs_ioopt = 0; SYSCTL_INT(_vfs, OID_AUTO, ioopt, CTLFLAG_RW, &vfs_ioopt, 0, ""); #endif -struct mntlist mountlist; /* mounted filesystem list */ +struct mntlist mountlist = TAILQ_HEAD_INITIALIZER(mountlist); /* mounted fs */ struct simplelock mountlist_slock; struct simplelock mntvnode_slock; int nfs_mount_type = -1; @@ -172,7 +172,6 @@ vntblinit() TAILQ_INIT(&vnode_free_list); TAILQ_INIT(&vnode_tobefree_list); simple_lock_init(&vnode_free_list_slock); - CIRCLEQ_INIT(&mountlist); vnode_zone = zinit("VNODE", sizeof (struct vnode), 0, 0, 5); /* * Initialize the filesystem syncer. @@ -315,7 +314,7 @@ vfs_getvfs(fsid) register struct mount *mp; simple_lock(&mountlist_slock); - CIRCLEQ_FOREACH(mp, &mountlist, mnt_list) { + TAILQ_FOREACH(mp, &mountlist, mnt_list) { if (mp->mnt_stat.f_fsid.val[0] == fsid->val[0] && mp->mnt_stat.f_fsid.val[1] == fsid->val[1]) { simple_unlock(&mountlist_slock); @@ -1973,9 +1972,9 @@ DB_SHOW_COMMAND(lockedvnodes, lockedvnodes) printf("Locked vnodes\n"); simple_lock(&mountlist_slock); - for (mp = CIRCLEQ_FIRST(&mountlist); mp != (void *)&mountlist; mp = nmp) { + for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { if (vfs_busy(mp, LK_NOWAIT, &mountlist_slock, p)) { - nmp = CIRCLEQ_NEXT(mp, mnt_list); + nmp = TAILQ_NEXT(mp, mnt_list); continue; } LIST_FOREACH(vp, &mp->mnt_vnodelist, v_mntvnodes) { @@ -1983,7 +1982,7 @@ DB_SHOW_COMMAND(lockedvnodes, lockedvnodes) vprint((char *)0, vp); } simple_lock(&mountlist_slock); - nmp = CIRCLEQ_NEXT(mp, mnt_list); + nmp = TAILQ_NEXT(mp, mnt_list); vfs_unbusy(mp, p); } simple_unlock(&mountlist_slock); @@ -2091,10 +2090,9 @@ sysctl_vnode SYSCTL_HANDLER_ARGS (numvnodes + KINFO_VNODESLOP) * (VPTRSZ + VNODESZ))); simple_lock(&mountlist_slock); - mp = CIRCLEQ_FIRST(&mountlist); - for (; mp != (void *)&mountlist; mp = nmp) { + for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { if (vfs_busy(mp, LK_NOWAIT, &mountlist_slock, p)) { - nmp = CIRCLEQ_NEXT(mp, mnt_list); + nmp = TAILQ_NEXT(mp, mnt_list); continue; } again: @@ -2120,7 +2118,7 @@ again: } simple_unlock(&mntvnode_slock); simple_lock(&mountlist_slock); - nmp = CIRCLEQ_NEXT(mp, mnt_list); + nmp = TAILQ_NEXT(mp, mnt_list); vfs_unbusy(mp, p); } simple_unlock(&mountlist_slock); @@ -2159,7 +2157,7 @@ vfs_mountedon(vp) void vfs_unmountall() { - struct mount *mp, *nmp; + struct mount *mp; struct proc *p; int error; @@ -2170,17 +2168,19 @@ vfs_unmountall() /* * Since this only runs when rebooting, it is not interlocked. */ - mp = CIRCLEQ_LAST(&mountlist); - for (; mp != (void *)&mountlist; mp = nmp) { - nmp = CIRCLEQ_PREV(mp, mnt_list); + while(!TAILQ_EMPTY(&mountlist)) { + mp = TAILQ_LAST(&mountlist, mntlist); error = dounmount(mp, MNT_FORCE, p); if (error) { + TAILQ_REMOVE(&mountlist, mp, mnt_list); printf("unmount of %s failed (", mp->mnt_stat.f_mntonname); if (error == EBUSY) printf("BUSY)\n"); else printf("%d)\n", error); + } else { + /* The unmount has removed mp from the mountlist */ } } } diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index e0045c1..4d5d394 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -331,7 +331,7 @@ update: vp->v_mountedhere = mp; simple_unlock(&vp->v_interlock); simple_lock(&mountlist_slock); - CIRCLEQ_INSERT_TAIL(&mountlist, mp, mnt_list); + TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list); simple_unlock(&mountlist_slock); checkdirs(vp); VOP_UNLOCK(vp, 0, p); @@ -494,7 +494,7 @@ dounmount(mp, flags, p) wakeup((caddr_t)mp); return (error); } - CIRCLEQ_REMOVE(&mountlist, mp, mnt_list); + TAILQ_REMOVE(&mountlist, mp, mnt_list); if ((coveredvp = mp->mnt_vnodecovered) != NULLVP) { coveredvp->v_mountedhere = (struct mount *)0; vrele(coveredvp); @@ -533,10 +533,9 @@ sync(p, uap) int asyncflag; simple_lock(&mountlist_slock); - mp = CIRCLEQ_FIRST(&mountlist); - for (; mp != (void *)&mountlist; mp = nmp) { + for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { if (vfs_busy(mp, LK_NOWAIT, &mountlist_slock, p)) { - nmp = CIRCLEQ_NEXT(mp, mnt_list); + nmp = TAILQ_NEXT(mp, mnt_list); continue; } if ((mp->mnt_flag & MNT_RDONLY) == 0) { @@ -548,7 +547,7 @@ sync(p, uap) mp->mnt_flag |= asyncflag; } simple_lock(&mountlist_slock); - nmp = CIRCLEQ_NEXT(mp, mnt_list); + nmp = TAILQ_NEXT(mp, mnt_list); vfs_unbusy(mp, p); } simple_unlock(&mountlist_slock); @@ -718,10 +717,9 @@ getfsstat(p, uap) sfsp = (caddr_t)SCARG(uap, buf); count = 0; simple_lock(&mountlist_slock); - mp = CIRCLEQ_FIRST(&mountlist); - for (; mp != (void *)&mountlist; mp = nmp) { + for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { if (vfs_busy(mp, LK_NOWAIT, &mountlist_slock, p)) { - nmp = CIRCLEQ_NEXT(mp, mnt_list); + nmp = TAILQ_NEXT(mp, mnt_list); continue; } if (sfsp && count < maxcount) { @@ -735,7 +733,7 @@ getfsstat(p, uap) (SCARG(uap, flags) & MNT_WAIT)) && (error = VFS_STATFS(mp, sp, p))) { simple_lock(&mountlist_slock); - nmp = CIRCLEQ_NEXT(mp, mnt_list); + nmp = TAILQ_NEXT(mp, mnt_list); vfs_unbusy(mp, p); continue; } @@ -749,7 +747,7 @@ getfsstat(p, uap) } count++; simple_lock(&mountlist_slock); - nmp = CIRCLEQ_NEXT(mp, mnt_list); + nmp = TAILQ_NEXT(mp, mnt_list); vfs_unbusy(mp, p); } simple_unlock(&mountlist_slock); diff --git a/sys/miscfs/devfs/devfs_vfsops.c b/sys/miscfs/devfs/devfs_vfsops.c index 264f049..287ca99 100644 --- a/sys/miscfs/devfs/devfs_vfsops.c +++ b/sys/miscfs/devfs/devfs_vfsops.c @@ -67,7 +67,7 @@ devfs_init(struct vfsconf *vfsp) /* Mark a reference for the "invisible" blueprint mount */ mp->mnt_vfc->vfc_refcount++; - CIRCLEQ_INSERT_TAIL(&mountlist, mp, mnt_list); + TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list); printf("DEVFS: ready to run\n"); return 0; /*XXX*/ diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c index efece99..5005de3 100644 --- a/sys/msdosfs/msdosfs_vfsops.c +++ b/sys/msdosfs/msdosfs_vfsops.c @@ -188,7 +188,7 @@ msdosfs_mountroot() return (error); } - CIRCLEQ_INSERT_TAIL(&mountlist, mp, mnt_list); + TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list); mp->mnt_vnodecovered = NULLVP; (void) copystr("/", mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size); diff --git a/sys/nfs/nfs_nqlease.c b/sys/nfs/nfs_nqlease.c index 3f78fb8..e64a82a 100644 --- a/sys/nfs/nfs_nqlease.c +++ b/sys/nfs/nfs_nqlease.c @@ -1216,9 +1216,9 @@ nqnfs_lease_updatetime(deltat) * queues. */ simple_lock(&mountlist_slock); - for (mp = mountlist.cqh_first; mp != (void *)&mountlist; mp = nxtmp) { + for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nxtmp) { if (vfs_busy(mp, LK_NOWAIT, &mountlist_slock, p)) { - nxtmp = mp->mnt_list.cqe_next; + nxtmp = TAILQ_NEXT(mp, mnt_list); continue; } if (mp->mnt_stat.f_type == nfs_mount_type) { @@ -1232,7 +1232,7 @@ nqnfs_lease_updatetime(deltat) } } simple_lock(&mountlist_slock); - nxtmp = mp->mnt_list.cqe_next; + nxtmp = TAILQ_NEXT(mp, mnt_list); vfs_unbusy(mp, p); } simple_unlock(&mountlist_slock); diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 4d6764d..25c5956 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -97,7 +97,7 @@ struct statfs { LIST_HEAD(vnodelst, vnode); struct mount { - CIRCLEQ_ENTRY(mount) mnt_list; /* mount list */ + TAILQ_ENTRY(mount) mnt_list; /* mount list */ struct vfsops *mnt_op; /* operations on fs */ struct vfsconf *mnt_vfc; /* configuration info */ struct vnode *mnt_vnodecovered; /* vnode we mounted on */ @@ -403,7 +403,7 @@ void vfs_unbusy __P((struct mount *, struct proc *)); void vfs_unmountall __P((void)); int vfs_register __P((struct vfsconf *)); int vfs_unregister __P((struct vfsconf *)); -extern CIRCLEQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */ +extern TAILQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */ extern struct simplelock mountlist_slock; extern struct nfs_public nfs_pub; diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 207f3ca..5d7f766 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -4363,8 +4363,7 @@ clear_inodedeps(p) * Ugly code to find mount point given pointer to superblock. */ fs = inodedep->id_fs; - for (mp = CIRCLEQ_FIRST(&mountlist); mp != (void *)&mountlist; - mp = CIRCLEQ_NEXT(mp, mnt_list)) + TAILQ_FOREACH(mp, &mountlist, mnt_list) if ((mp->mnt_flag & MNT_SOFTDEP) && fs == VFSTOUFS(mp)->um_fs) break; /* diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c index f76a94c..24fb157 100644 --- a/usr.sbin/pstat/pstat.c +++ b/usr.sbin/pstat/pstat.c @@ -677,9 +677,9 @@ kinfo_vnodes(avnodes) bp = vbuf; evbuf = vbuf + (numvnodes + 20) * (VPTRSZ + VNODESZ); KGET(V_MOUNTLIST, mountlist); - for (num = 0, mp = mountlist.cqh_first; ; mp = mp_next) { + for (num = 0, mp = TAILQ_FIRST(&mountlist); ; mp = mp_next) { KGET2(mp, &mount, sizeof(mount), "mount entry"); - mp_next = mount.mnt_list.cqe_next; + mp_next = TAILQ_NEXT(&mount, mnt_list); for (vp = mount.mnt_vnodelist.lh_first; vp != NULL; vp = vp_next) { KGET2(vp, &vnode, sizeof(vnode), "vnode"); @@ -693,7 +693,7 @@ kinfo_vnodes(avnodes) bp += VNODESZ; num++; } - if (mp == mountlist.cqh_last) + if (mp == TAILQ_LAST(&mountlist, mntlist)) break; } *avnodes = num; |