diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2018-05-02 02:24:57 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2018-05-02 02:24:57 +0000 |
commit | 108f19d0ced75c574baf04aadc2461544271ab61 (patch) | |
tree | c74dd7b672cc03aff7b93052e639c38506a52563 /sys/ufs | |
parent | e04bdc4d8438d7c603ab1f98c7150e02c3c7e42c (diff) |
Remove proc from the parameters of vn_lock(). The parameter is
unnecessary because curproc always does the locking.
OK mpi@
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_lookup.c | 7 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_vfsops.c | 10 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_vnops.c | 10 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 6 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 14 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_lookup.c | 11 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_quota.c | 8 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 10 |
8 files changed, 34 insertions, 42 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_lookup.c b/sys/ufs/ext2fs/ext2fs_lookup.c index 6f90182b61b..a35b0b00aa4 100644 --- a/sys/ufs/ext2fs/ext2fs_lookup.c +++ b/sys/ufs/ext2fs/ext2fs_lookup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_lookup.c,v 1.43 2018/04/28 03:13:05 visa Exp $ */ +/* $OpenBSD: ext2fs_lookup.c,v 1.44 2018/05/02 02:24:56 visa Exp $ */ /* $NetBSD: ext2fs_lookup.c,v 1.16 2000/08/03 20:29:26 thorpej Exp $ */ /* @@ -249,7 +249,6 @@ ext2fs_lookup(void *v) struct ucred *cred = cnp->cn_cred; int flags = cnp->cn_flags; int nameiop = cnp->cn_nameiop; - struct proc *p = cnp->cn_proc; int dirblksize, entry_found = 0, error; ss.slotstatus = FOUND; @@ -568,12 +567,12 @@ found: VOP_UNLOCK(pdp); /* race to get the inode */ cnp->cn_flags |= PDIRUNLOCK; if ((error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp)) != 0) { - if (vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, p) == 0) + if (vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY) == 0) cnp->cn_flags &= ~PDIRUNLOCK; return (error); } if (lockparent && (flags & ISLASTCN)) { - if ((error = vn_lock(pdp, LK_EXCLUSIVE, p)) != 0) { + if ((error = vn_lock(pdp, LK_EXCLUSIVE)) != 0) { vput(tdp); return (error); } diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c index 754263e598d..1fa9ea224f6 100644 --- a/sys/ufs/ext2fs/ext2fs_vfsops.c +++ b/sys/ufs/ext2fs/ext2fs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_vfsops.c,v 1.105 2018/04/28 03:13:05 visa Exp $ */ +/* $OpenBSD: ext2fs_vfsops.c,v 1.106 2018/05/02 02:24:56 visa Exp $ */ /* $NetBSD: ext2fs_vfsops.c,v 1.1 1997/06/11 09:34:07 bouyer Exp $ */ /* @@ -570,7 +570,7 @@ out: devvp->v_specmountpoint = NULL; if (bp) brelse(bp); - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, cred, p); VOP_UNLOCK(devvp); if (ump) { @@ -609,7 +609,7 @@ ext2fs_unmount(struct mount *mp, int mntflags, struct proc *p) if (ump->um_devvp->v_type != VBAD) ump->um_devvp->v_specmountpoint = NULL; - vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); (void)VOP_CLOSE(ump->um_devvp, fs->e2fs_ronly ? FREAD : FREAD|FWRITE, NOCRED, p); vput(ump->um_devvp); @@ -639,7 +639,7 @@ ext2fs_flushfiles(struct mount *mp, int flags, struct proc *p) /* * Flush filesystem metadata. */ - vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_FSYNC(ump->um_devvp, p->p_ucred, MNT_WAIT, p); VOP_UNLOCK(ump->um_devvp); return (error); @@ -777,7 +777,7 @@ ext2fs_sync(struct mount *mp, int waitfor, int stall, * Force stale file system control information to be flushed. */ if (waitfor != MNT_LAZY) { - vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); if ((error = VOP_FSYNC(ump->um_devvp, cred, waitfor, p)) != 0) allerror = error; VOP_UNLOCK(ump->um_devvp); diff --git a/sys/ufs/ext2fs/ext2fs_vnops.c b/sys/ufs/ext2fs/ext2fs_vnops.c index f40cf7d5ff1..117576a12e6 100644 --- a/sys/ufs/ext2fs/ext2fs_vnops.c +++ b/sys/ufs/ext2fs/ext2fs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_vnops.c,v 1.80 2018/04/28 03:13:05 visa Exp $ */ +/* $OpenBSD: ext2fs_vnops.c,v 1.81 2018/05/02 02:24:56 visa Exp $ */ /* $NetBSD: ext2fs_vnops.c,v 1.1 1997/06/11 09:34:09 bouyer Exp $ */ /* @@ -432,7 +432,6 @@ ext2fs_link(void *v) struct vnode *dvp = ap->a_dvp; struct vnode *vp = ap->a_vp; struct componentname *cnp = ap->a_cnp; - struct proc *p = cnp->cn_proc; struct inode *ip; int error; @@ -450,7 +449,7 @@ ext2fs_link(void *v) error = EXDEV; goto out2; } - if (dvp != vp && (error = vn_lock(vp, LK_EXCLUSIVE, p))) { + if (dvp != vp && (error = vn_lock(vp, LK_EXCLUSIVE))) { VOP_ABORTOP(dvp, cnp); goto out2; } @@ -518,7 +517,6 @@ ext2fs_rename(void *v) struct componentname *tcnp = ap->a_tcnp; struct componentname *fcnp = ap->a_fcnp; struct inode *ip, *xp, *dp; - struct proc *p = fcnp->cn_proc; struct ext2fs_dirtemplate dirbuf; /* struct timespec ts; */ int doingdirectory = 0, oldparent = 0, newparent = 0; @@ -580,7 +578,7 @@ abortit: (void) vfs_relookup(fdvp, &fvp, fcnp); return (VOP_REMOVE(fdvp, fvp, fcnp)); } - if ((error = vn_lock(fvp, LK_EXCLUSIVE, p)) != 0) + if ((error = vn_lock(fvp, LK_EXCLUSIVE)) != 0) goto abortit; dp = VTOI(fdvp); ip = VTOI(fvp); @@ -874,7 +872,7 @@ bad: out: if (doingdirectory) ip->i_flag &= ~IN_RENAME; - if (vn_lock(fvp, LK_EXCLUSIVE, p) == 0) { + if (vn_lock(fvp, LK_EXCLUSIVE) == 0) { ip->i_e2fs_nlink--; ip->i_flag |= IN_CHANGE; vput(fvp); diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index cea2d15e1d4..23a54fa94b3 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_softdep.c,v 1.141 2018/04/28 03:13:05 visa Exp $ */ +/* $OpenBSD: ffs_softdep.c,v 1.142 2018/05/02 02:24:56 visa Exp $ */ /* * Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved. @@ -866,7 +866,7 @@ softdep_flushworklist(struct mount *oldmnt, int *countp, struct proc *p) devvp = VFSTOUFS(oldmnt)->um_devvp; while ((count = softdep_process_worklist(oldmnt)) > 0) { *countp += count; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_FSYNC(devvp, p->p_ucred, MNT_WAIT, p); VOP_UNLOCK(devvp); if (error) @@ -4580,7 +4580,7 @@ softdep_fsync(struct vnode *vp) FREE_LOCK(&lk); VOP_UNLOCK(vp); error = VFS_VGET(mnt, parentino, &pvp); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (error != 0) return (error); /* diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 2800d995412..de8c5bb2a3b 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_vfsops.c,v 1.175 2018/04/28 03:13:05 visa Exp $ */ +/* $OpenBSD: ffs_vfsops.c,v 1.176 2018/05/02 02:24:56 visa Exp $ */ /* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */ /* @@ -562,7 +562,7 @@ ffs_reload(struct mount *mountp, struct ucred *cred, struct proc *p) * Step 1: invalidate all cached meta-data. */ devvp = VFSTOUFS(mountp)->um_devvp; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = vinvalbuf(devvp, 0, cred, p, 0, 0); VOP_UNLOCK(devvp); if (error) @@ -708,7 +708,7 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p) return (error); if (vcount(devvp) > 1 && devvp != rootvp) return (EBUSY); - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = vinvalbuf(devvp, V_SAVE, cred, p, 0, 0); VOP_UNLOCK(devvp); if (error) @@ -931,7 +931,7 @@ out: if (bp) brelse(bp); - vn_lock(devvp, LK_EXCLUSIVE|LK_RETRY, p); + vn_lock(devvp, LK_EXCLUSIVE|LK_RETRY); (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, cred, p); VOP_UNLOCK(devvp); @@ -1050,7 +1050,7 @@ ffs_unmount(struct mount *mp, int mntflags, struct proc *p) } ump->um_devvp->v_specmountpoint = NULL; - vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); vinvalbuf(ump->um_devvp, V_SAVE, NOCRED, p, 0, 0); (void)VOP_CLOSE(ump->um_devvp, fs->fs_ronly ? FREAD : FREAD|FWRITE, NOCRED, p); @@ -1096,7 +1096,7 @@ ffs_flushfiles(struct mount *mp, int flags, struct proc *p) /* * Flush filesystem metadata. */ - vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_FSYNC(ump->um_devvp, p->p_ucred, MNT_WAIT, p); VOP_UNLOCK(ump->um_devvp); return (error); @@ -1249,7 +1249,7 @@ ffs_sync(struct mount *mp, int waitfor, int stall, struct ucred *cred, struct pr goto loop; } if (waitfor != MNT_LAZY) { - vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); if ((error = VOP_FSYNC(ump->um_devvp, cred, waitfor, p)) != 0) allerror = error; VOP_UNLOCK(ump->um_devvp); diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index e27b0cb600e..8d8e0caf939 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_lookup.c,v 1.51 2018/04/28 03:13:05 visa Exp $ */ +/* $OpenBSD: ufs_lookup.c,v 1.52 2018/05/02 02:24:56 visa Exp $ */ /* $NetBSD: ufs_lookup.c,v 1.7 1996/02/09 22:36:06 christos Exp $ */ /* @@ -128,7 +128,6 @@ ufs_lookup(void *v) struct ucred *cred = cnp->cn_cred; int flags; int nameiop = cnp->cn_nameiop; - struct proc *p = cnp->cn_proc; cnp->cn_flags &= ~PDIRUNLOCK; flags = cnp->cn_flags; @@ -564,12 +563,12 @@ found: cnp->cn_flags |= PDIRUNLOCK; error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp); if (error) { - if (vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, p) == 0) + if (vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY) == 0) cnp->cn_flags &= ~PDIRUNLOCK; return (error); } if (lockparent && (flags & ISLASTCN)) { - if ((error = vn_lock(pdp, LK_EXCLUSIVE, p))) { + if ((error = vn_lock(pdp, LK_EXCLUSIVE))) { vput(tdp); return (error); } @@ -782,7 +781,7 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, VOP_UNLOCK(tvp); error = VOP_FSYNC(dvp, p->p_ucred, MNT_WAIT, p); if (tvp != NULL) - vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY); return (error); } error = VOP_BWRITE(bp); @@ -926,7 +925,7 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, ufsdirhash_dirtrunc(dp, dp->i_endoff); #endif if (tvp != NULL) - vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY); } return (error); } diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c index 37c3af267bd..1e8b3b0db80 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.42 2018/04/28 03:13:05 visa Exp $ */ +/* $OpenBSD: ufs_quota.c,v 1.43 2018/05/02 02:24:56 visa Exp $ */ /* $NetBSD: ufs_quota.c,v 1.8 1996/02/09 22:36:09 christos Exp $ */ /* @@ -838,7 +838,6 @@ dqget(struct vnode *vp, u_long id, struct ufsmount *ump, int type, struct dquot **dqp) { SIPHASH_CTX ctx; - struct proc *p = curproc; struct dquot *dq; struct dqhash *dqh; struct vnode *dqvp; @@ -899,7 +898,7 @@ dqget(struct vnode *vp, u_long id, struct ufsmount *ump, int type, * Initialize the contents of the dquot structure. */ if (vp != dqvp) - vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY); LIST_INSERT_HEAD(dqh, dq, dq_hash); dqref(dq); dq->dq_flags = DQ_LOCK; @@ -978,7 +977,6 @@ dqrele(struct vnode *vp, struct dquot *dq) int dqsync(struct vnode *vp, struct dquot *dq) { - struct proc *p = curproc; struct vnode *dqvp; struct iovec aiov; struct uio auio; @@ -992,7 +990,7 @@ dqsync(struct vnode *vp, struct dquot *dq) panic("dqsync: file"); if (vp != dqvp) - vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY); while (dq->dq_flags & DQ_LOCK) { dq->dq_flags |= DQ_WANT; (void) tsleep(dq, PINOD+2, "dqsync", 0); diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 4b6c210c131..d5ba1c40c53 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_vnops.c,v 1.137 2018/04/28 03:13:05 visa Exp $ */ +/* $OpenBSD: ufs_vnops.c,v 1.138 2018/05/02 02:24:56 visa Exp $ */ /* $NetBSD: ufs_vnops.c,v 1.18 1996/05/11 18:28:04 mycroft Exp $ */ /* @@ -630,7 +630,6 @@ ufs_link(void *v) struct vnode *dvp = ap->a_dvp; struct vnode *vp = ap->a_vp; struct componentname *cnp = ap->a_cnp; - struct proc *p = cnp->cn_proc; struct inode *ip; struct direct newdir; int error; @@ -649,7 +648,7 @@ ufs_link(void *v) error = EXDEV; goto out2; } - if (dvp != vp && (error = vn_lock(vp, LK_EXCLUSIVE, p))) { + if (dvp != vp && (error = vn_lock(vp, LK_EXCLUSIVE))) { VOP_ABORTOP(dvp, cnp); goto out2; } @@ -725,7 +724,6 @@ ufs_rename(void *v) struct vnode *fdvp = ap->a_fdvp; struct componentname *tcnp = ap->a_tcnp; struct componentname *fcnp = ap->a_fcnp; - struct proc *p = fcnp->cn_proc; struct inode *ip, *xp, *dp; struct direct newdir; int doingdirectory = 0, oldparent = 0, newparent = 0; @@ -803,7 +801,7 @@ abortit: return (VOP_REMOVE(fdvp, fvp, fcnp)); } - if ((error = vn_lock(fvp, LK_EXCLUSIVE, p)) != 0) + if ((error = vn_lock(fvp, LK_EXCLUSIVE)) != 0) goto abortit; /* fvp, tdvp, tvp now locked */ @@ -1115,7 +1113,7 @@ out: vrele(fdvp); if (doingdirectory) ip->i_flag &= ~IN_RENAME; - if (vn_lock(fvp, LK_EXCLUSIVE, p) == 0) { + if (vn_lock(fvp, LK_EXCLUSIVE) == 0) { ip->i_effnlink--; DIP_ADD(ip, nlink, -1); ip->i_flag |= IN_CHANGE; |