diff options
author | Nikolay Sturm <sturm@cvs.openbsd.org> | 2006-04-30 14:20:09 +0000 |
---|---|---|
committer | Nikolay Sturm <sturm@cvs.openbsd.org> | 2006-04-30 14:20:09 +0000 |
commit | a4cb7d48e5f539c9c6c8918d25916b5fac8dcd8a (patch) | |
tree | f86b662368f0d39c80089283db45fbc7db35c09f /sys | |
parent | dba3801a71db41c05ec0bfd759e004548d5e3eca (diff) |
remove the simplelock argument from vfs_busy() which is currently not
used and will never be used this way in VFS
requested by and ok pedro, ok krw, biorn
Diffstat (limited to 'sys')
-rw-r--r-- | sys/compat/common/vfs_syscalls_25.c | 4 | ||||
-rw-r--r-- | sys/compat/freebsd/freebsd_file.c | 4 | ||||
-rw-r--r-- | sys/compat/netbsd/netbsd_file.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_lookup.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 18 | ||||
-rw-r--r-- | sys/kern/vfs_sync.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_syscalls.c | 14 | ||||
-rw-r--r-- | sys/nfs/nfs_syscalls.c | 4 | ||||
-rw-r--r-- | sys/sys/mount.h | 4 | ||||
-rw-r--r-- | sys/ufs/mfs/mfs_vfsops.c | 4 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_quota.c | 4 | ||||
-rw-r--r-- | sys/xfs/xfs_config.h | 5 | ||||
-rw-r--r-- | sys/xfs/xfs_dev-common.c | 5 |
13 files changed, 41 insertions, 37 deletions
diff --git a/sys/compat/common/vfs_syscalls_25.c b/sys/compat/common/vfs_syscalls_25.c index 5f4d658ca67..58cab278b23 100644 --- a/sys/compat/common/vfs_syscalls_25.c +++ b/sys/compat/common/vfs_syscalls_25.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls_25.c,v 1.9 2006/04/19 11:55:55 pedro Exp $ */ +/* $OpenBSD: vfs_syscalls_25.c,v 1.10 2006/04/30 14:20:07 sturm Exp $ */ /* * Copyright (c) 1989, 1993 @@ -181,7 +181,7 @@ compat_25_sys_getfsstat(p, v, retval) for (mp = CIRCLEQ_FIRST(&mountlist); mp != CIRCLEQ_END(&mountlist); mp = nmp) { - if (vfs_busy(mp, LK_NOWAIT, NULL)) { + if (vfs_busy(mp, LK_NOWAIT)) { nmp = CIRCLEQ_NEXT(mp, mnt_list); continue; } diff --git a/sys/compat/freebsd/freebsd_file.c b/sys/compat/freebsd/freebsd_file.c index 73c80db1954..89ac1fcc0b2 100644 --- a/sys/compat/freebsd/freebsd_file.c +++ b/sys/compat/freebsd/freebsd_file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: freebsd_file.c,v 1.22 2006/04/19 11:55:55 pedro Exp $ */ +/* $OpenBSD: freebsd_file.c,v 1.23 2006/04/30 14:20:07 sturm Exp $ */ /* $NetBSD: freebsd_file.c,v 1.3 1996/05/03 17:03:09 christos Exp $ */ /* @@ -660,7 +660,7 @@ freebsd_sys_getfsstat(p, v, retval) for (mp = CIRCLEQ_FIRST(&mountlist); mp != CIRCLEQ_END(&mountlist); mp = nmp) { - if (vfs_busy(mp, LK_NOWAIT, NULL)) { + if (vfs_busy(mp, LK_NOWAIT)) { nmp = CIRCLEQ_NEXT(mp, mnt_list); continue; } diff --git a/sys/compat/netbsd/netbsd_file.c b/sys/compat/netbsd/netbsd_file.c index 7a935798b6a..f02653634b1 100644 --- a/sys/compat/netbsd/netbsd_file.c +++ b/sys/compat/netbsd/netbsd_file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netbsd_file.c,v 1.8 2006/04/19 11:55:55 pedro Exp $ */ +/* $OpenBSD: netbsd_file.c,v 1.9 2006/04/30 14:20:07 sturm Exp $ */ /* $NetBSD: freebsd_file.c,v 1.3 1996/05/03 17:03:09 christos Exp $ */ /* @@ -634,7 +634,7 @@ netbsd_sys_getfsstat(p, v, retval) for (mp = CIRCLEQ_FIRST(&mountlist); mp != CIRCLEQ_END(&mountlist); mp = nmp) { - if (vfs_busy(mp, LK_NOWAIT, NULL)) { + if (vfs_busy(mp, LK_NOWAIT)) { nmp = CIRCLEQ_NEXT(mp, mnt_list); continue; } diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 756b532bceb..37b2ffe0fe8 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_lookup.c,v 1.31 2005/11/30 10:35:07 pedro Exp $ */ +/* $OpenBSD: vfs_lookup.c,v 1.32 2006/04/30 14:20:07 sturm Exp $ */ /* $NetBSD: vfs_lookup.c,v 1.17 1996/02/09 19:00:59 christos Exp $ */ /* @@ -513,7 +513,7 @@ dirloop: */ while (dp->v_type == VDIR && (mp = dp->v_mountedhere) && (cnp->cn_flags & NOCROSSMOUNT) == 0) { - if (vfs_busy(mp, 0, NULL)) + if (vfs_busy(mp, 0)) continue; VOP_UNLOCK(dp, 0, p); error = VFS_ROOT(mp, &tdp); diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index ffb178d5a3a..1f2220da18c 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_subr.c,v 1.123 2006/04/19 11:55:55 pedro Exp $ */ +/* $OpenBSD: vfs_subr.c,v 1.124 2006/04/30 14:20:07 sturm Exp $ */ /* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */ /* @@ -152,7 +152,7 @@ vntblinit(void) * fail. */ int -vfs_busy(struct mount *mp, int flags, struct simplelock *interlkp) +vfs_busy(struct mount *mp, int flags) { int lkflags; @@ -173,9 +173,7 @@ vfs_busy(struct mount *mp, int flags, struct simplelock *interlkp) */ lkflags |= LK_SLEEPFAIL; - if (interlkp) - lkflags |= LK_INTERLOCK; - if (lockmgr(&mp->mnt_lock, lkflags, interlkp)) + if (lockmgr(&mp->mnt_lock, lkflags, NULL)) return (ENOENT); return (0); } @@ -215,7 +213,7 @@ vfs_rootmountalloc(char *fstypename, char *devname, struct mount **mpp) mp = malloc((u_long)sizeof(struct mount), M_MOUNT, M_WAITOK); bzero((char *)mp, (u_long)sizeof(struct mount)); lockinit(&mp->mnt_lock, PVFS, "vfslock", 0, 0); - (void)vfs_busy(mp, LK_NOWAIT, NULL); + (void)vfs_busy(mp, LK_NOWAIT); LIST_INIT(&mp->mnt_vnodelist); mp->mnt_vfc = vfsp; mp->mnt_op = vfsp->vfc_vfsops; @@ -1166,7 +1164,7 @@ vgonel(struct vnode *vp, struct proc *p) */ mp = vp->v_specmountpoint; if (mp != NULL) { - if (!vfs_busy(mp, LK_EXCLUSIVE, NULL)) { + if (!vfs_busy(mp, LK_EXCLUSIVE)) { flags = MNT_FORCE | MNT_DOOMED; dounmount(mp, flags, p, NULL); } @@ -1333,7 +1331,7 @@ printlockedvnodes(void) for (mp = CIRCLEQ_FIRST(&mountlist); mp != CIRCLEQ_END(&mountlist); mp = nmp) { - if (vfs_busy(mp, LK_NOWAIT, NULL)) { + if (vfs_busy(mp, LK_NOWAIT)) { nmp = CIRCLEQ_NEXT(mp, mnt_list); continue; } @@ -1411,7 +1409,7 @@ sysctl_vnode(char *where, size_t *sizep, struct proc *p) for (mp = CIRCLEQ_FIRST(&mountlist); mp != CIRCLEQ_END(&mountlist); mp = nmp) { - if (vfs_busy(mp, LK_NOWAIT, NULL)) { + if (vfs_busy(mp, LK_NOWAIT)) { nmp = CIRCLEQ_NEXT(mp, mnt_list); continue; } @@ -1712,7 +1710,7 @@ vfs_unmountall(void) for (mp = CIRCLEQ_LAST(&mountlist); mp != CIRCLEQ_END(&mountlist); mp = nmp) { nmp = CIRCLEQ_PREV(mp, mnt_list); - if ((vfs_busy(mp, LK_EXCLUSIVE|LK_NOWAIT, NULL)) != 0) + if ((vfs_busy(mp, LK_EXCLUSIVE|LK_NOWAIT)) != 0) continue; if ((error = dounmount(mp, MNT_FORCE, curproc, NULL)) != 0) { printf("unmount of %s failed with error %d\n", diff --git a/sys/kern/vfs_sync.c b/sys/kern/vfs_sync.c index 89367839c17..6068ff5473e 100644 --- a/sys/kern/vfs_sync.c +++ b/sys/kern/vfs_sync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_sync.c,v 1.38 2006/04/19 11:55:55 pedro Exp $ */ +/* $OpenBSD: vfs_sync.c,v 1.39 2006/04/30 14:20:07 sturm Exp $ */ /* * Portions of this code are: @@ -353,7 +353,7 @@ sync_fsync(void *v) * Walk the list of vnodes pushing all that are dirty and * not already on the sync list. */ - if (vfs_busy(mp, LK_NOWAIT, NULL) == 0) { + if (vfs_busy(mp, LK_NOWAIT) == 0) { asyncflag = mp->mnt_flag & MNT_ASYNC; mp->mnt_flag &= ~MNT_ASYNC; VFS_SYNC(mp, MNT_LAZY, ap->a_cred, ap->a_p); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index ce7965e8ac0..40f6ddc223d 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls.c,v 1.133 2006/04/19 11:55:55 pedro Exp $ */ +/* $OpenBSD: vfs_syscalls.c,v 1.134 2006/04/30 14:20:07 sturm Exp $ */ /* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */ /* @@ -150,7 +150,7 @@ sys_mount(struct proc *p, void *v, register_t *retval) if (flag & MNT_NOEXEC) SCARG(uap, flags) |= MNT_NOEXEC; } - if ((error = vfs_busy(mp, LK_NOWAIT, NULL)) != 0) { + if ((error = vfs_busy(mp, LK_NOWAIT)) != 0) { vput(vp); return (error); } @@ -238,7 +238,7 @@ sys_mount(struct proc *p, void *v, register_t *retval) bzero((char *)mp, (u_long)sizeof(struct mount)); lockinit(&mp->mnt_lock, PVFS, "vfslock", 0, 0); /* This error never happens, but it makes auditing easier */ - if ((error = vfs_busy(mp, LK_NOWAIT, NULL))) + if ((error = vfs_busy(mp, LK_NOWAIT))) return (error); mp->mnt_op = vfsp->vfc_vfsops; mp->mnt_vfc = vfsp; @@ -405,7 +405,7 @@ sys_unmount(struct proc *p, void *v, register_t *retval) } vput(vp); - if (vfs_busy(mp, LK_EXCLUSIVE, NULL)) + if (vfs_busy(mp, LK_EXCLUSIVE)) return (EBUSY); return (dounmount(mp, SCARG(uap, flags), p, vp)); @@ -474,7 +474,7 @@ sys_sync(struct proc *p, void *v, register_t *retval) for (mp = CIRCLEQ_LAST(&mountlist); mp != CIRCLEQ_END(&mountlist); mp = nmp) { - if (vfs_busy(mp, LK_NOWAIT, NULL)) { + if (vfs_busy(mp, LK_NOWAIT)) { nmp = CIRCLEQ_PREV(mp, mnt_list); continue; } @@ -629,7 +629,7 @@ sys_getfsstat(struct proc *p, void *v, register_t *retval) for (mp = CIRCLEQ_FIRST(&mountlist); mp != CIRCLEQ_END(&mountlist); mp = nmp) { - if (vfs_busy(mp, LK_NOWAIT, NULL)) { + if (vfs_busy(mp, LK_NOWAIT)) { nmp = CIRCLEQ_NEXT(mp, mnt_list); continue; } @@ -705,7 +705,7 @@ sys_fchdir(struct proc *p, void *v, register_t *retval) error = VOP_ACCESS(vp, VEXEC, p->p_ucred, p); while (!error && (mp = vp->v_mountedhere) != NULL) { - if (vfs_busy(mp, 0, NULL)) + if (vfs_busy(mp, 0)) continue; error = VFS_ROOT(mp, &tdp); vfs_unbusy(mp); diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c index 0156eb77b0e..9ac032a6323 100644 --- a/sys/nfs/nfs_syscalls.c +++ b/sys/nfs/nfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_syscalls.c,v 1.45 2005/11/30 10:35:08 pedro Exp $ */ +/* $OpenBSD: nfs_syscalls.c,v 1.46 2006/04/30 14:20:07 sturm Exp $ */ /* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */ /* @@ -177,7 +177,7 @@ nfs_clientd(struct nfsmount *nmp, struct ucred *cred, struct nfsd_cargs *ncd, error = tsleep((caddr_t)&nmp->nm_authstr, PSOCK | PCATCH, "nqnfstimr", hz / 3); if (error == EINTR || error == ERESTART) { - if (vfs_busy(nmp->nm_mountp, LK_EXCLUSIVE, NULL) == 0) + if (vfs_busy(nmp->nm_mountp, LK_EXCLUSIVE) == 0) dounmount(nmp->nm_mountp, MNT_FORCE, p, NULL); } } diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 7cd03afc674..06a74848256 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mount.h,v 1.69 2006/04/19 11:55:55 pedro Exp $ */ +/* $OpenBSD: mount.h,v 1.70 2006/04/30 14:20:07 sturm Exp $ */ /* $NetBSD: mount.h,v 1.48 1996/02/18 11:55:47 fvdl Exp $ */ /* @@ -565,7 +565,7 @@ struct netexport { /* * exported vnode operations */ -int vfs_busy(struct mount *, int, struct simplelock *); +int vfs_busy(struct mount *, int); int vfs_isbusy(struct mount *); int vfs_mount_foreach_vnode(struct mount *, int (*func)(struct vnode *, void *), void *); diff --git a/sys/ufs/mfs/mfs_vfsops.c b/sys/ufs/mfs/mfs_vfsops.c index 6f4d3bbfc27..1b826228a1e 100644 --- a/sys/ufs/mfs/mfs_vfsops.c +++ b/sys/ufs/mfs/mfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfs_vfsops.c,v 1.31 2006/04/19 11:55:55 pedro Exp $ */ +/* $OpenBSD: mfs_vfsops.c,v 1.32 2006/04/30 14:20:08 sturm Exp $ */ /* $NetBSD: mfs_vfsops.c,v 1.10 1996/02/09 22:31:28 christos Exp $ */ /* @@ -263,7 +263,7 @@ mfs_start(struct mount *mp, int flags, struct proc *p) * EINTR/ERESTART. */ if (sleepreturn != 0) { - if (vfs_busy(mp, LK_EXCLUSIVE|LK_NOWAIT, NULL) || + if (vfs_busy(mp, LK_EXCLUSIVE|LK_NOWAIT) || dounmount(mp, 0, p, NULL)) CLRSIG(p, CURSIG(p)); sleepreturn = 0; diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c index a1413f7d5f7..3b00eddb730 100644 --- a/sys/ufs/ufs/ufs_quota.c +++ b/sys/ufs/ufs/ufs_quota.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_quota.c,v 1.22 2005/12/28 20:48:18 pedro Exp $ */ +/* $OpenBSD: ufs_quota.c,v 1.23 2006/04/30 14:20:08 sturm Exp $ */ /* $NetBSD: ufs_quota.c,v 1.8 1996/02/09 22:36:09 christos Exp $ */ /* @@ -1028,7 +1028,7 @@ ufs_quotactl(struct mount *mp, int cmds, uid_t uid, caddr_t arg, if ((u_int)type >= MAXQUOTAS) return (EINVAL); - if (vfs_busy(mp, LK_NOWAIT, NULL)) + if (vfs_busy(mp, LK_NOWAIT)) return (0); diff --git a/sys/xfs/xfs_config.h b/sys/xfs/xfs_config.h index 32e33f0ec59..28b1ffcc284 100644 --- a/sys/xfs/xfs_config.h +++ b/sys/xfs/xfs_config.h @@ -1260,7 +1260,7 @@ static /**/const char *const rcsid[] = { (const char *)rcsid, "@(#)" msg } /* #undef HAVE_THREE_ARGUMENT_SELRECORD */ /* define if vfs_busy takes three arguments */ -#define HAVE_THREE_ARGUMENT_VFS_BUSY 1 +/* #undef HAVE_THREE_ARGUMENT_VFS_BUSY */ /* define if vfs_name_hash takes three arguments */ /* #undef HAVE_THREE_ARGUMENT_VFS_NAME_HASH */ @@ -1289,6 +1289,9 @@ static /**/const char *const rcsid[] = { (const char *)rcsid, "@(#)" msg } /* define if vfs_getnewfsid takes two arguments */ /* #undef HAVE_TWO_ARGUMENT_VFS_GETNEWFSID */ +/* define if vfs_busy takes two arguments */ +#define HAVE_TWO_ARGUMENT_VFS_BUSY 1 + /* define if vget takes two arguments */ /* #undef HAVE_TWO_ARGUMENT_VGET */ diff --git a/sys/xfs/xfs_dev-common.c b/sys/xfs/xfs_dev-common.c index 774596dd1d5..533bcae5a02 100644 --- a/sys/xfs/xfs_dev-common.c +++ b/sys/xfs/xfs_dev-common.c @@ -113,7 +113,10 @@ xfs_devopen_common(dev_t dev) return 0; } -#if defined(HAVE_THREE_ARGUMENT_VFS_BUSY) +#if defined(HAVE_TWO_ARGUMENT_VFS_BUSY) +#define xfs_vfs_busy(mp, flags, lock, proc) vfs_busy((mp), (flags)) +#define xfs_vfs_unbusy(mp, proc) vfs_unbusy((mp)) +#elif defined(HAVE_THREE_ARGUMENT_VFS_BUSY) #define xfs_vfs_busy(mp, flags, lock, proc) vfs_busy((mp), (flags), (lock)) #define xfs_vfs_unbusy(mp, proc) vfs_unbusy((mp)) #elif defined(HAVE_FOUR_ARGUMENT_VFS_BUSY) |