diff options
author | attilio <attilio@FreeBSD.org> | 2008-01-10 01:10:58 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2008-01-10 01:10:58 +0000 |
commit | 18d0a0dd51c7995ce9e549616f78ef724096b1bd (patch) | |
tree | c4e28d990eaa525916ab09f2bd1d9c6ddf2c8dea /sys/gnu | |
parent | 8df9c26bfdf7538c15226c902c07a0fe350ace36 (diff) | |
download | FreeBSD-src-18d0a0dd51c7995ce9e549616f78ef724096b1bd.zip FreeBSD-src-18d0a0dd51c7995ce9e549616f78ef724096b1bd.tar.gz |
vn_lock() is currently only used with the 'curthread' passed as argument.
Remove this argument and pass curthread directly to underlying
VOP_LOCK1() VFS method. This modify makes the code cleaner and in
particular remove an annoying dependence helping next lockmgr() cleanup.
KPI results, obviously, changed.
Manpage and FreeBSD_version will be updated through further commits.
As a side note, would be valuable to say that next commits will address
a similar cleanup about VFS methods, in particular vop_lock1 and
vop_unlock.
Tested by: Diego Sardina <siarodx at gmail dot com>,
Andrea Di Pasquale <whyx dot it at gmail dot com>
Diffstat (limited to 'sys/gnu')
-rw-r--r-- | sys/gnu/fs/ext2fs/ext2_lookup.c | 2 | ||||
-rw-r--r-- | sys/gnu/fs/ext2fs/ext2_vfsops.c | 6 | ||||
-rw-r--r-- | sys/gnu/fs/ext2fs/ext2_vnops.c | 6 | ||||
-rw-r--r-- | sys/gnu/fs/ext2fs/fs.h | 2 | ||||
-rw-r--r-- | sys/gnu/fs/reiserfs/reiserfs_namei.c | 2 | ||||
-rw-r--r-- | sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c | 2 | ||||
-rw-r--r-- | sys/gnu/fs/xfs/FreeBSD/xfs_super.c | 2 | ||||
-rw-r--r-- | sys/gnu/fs/xfs/FreeBSD/xfs_vnode.c | 2 | ||||
-rw-r--r-- | sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c | 10 |
9 files changed, 17 insertions, 17 deletions
diff --git a/sys/gnu/fs/ext2fs/ext2_lookup.c b/sys/gnu/fs/ext2fs/ext2_lookup.c index f2ac679..004c140 100644 --- a/sys/gnu/fs/ext2fs/ext2_lookup.c +++ b/sys/gnu/fs/ext2fs/ext2_lookup.c @@ -659,7 +659,7 @@ found: saved_ino = dp->i_ino; VOP_UNLOCK(pdp, 0, td); /* race to get the inode */ error = VFS_VGET(vdp->v_mount, saved_ino, LK_EXCLUSIVE, &tdp); - vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY); if (error != 0) return (error); *vpp = tdp; diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c index c77a5dc..06e42cb 100644 --- a/sys/gnu/fs/ext2fs/ext2_vfsops.c +++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c @@ -199,7 +199,7 @@ ext2_mount(mp, td) * If upgrade to read-write by non-root, then verify * that user has necessary permissions on the device. */ - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); error = VOP_ACCESS(devvp, VREAD | VWRITE, td->td_ucred, td); if (error) @@ -517,7 +517,7 @@ ext2_reload(struct mount *mp, struct thread *td) * Step 1: invalidate all cached meta-data. */ devvp = VFSTOEXT2(mp)->um_devvp; - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); if (vinvalbuf(devvp, 0, td, 0, 0) != 0) panic("ext2_reload: dirty1"); VOP_UNLOCK(devvp, 0, td); @@ -916,7 +916,7 @@ loop: * Force stale file system control information to be flushed. */ if (waitfor != MNT_LAZY) { - vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); if ((error = VOP_FSYNC(ump->um_devvp, waitfor, td)) != 0) allerror = error; VOP_UNLOCK(ump->um_devvp, 0, td); diff --git a/sys/gnu/fs/ext2fs/ext2_vnops.c b/sys/gnu/fs/ext2fs/ext2_vnops.c index 04afdeb..e1b5f4e 100644 --- a/sys/gnu/fs/ext2fs/ext2_vnops.c +++ b/sys/gnu/fs/ext2fs/ext2_vnops.c @@ -813,7 +813,7 @@ abortit: goto abortit; } - if ((error = vn_lock(fvp, LK_EXCLUSIVE, td)) != 0) + if ((error = vn_lock(fvp, LK_EXCLUSIVE)) != 0) goto abortit; dp = VTOI(fdvp); ip = VTOI(fvp); @@ -1103,7 +1103,7 @@ bad: out: if (doingdirectory) ip->i_flag &= ~IN_RENAME; - if (vn_lock(fvp, LK_EXCLUSIVE, td) == 0) { + if (vn_lock(fvp, LK_EXCLUSIVE) == 0) { ip->i_nlink--; ip->i_flag |= IN_CHANGE; ip->i_flag &= ~IN_RENAME; @@ -1314,7 +1314,7 @@ ext2_rmdir(ap) ip->i_nlink -= 2; error = ext2_truncate(vp, (off_t)0, IO_SYNC, cnp->cn_cred, td); cache_purge(ITOV(ip)); - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); out: return (error); } diff --git a/sys/gnu/fs/ext2fs/fs.h b/sys/gnu/fs/ext2fs/fs.h index 341371d..157eacb 100644 --- a/sys/gnu/fs/ext2fs/fs.h +++ b/sys/gnu/fs/ext2fs/fs.h @@ -145,7 +145,7 @@ extern u_char *fragtbl[]; * I think I'll try a VOP_LOCK/VOP_UNLOCK on the device vnode */ #define DEVVP(inode) (VFSTOEXT2(ITOV(inode)->v_mount)->um_devvp) -#define lock_super(devvp) vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, curthread) +#define lock_super(devvp) vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY) #define unlock_super(devvp) VOP_UNLOCK(devvp, 0, curthread) /* diff --git a/sys/gnu/fs/reiserfs/reiserfs_namei.c b/sys/gnu/fs/reiserfs/reiserfs_namei.c index f1a2c20..84a7bf8 100644 --- a/sys/gnu/fs/reiserfs/reiserfs_namei.c +++ b/sys/gnu/fs/reiserfs/reiserfs_namei.c @@ -82,7 +82,7 @@ reiserfs_lookup(struct vop_cachedlookup_args *ap) VOP_UNLOCK(pdp, 0, td); error = reiserfs_iget(vdp->v_mount, saved_ino, &vp, td); - vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY); if (error != 0) return (error); *vpp = vp; diff --git a/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c b/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c index 7145b94..ff5b0c2 100644 --- a/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c +++ b/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c @@ -390,7 +390,7 @@ xfs_vn_allocate(xfs_mount_t *mp, xfs_inode_t *ip, struct xfs_vnode **vpp) } vp->v_vnlock->lk_flags |= LK_CANRECURSE; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); error = insmntque(vp, XVFSTOMNT(XFS_MTOVFS(mp))); if (error != 0) { kmem_free(vdata, sizeof(*vdata)); diff --git a/sys/gnu/fs/xfs/FreeBSD/xfs_super.c b/sys/gnu/fs/xfs/FreeBSD/xfs_super.c index 97c6586..6f1d8b8 100644 --- a/sys/gnu/fs/xfs/FreeBSD/xfs_super.c +++ b/sys/gnu/fs/xfs/FreeBSD/xfs_super.c @@ -148,7 +148,7 @@ xfs_blkdev_get( return (error); } - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); ronly = ((XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY) != 0); accessmode = VREAD; diff --git a/sys/gnu/fs/xfs/FreeBSD/xfs_vnode.c b/sys/gnu/fs/xfs/FreeBSD/xfs_vnode.c index 0d245c6..c014efc 100644 --- a/sys/gnu/fs/xfs/FreeBSD/xfs_vnode.c +++ b/sys/gnu/fs/xfs/FreeBSD/xfs_vnode.c @@ -135,7 +135,7 @@ vn_purge(struct xfs_vnode *xfs_vp) vp = xfs_vp->v_vnode; - vn_lock(vp, LK_EXCLUSIVE, curthread); + vn_lock(vp, LK_EXCLUSIVE); if (vp->v_holdcnt == 0) vhold(vp); vgone(vp); diff --git a/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c b/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c index c894095..80435a7 100644 --- a/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c +++ b/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c @@ -1294,7 +1294,7 @@ _xfs_cachedlookup( tvp = cvp->v_vnode; if (nameiop == DELETE && islastcn) { - if ((error = vn_lock(tvp, LK_EXCLUSIVE, td))) { + if ((error = vn_lock(tvp, LK_EXCLUSIVE))) { vrele(tvp); goto err_out; } @@ -1310,7 +1310,7 @@ _xfs_cachedlookup( } if (nameiop == RENAME && islastcn) { - if ((error = vn_lock(tvp, LK_EXCLUSIVE, td))) { + if ((error = vn_lock(tvp, LK_EXCLUSIVE))) { vrele(tvp); goto err_out; } @@ -1323,9 +1323,9 @@ _xfs_cachedlookup( if (flags & ISDOTDOT) { VOP_UNLOCK(dvp, 0, td); - error = vn_lock(tvp, cnp->cn_lkflags, td); + error = vn_lock(tvp, cnp->cn_lkflags); if (error) { - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); vrele(tvp); goto err_out; } @@ -1334,7 +1334,7 @@ _xfs_cachedlookup( *vpp = tvp; KASSERT(tvp == dvp, ("not same directory")); } else { - if ((error = vn_lock(tvp, cnp->cn_lkflags, td))) { + if ((error = vn_lock(tvp, cnp->cn_lkflags))) { vrele(tvp); goto err_out; } |