Date: Tue, 11 Mar 2003 14:31:47 -0800 (PST) From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 26727 for review Message-ID: <200303112231.h2BMVlsc090983@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=26727 Change 26727 by jhb@jhb_laptop on 2003/03/11 14:31:27 IFC @26726 (more of my own changes) Affected files ... .. //depot/projects/smpng/sys/dev/hifn/hifn7751.c#5 integrate .. //depot/projects/smpng/sys/fs/devfs/devfs_vfsops.c#11 integrate .. //depot/projects/smpng/sys/fs/fdescfs/fdesc_vfsops.c#9 integrate .. //depot/projects/smpng/sys/fs/hpfs/hpfs_vfsops.c#17 integrate .. //depot/projects/smpng/sys/fs/ntfs/ntfs_vfsops.c#16 integrate .. //depot/projects/smpng/sys/fs/nwfs/nwfs_vfsops.c#10 integrate .. //depot/projects/smpng/sys/fs/portalfs/portal_vfsops.c#10 integrate .. //depot/projects/smpng/sys/fs/pseudofs/pseudofs.h#17 integrate .. //depot/projects/smpng/sys/fs/smbfs/smbfs_vfsops.c#16 integrate .. //depot/projects/smpng/sys/fs/udf/udf_vfsops.c#7 integrate .. //depot/projects/smpng/sys/fs/umapfs/umap_vfsops.c#13 integrate .. //depot/projects/smpng/sys/fs/unionfs/union_vfsops.c#15 integrate .. //depot/projects/smpng/sys/isofs/cd9660/cd9660_vfsops.c#19 integrate .. //depot/projects/smpng/sys/kern/subr_witness.c#93 integrate .. //depot/projects/smpng/sys/kern/vfs_default.c#16 integrate .. //depot/projects/smpng/sys/sys/mount.h#20 integrate Differences ... ==== //depot/projects/smpng/sys/dev/hifn/hifn7751.c#5 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/hifn/hifn7751.c,v 1.10 2003/02/19 05:47:05 imp Exp $ */ +/* $FreeBSD: src/sys/dev/hifn/hifn7751.c,v 1.12 2003/03/11 22:23:19 sam Exp $ */ /* $OpenBSD: hifn7751.c,v 1.120 2002/05/17 00:33:34 deraadt Exp $ */ /* ==== //depot/projects/smpng/sys/fs/devfs/devfs_vfsops.c#11 (text+ko) ==== @@ -31,7 +31,7 @@ * @(#)kernfs_vfsops.c 8.10 (Berkeley) 5/14/95 * From: FreeBSD: src/sys/miscfs/kernfs/kernfs_vfsops.c 1.36 * - * $FreeBSD: src/sys/fs/devfs/devfs_vfsops.c,v 1.29 2003/02/19 05:47:17 imp Exp $ + * $FreeBSD: src/sys/fs/devfs/devfs_vfsops.c,v 1.30 2003/03/11 22:15:08 kan Exp $ */ #include "opt_devfs.h" @@ -194,7 +194,7 @@ devfs_root, vfs_stdquotactl, devfs_statfs, - vfs_stdsync, + vfs_stdnosync, vfs_stdvget, vfs_stdfhtovp, vfs_stdcheckexp, ==== //depot/projects/smpng/sys/fs/fdescfs/fdesc_vfsops.c#9 (text+ko) ==== @@ -35,7 +35,7 @@ * * @(#)fdesc_vfsops.c 8.4 (Berkeley) 1/21/94 * - * $FreeBSD: src/sys/fs/fdescfs/fdesc_vfsops.c,v 1.38 2003/02/19 05:47:17 imp Exp $ + * $FreeBSD: src/sys/fs/fdescfs/fdesc_vfsops.c,v 1.39 2003/03/11 22:15:08 kan Exp $ */ /* @@ -213,7 +213,7 @@ fdesc_root, vfs_stdquotactl, fdesc_statfs, - vfs_stdsync, + vfs_stdnosync, vfs_stdvget, vfs_stdfhtovp, vfs_stdcheckexp, ==== //depot/projects/smpng/sys/fs/hpfs/hpfs_vfsops.c#17 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/fs/hpfs/hpfs_vfsops.c,v 1.32 2003/02/19 05:47:17 imp Exp $ + * $FreeBSD: src/sys/fs/hpfs/hpfs_vfsops.c,v 1.33 2003/03/11 22:15:08 kan Exp $ */ @@ -577,7 +577,7 @@ hpfs_root, vfs_stdquotactl, hpfs_statfs, - vfs_stdsync, + vfs_stdnosync, hpfs_vget, hpfs_fhtovp, vfs_stdcheckexp, ==== //depot/projects/smpng/sys/fs/ntfs/ntfs_vfsops.c#16 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/fs/ntfs/ntfs_vfsops.c,v 1.52 2003/02/19 05:47:18 imp Exp $ + * $FreeBSD: src/sys/fs/ntfs/ntfs_vfsops.c,v 1.53 2003/03/11 22:15:08 kan Exp $ */ @@ -781,7 +781,7 @@ ntfs_root, vfs_stdquotactl, ntfs_statfs, - vfs_stdsync, + vfs_stdnosync, ntfs_vget, ntfs_fhtovp, vfs_stdcheckexp, ==== //depot/projects/smpng/sys/fs/nwfs/nwfs_vfsops.c#10 (text+ko) ==== @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/fs/nwfs/nwfs_vfsops.c,v 1.27 2003/02/19 05:47:18 imp Exp $ + * $FreeBSD: src/sys/fs/nwfs/nwfs_vfsops.c,v 1.28 2003/03/11 22:15:09 kan Exp $ */ #include "opt_ncp.h" #ifndef NCP @@ -76,7 +76,6 @@ static int nwfs_root(struct mount *, struct vnode **); static int nwfs_start(struct mount *, int, struct thread *); static int nwfs_statfs(struct mount *, struct statfs *, struct thread *); -static int nwfs_sync(struct mount *, int, struct ucred *, struct thread *); static int nwfs_unmount(struct mount *, int, struct thread *); static int nwfs_init(struct vfsconf *vfsp); static int nwfs_uninit(struct vfsconf *vfsp); @@ -88,7 +87,7 @@ nwfs_root, nwfs_quotactl, nwfs_statfs, - nwfs_sync, + vfs_stdsync, vfs_stdvget, vfs_stdfhtovp, /* shouldn't happen */ vfs_stdcheckexp, @@ -460,53 +459,3 @@ strncpy(sbp->f_fstypename, mp->mnt_vfc->vfc_name, MFSNAMELEN); return 0; } - -/* - * Flush out the buffer cache - */ -/* ARGSUSED */ -static int -nwfs_sync(mp, waitfor, cred, td) - struct mount *mp; - int waitfor; - struct ucred *cred; - struct thread *td; -{ - struct vnode *vp, *nvp; - int error, allerror = 0; - /* - * Force stale buffer cache information to be flushed. - */ - mtx_lock(&mntvnode_mtx); -loop: - for (vp = TAILQ_FIRST(&mp->mnt_nvnodelist); - vp != NULL; - vp = nvp) { - /* - * If the vnode that we are about to sync is no longer - * associated with this mount point, start over. - */ - if (vp->v_mount != mp) - goto loop; - nvp = TAILQ_NEXT(vp, v_nmntvnodes); - mtx_unlock(&mntvnode_mtx); - VI_LOCK(vp); - if (VOP_ISLOCKED(vp, NULL) || TAILQ_EMPTY(&vp->v_dirtyblkhd) || - waitfor == MNT_LAZY) { - VI_UNLOCK(vp); - mtx_lock(&mntvnode_mtx); - continue; - } - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) { - mtx_lock(&mntvnode_mtx); - goto loop; - } - error = VOP_FSYNC(vp, cred, waitfor, td); - if (error) - allerror = error; - vput(vp); - mtx_lock(&mntvnode_mtx); - } - mtx_unlock(&mntvnode_mtx); - return (allerror); -} ==== //depot/projects/smpng/sys/fs/portalfs/portal_vfsops.c#10 (text+ko) ==== @@ -35,7 +35,7 @@ * * @(#)portal_vfsops.c 8.11 (Berkeley) 5/14/95 * - * $FreeBSD: src/sys/fs/portalfs/portal_vfsops.c,v 1.45 2003/02/19 05:47:19 imp Exp $ + * $FreeBSD: src/sys/fs/portalfs/portal_vfsops.c,v 1.46 2003/03/11 22:15:09 kan Exp $ */ /* @@ -249,7 +249,7 @@ portal_root, vfs_stdquotactl, portal_statfs, - vfs_stdsync, + vfs_stdnosync, vfs_stdvget, vfs_stdfhtovp, vfs_stdcheckexp, ==== //depot/projects/smpng/sys/fs/pseudofs/pseudofs.h#17 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/fs/pseudofs/pseudofs.h,v 1.23 2003/03/02 22:23:45 des Exp $ + * $FreeBSD: src/sys/fs/pseudofs/pseudofs.h,v 1.24 2003/03/11 22:15:09 kan Exp $ */ #ifndef _PSEUDOFS_H_INCLUDED @@ -256,7 +256,7 @@ pfs_root, \ vfs_stdquotactl, \ pfs_statfs, \ - vfs_stdsync, \ + vfs_stdnosync, \ vfs_stdvget, \ vfs_stdfhtovp, \ vfs_stdcheckexp, \ ==== //depot/projects/smpng/sys/fs/smbfs/smbfs_vfsops.c#16 (text+ko) ==== @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/fs/smbfs/smbfs_vfsops.c,v 1.16 2003/03/06 10:38:18 tjr Exp $ + * $FreeBSD: src/sys/fs/smbfs/smbfs_vfsops.c,v 1.17 2003/03/11 22:15:09 kan Exp $ */ #include "opt_netsmb.h" #ifndef NETSMB @@ -83,7 +83,6 @@ static int smbfs_root(struct mount *, struct vnode **); static int smbfs_start(struct mount *, int, struct thread *); static int smbfs_statfs(struct mount *, struct statfs *, struct thread *); -static int smbfs_sync(struct mount *, int, struct ucred *, struct thread *); static int smbfs_unmount(struct mount *, int, struct thread *); static int smbfs_init(struct vfsconf *vfsp); static int smbfs_uninit(struct vfsconf *vfsp); @@ -95,7 +94,7 @@ smbfs_root, smbfs_quotactl, smbfs_statfs, - smbfs_sync, + vfs_stdsync, vfs_stdvget, vfs_stdfhtovp, /* shouldn't happen */ vfs_stdcheckexp, @@ -401,46 +400,3 @@ strncpy(sbp->f_fstypename, mp->mnt_vfc->vfc_name, MFSNAMELEN); return 0; } - -/* - * Flush out the buffer cache - */ -/* ARGSUSED */ -static int -smbfs_sync(mp, waitfor, cred, td) - struct mount *mp; - int waitfor; - struct ucred *cred; - struct thread *td; -{ - struct vnode *vp; - int error, allerror = 0; - /* - * Force stale buffer cache information to be flushed. - */ -loop: - for (vp = TAILQ_FIRST(&mp->mnt_nvnodelist); - vp != NULL; - vp = TAILQ_NEXT(vp, v_nmntvnodes)) { - /* - * If the vnode that we are about to sync is no longer - * associated with this mount point, start over. - */ - if (vp->v_mount != mp) - goto loop; - VI_LOCK(vp); - if (VOP_ISLOCKED(vp, NULL) || TAILQ_EMPTY(&vp->v_dirtyblkhd) || - waitfor == MNT_LAZY) { - VI_UNLOCK(vp); - continue; - } - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) - goto loop; - error = VOP_FSYNC(vp, cred, waitfor, td); - if (error) - allerror = error; - vput(vp); - } - return (allerror); -} - ==== //depot/projects/smpng/sys/fs/udf/udf_vfsops.c#7 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/fs/udf/udf_vfsops.c,v 1.9 2003/02/19 05:47:19 imp Exp $ + * $FreeBSD: src/sys/fs/udf/udf_vfsops.c,v 1.10 2003/03/11 22:15:09 kan Exp $ */ /* udf_vfsops.c */ @@ -119,7 +119,7 @@ udf_root, vfs_stdquotactl, udf_statfs, - vfs_stdsync, + vfs_stdnosync, udf_vget, udf_fhtovp, vfs_stdcheckexp, ==== //depot/projects/smpng/sys/fs/umapfs/umap_vfsops.c#13 (text+ko) ==== @@ -35,7 +35,7 @@ * * @(#)umap_vfsops.c 8.8 (Berkeley) 5/14/95 * - * $FreeBSD: src/sys/fs/umapfs/umap_vfsops.c,v 1.52 2003/02/19 05:47:19 imp Exp $ + * $FreeBSD: src/sys/fs/umapfs/umap_vfsops.c,v 1.53 2003/03/11 22:15:09 kan Exp $ */ /* @@ -443,7 +443,7 @@ umapfs_root, umapfs_quotactl, umapfs_statfs, - vfs_stdsync, + vfs_stdnosync, umapfs_vget, umapfs_fhtovp, umapfs_checkexp, ==== //depot/projects/smpng/sys/fs/unionfs/union_vfsops.c#15 (text+ko) ==== @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_vfsops.c 8.20 (Berkeley) 5/20/95 - * $FreeBSD: src/sys/fs/unionfs/union_vfsops.c,v 1.60 2003/02/19 05:47:19 imp Exp $ + * $FreeBSD: src/sys/fs/unionfs/union_vfsops.c,v 1.61 2003/03/11 22:15:09 kan Exp $ */ /* @@ -502,7 +502,7 @@ union_root, vfs_stdquotactl, union_statfs, - vfs_stdsync, /* XXX assumes no cached data on union level */ + vfs_stdnosync, /* XXX assumes no cached data on union level */ vfs_stdvget, vfs_stdfhtovp, vfs_stdcheckexp, ==== //depot/projects/smpng/sys/isofs/cd9660/cd9660_vfsops.c#19 (text+ko) ==== @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vfsops.c 8.18 (Berkeley) 5/22/95 - * $FreeBSD: src/sys/isofs/cd9660/cd9660_vfsops.c,v 1.108 2003/02/19 05:47:24 imp Exp $ + * $FreeBSD: src/sys/isofs/cd9660/cd9660_vfsops.c,v 1.109 2003/03/11 22:15:09 kan Exp $ */ #include <sys/param.h> @@ -79,7 +79,7 @@ cd9660_root, vfs_stdquotactl, cd9660_statfs, - vfs_stdsync, + vfs_stdnosync, cd9660_vget, cd9660_fhtovp, vfs_stdcheckexp, ==== //depot/projects/smpng/sys/kern/subr_witness.c#93 (text+ko) ==== @@ -27,7 +27,7 @@ * * from BSDI $Id: mutex_witness.c,v 1.1.2.20 2000/04/27 03:10:27 cp Exp $ * and BSDI $Id: synch_machdep.c,v 2.3.2.39 2000/04/27 03:10:25 cp Exp $ - * $FreeBSD: src/sys/kern/subr_witness.c,v 1.142 2003/03/10 17:03:57 jhb Exp $ + * $FreeBSD: src/sys/kern/subr_witness.c,v 1.147 2003/03/11 22:14:21 jhb Exp $ */ /* @@ -1175,7 +1175,6 @@ return (rebalancetree(list)); } - /* * Prune an entire lock order tree. We look for cases where a lock * is now both a descendant and a direct child of a given lock. In ==== //depot/projects/smpng/sys/kern/vfs_default.c#16 (text+ko) ==== @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * - * $FreeBSD: src/sys/kern/vfs_default.c,v 1.77 2003/03/10 21:55:00 kan Exp $ + * $FreeBSD: src/sys/kern/vfs_default.c,v 1.78 2003/03/11 22:15:10 kan Exp $ */ #include <sys/param.h> @@ -879,7 +879,62 @@ } int -vfs_stdsync (mp, waitfor, cred, td) +vfs_stdsync(mp, waitfor, cred, td) + struct mount *mp; + int waitfor; + struct ucred *cred; + struct thread *td; +{ + struct vnode *vp, *nvp; + int error, lockreq, allerror = 0; + + lockreq = LK_EXCLUSIVE | LK_INTERLOCK; + if (waitfor != MNT_WAIT) + lockreq |= LK_NOWAIT; + /* + * Force stale buffer cache information to be flushed. + */ + mtx_lock(&mntvnode_mtx); +loop: + for (vp = TAILQ_FIRST(&mp->mnt_nvnodelist); vp != NULL; vp = nvp) { + /* + * If the vnode that we are about to sync is no longer + * associated with this mount point, start over. + */ + if (vp->v_mount != mp) + goto loop; + + nvp = TAILQ_NEXT(vp, v_nmntvnodes); + + VI_LOCK(vp); + if (TAILQ_EMPTY(&vp->v_dirtyblkhd)) { + VI_UNLOCK(vp); + continue; + } + mtx_unlock(&mntvnode_mtx); + + if ((error = vget(vp, lockreq, td)) != 0) { + if (error == ENOENT) + goto loop; + continue; + } + error = VOP_FSYNC(vp, cred, waitfor, td); + if (error) + allerror = error; + + mtx_lock(&mntvnode_mtx); + if (nvp != TAILQ_NEXT(vp, v_nmntvnodes)) { + vput(vp); + goto loop; + } + vput(vp); + } + mtx_unlock(&mntvnode_mtx); + return (allerror); +} + +int +vfs_stdnosync (mp, waitfor, cred, td) struct mount *mp; int waitfor; struct ucred *cred; ==== //depot/projects/smpng/sys/sys/mount.h#20 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)mount.h 8.21 (Berkeley) 5/20/95 - * $FreeBSD: src/sys/sys/mount.h,v 1.145 2003/03/10 21:55:00 kan Exp $ + * $FreeBSD: src/sys/sys/mount.h,v 1.146 2003/03/11 22:15:10 kan Exp $ */ #ifndef _SYS_MOUNT_H_ @@ -499,6 +499,7 @@ vfs_quotactl_t vfs_stdquotactl; vfs_statfs_t vfs_stdstatfs; vfs_sync_t vfs_stdsync; +vfs_sync_t vfs_stdnosync; vfs_vget_t vfs_stdvget; vfs_fhtovp_t vfs_stdfhtovp; vfs_checkexp_t vfs_stdcheckexp; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303112231.h2BMVlsc090983>