1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-27 08:00:11 +00:00

VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used in

conjuction with 'thread' argument passing which is always curthread.
Remove the unuseful extra-argument and pass explicitly curthread to lower
layer functions, when necessary.

KPI results broken by this change, which should affect several ports, so
version bumping and manpage update will be further committed.

Tested by: kris, pho, Diego Sardina <siarodx at gmail dot com>
This commit is contained in:
Attilio Rao 2008-01-13 14:44:15 +00:00
parent ce4c63c52a
commit 22db15c06f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=175294
124 changed files with 453 additions and 483 deletions

View File

@ -77,12 +77,12 @@ kobj_open_file_vnode(const char *file)
flags = FREAD;
NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, file, td);
error = vn_open_cred(&nd, &flags, 0, td->td_ucred, NULL);
error = vn_open_cred(&nd, &flags, 0, curthread->td_ucred, NULL);
NDFREE(&nd, NDF_ONLY_PNBUF);
if (error != 0)
return (NULL);
/* We just unlock so we hold a reference. */
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
return (nd.ni_vp);
}
@ -125,7 +125,7 @@ kobj_get_filesize_vnode(struct _buf *file, uint64_t *size)
vn_lock(vp, LK_SHARED | LK_RETRY);
error = VOP_GETATTR(vp, &va, td->td_ucred, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if (error == 0)
*size = (uint64_t)va.va_size;
return (error);
@ -178,7 +178,7 @@ kobj_read_file_vnode(struct _buf *file, char *buf, unsigned size, unsigned off)
vn_lock(vp, LK_SHARED | LK_RETRY);
error = VOP_READ(vp, &auio, IO_UNIT | IO_SYNC, td->td_ucred);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
return (error != 0 ? -1 : size - auio.uio_resid);
}

View File

@ -194,7 +194,7 @@ domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath,
*/
vn_lock(vp, LK_SHARED | LK_RETRY);
mp = vfs_mount_alloc(vp, vfsp, fspath, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
mp->mnt_optnew = NULL;
vfs_setmntopt(mp, "from", fspec, 0);
@ -260,7 +260,7 @@ domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath,
panic("mount: lost mount");
mountcheckdirs(vp, mvp);
vput(mvp);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if ((mp->mnt_flag & MNT_RDONLY) == 0)
error = vfs_allocate_syncvnode(mp);
vfs_unbusy(mp, td);
@ -272,7 +272,7 @@ domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath,
VI_LOCK(vp);
vp->v_iflag &= ~VI_MOUNT;
VI_UNLOCK(vp);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vfs_unbusy(mp, td);
vfs_mount_destroy(mp);
}

View File

@ -175,7 +175,7 @@ zfs_vn_open(char *pnamep, enum uio_seg seg, int filemode, int createmode,
if (error == 0) {
/* We just unlock so we hold a reference. */
VN_HOLD(nd.ni_vp);
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
*vpp = nd.ni_vp;
}
return (error);
@ -213,7 +213,6 @@ zfs_vn_rdwr(enum uio_rw rw, vnode_t *vp, caddr_t base, ssize_t len,
static __inline int
zfs_vop_fsync(vnode_t *vp, int flag, cred_t *cr)
{
struct thread *td = curthread;
struct mount *mp;
int error, vfslocked;
@ -223,8 +222,8 @@ zfs_vop_fsync(vnode_t *vp, int flag, cred_t *cr)
if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0)
goto drop;
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_FSYNC(vp, MNT_WAIT, td);
VOP_UNLOCK(vp, 0, td);
error = VOP_FSYNC(vp, MNT_WAIT, curthread);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
drop:
VFS_UNLOCK_GIANT(vfslocked);

View File

@ -391,7 +391,7 @@ zfsctl_root_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, pathname_t *pnp,
if (strcmp(nm, "..") == 0) {
err = VFS_ROOT(dvp->v_vfsp, LK_EXCLUSIVE, vpp, curthread);
if (err == 0)
VOP_UNLOCK(*vpp, 0, curthread);
VOP_UNLOCK(*vpp, 0);
} else {
err = gfs_dir_lookup(dvp, nm, vpp);
}
@ -882,7 +882,7 @@ zfsctl_snapshot_inactive(ap)
VERIFY(gfs_dir_lookup(vp, "..", &dvp) == 0);
sdp = dvp->v_data;
VOP_UNLOCK(dvp, 0, ap->a_td);
VOP_UNLOCK(dvp, 0);
if (!(locked = MUTEX_HELD(&sdp->sd_lock)))
mutex_enter(&sdp->sd_lock);

View File

@ -127,10 +127,10 @@ zfs_replay_create(zfsvfs_t *zfsvfs, lr_create_t *lr, boolean_t byteswap)
default:
error = ENOTSUP;
}
VOP_UNLOCK(ZTOV(dzp), 0, curthread);
VOP_UNLOCK(ZTOV(dzp), 0);
if (error == 0 && vp != NULL) {
VOP_UNLOCK(vp, 0, curthread);
VOP_UNLOCK(vp, 0);
VN_RELE(vp);
}
@ -165,7 +165,7 @@ zfs_replay_remove(zfsvfs_t *zfsvfs, lr_remove_t *lr, boolean_t byteswap)
vn_lock(ZTOV(dzp), LK_EXCLUSIVE | LK_RETRY);
error = VOP_LOOKUP(ZTOV(dzp), &vp, &cn);
if (error != 0) {
VOP_UNLOCK(ZTOV(dzp), 0, curthread);
VOP_UNLOCK(ZTOV(dzp), 0);
goto fail;
}
@ -180,7 +180,7 @@ zfs_replay_remove(zfsvfs_t *zfsvfs, lr_remove_t *lr, boolean_t byteswap)
error = ENOTSUP;
}
vput(vp);
VOP_UNLOCK(ZTOV(dzp), 0, curthread);
VOP_UNLOCK(ZTOV(dzp), 0);
fail:
VN_RELE(ZTOV(dzp));
@ -214,8 +214,8 @@ zfs_replay_link(zfsvfs_t *zfsvfs, lr_link_t *lr, boolean_t byteswap)
vn_lock(ZTOV(dzp), LK_EXCLUSIVE | LK_RETRY);
vn_lock(ZTOV(zp), LK_EXCLUSIVE | LK_RETRY);
error = VOP_LINK(ZTOV(dzp), ZTOV(zp), &cn);
VOP_UNLOCK(ZTOV(zp), 0, curthread);
VOP_UNLOCK(ZTOV(dzp), 0, curthread);
VOP_UNLOCK(ZTOV(zp), 0);
VOP_UNLOCK(ZTOV(dzp), 0);
VN_RELE(ZTOV(zp));
VN_RELE(ZTOV(dzp));
@ -257,10 +257,10 @@ zfs_replay_rename(zfsvfs_t *zfsvfs, lr_rename_t *lr, boolean_t byteswap)
scn.cn_thread = td;
vn_lock(ZTOV(sdzp), LK_EXCLUSIVE | LK_RETRY);
error = VOP_LOOKUP(ZTOV(sdzp), &svp, &scn);
VOP_UNLOCK(ZTOV(sdzp), 0, td);
VOP_UNLOCK(ZTOV(sdzp), 0);
if (error != 0)
goto fail;
VOP_UNLOCK(svp, 0, td);
VOP_UNLOCK(svp, 0);
bzero(&tcn, sizeof(tcn));
tcn.cn_nameptr = tname;
@ -275,7 +275,7 @@ zfs_replay_rename(zfsvfs_t *zfsvfs, lr_rename_t *lr, boolean_t byteswap)
if (error == EJUSTRETURN)
tvp = NULL;
else if (error != 0) {
VOP_UNLOCK(ZTOV(tdzp), 0, td);
VOP_UNLOCK(ZTOV(tdzp), 0);
goto fail;
}
@ -362,7 +362,7 @@ zfs_replay_setattr(zfsvfs_t *zfsvfs, lr_setattr_t *lr, boolean_t byteswap)
vp = ZTOV(zp);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_SETATTR(vp, &va, kcred, curthread);
VOP_UNLOCK(vp, 0, curthread);
VOP_UNLOCK(vp, 0);
VN_RELE(vp);
return (error);

View File

@ -1114,7 +1114,7 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, struct componentname *cnp,
if (cnp->cn_flags & ISDOTDOT) {
ltype = VOP_ISLOCKED(dvp, td);
VOP_UNLOCK(dvp, 0, td);
VOP_UNLOCK(dvp, 0);
}
error = vn_lock(*vpp, cnp->cn_lkflags);
if (cnp->cn_flags & ISDOTDOT)

View File

@ -87,7 +87,7 @@ znode_pageout_func(dmu_buf_t *dbuf, void *user_ptr)
mutex_exit(&zp->z_lock);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
vrecycle(vp, curthread);
VOP_UNLOCK(vp, 0, curthread);
VOP_UNLOCK(vp, 0);
vdrop(vp);
zfs_znode_free(zp);
} else {

View File

@ -598,7 +598,7 @@ getdents_common(struct thread *td, struct linux_getdents64_args *args,
if (cookies)
free(cookies, M_TEMP);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
fdrop(fp, td);
free(buf, M_TEMP);

View File

@ -377,7 +377,7 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args)
* Lock no longer needed
*/
locked = 0;
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
/*
@ -458,7 +458,7 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args)
cleanup:
/* Unlock vnode if needed */
if (locked) {
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
}

View File

@ -2970,7 +2970,7 @@ NdisOpenFile(status, filehandle, filelength, filename, highestaddr)
/* Get the file size. */
VOP_GETATTR(nd.ni_vp, vap, td->td_ucred, td);
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
fh->nf_vp = nd.ni_vp;

View File

@ -77,12 +77,12 @@ kobj_open_file_vnode(const char *file)
flags = FREAD;
NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, file, td);
error = vn_open_cred(&nd, &flags, 0, td->td_ucred, NULL);
error = vn_open_cred(&nd, &flags, 0, curthread->td_ucred, NULL);
NDFREE(&nd, NDF_ONLY_PNBUF);
if (error != 0)
return (NULL);
/* We just unlock so we hold a reference. */
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
return (nd.ni_vp);
}
@ -125,7 +125,7 @@ kobj_get_filesize_vnode(struct _buf *file, uint64_t *size)
vn_lock(vp, LK_SHARED | LK_RETRY);
error = VOP_GETATTR(vp, &va, td->td_ucred, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if (error == 0)
*size = (uint64_t)va.va_size;
return (error);
@ -178,7 +178,7 @@ kobj_read_file_vnode(struct _buf *file, char *buf, unsigned size, unsigned off)
vn_lock(vp, LK_SHARED | LK_RETRY);
error = VOP_READ(vp, &auio, IO_UNIT | IO_SYNC, td->td_ucred);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
return (error != 0 ? -1 : size - auio.uio_resid);
}

View File

@ -194,7 +194,7 @@ domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath,
*/
vn_lock(vp, LK_SHARED | LK_RETRY);
mp = vfs_mount_alloc(vp, vfsp, fspath, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
mp->mnt_optnew = NULL;
vfs_setmntopt(mp, "from", fspec, 0);
@ -260,7 +260,7 @@ domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath,
panic("mount: lost mount");
mountcheckdirs(vp, mvp);
vput(mvp);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if ((mp->mnt_flag & MNT_RDONLY) == 0)
error = vfs_allocate_syncvnode(mp);
vfs_unbusy(mp, td);
@ -272,7 +272,7 @@ domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath,
VI_LOCK(vp);
vp->v_iflag &= ~VI_MOUNT;
VI_UNLOCK(vp);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vfs_unbusy(mp, td);
vfs_mount_destroy(mp);
}

View File

@ -175,7 +175,7 @@ zfs_vn_open(char *pnamep, enum uio_seg seg, int filemode, int createmode,
if (error == 0) {
/* We just unlock so we hold a reference. */
VN_HOLD(nd.ni_vp);
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
*vpp = nd.ni_vp;
}
return (error);
@ -213,7 +213,6 @@ zfs_vn_rdwr(enum uio_rw rw, vnode_t *vp, caddr_t base, ssize_t len,
static __inline int
zfs_vop_fsync(vnode_t *vp, int flag, cred_t *cr)
{
struct thread *td = curthread;
struct mount *mp;
int error, vfslocked;
@ -223,8 +222,8 @@ zfs_vop_fsync(vnode_t *vp, int flag, cred_t *cr)
if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0)
goto drop;
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_FSYNC(vp, MNT_WAIT, td);
VOP_UNLOCK(vp, 0, td);
error = VOP_FSYNC(vp, MNT_WAIT, curthread);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
drop:
VFS_UNLOCK_GIANT(vfslocked);

View File

@ -316,7 +316,7 @@ pecoff_load_file(struct thread * td, const char *file, u_long * addr, u_long * e
* Check permissions, modes, uid, etc on the file, and "open" it.
*/
error = exec_check_permissions(imgp);
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
if (error)
goto fail;
if ((error = pecoff_read_from(td, imgp->vp, 0, (caddr_t) & dh, sizeof(dh))) != 0)
@ -579,14 +579,13 @@ imgact_pecoff(struct image_params * imgp)
imgp->image_header;
struct coff_filehdr *fp;
int error, peofs;
struct thread *td = curthread;
error = pecoff_signature(FIRST_THREAD_IN_PROC(imgp->proc),
imgp->vp, dp);
if (error) {
return -1;
}
VOP_UNLOCK(imgp->vp, 0, td);
VOP_UNLOCK(imgp->vp, 0);
peofs = dp->d_peofs + sizeof(signature) - 1;
fp = malloc(PECOFF_HDR_SIZE, M_TEMP, M_WAITOK);

View File

@ -68,7 +68,6 @@ exec_svr4_imgact(imgp)
vm_offset_t buffer;
unsigned long bss_size;
int error;
struct thread *td = curthread;
if (((a_out->a_magic >> 16) & 0xff) != 0x64)
return -1;
@ -115,7 +114,7 @@ exec_svr4_imgact(imgp)
}
PROC_UNLOCK(imgp->proc);
VOP_UNLOCK(imgp->vp, 0, td);
VOP_UNLOCK(imgp->vp, 0);
/*
* Destroy old process VM and create a new one (with a new stack)

View File

@ -272,7 +272,7 @@ fd_revoke(td, fd)
#ifdef MAC
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = mac_vnode_check_revoke(td->td_ucred, vp);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if (error)
goto out;
#endif

View File

@ -396,7 +396,7 @@ svr4_sys_getdents64(td, uap)
eof:
td->td_retval[0] = nbytes - resid;
out:
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
fdrop(fp, td);
if (cookies)
@ -529,7 +529,7 @@ svr4_sys_getdents(td, uap)
eof:
*retval = uap->nbytes - resid;
out:
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
fdrop(fp, td);
if (cookiebuf)
@ -629,7 +629,7 @@ svr4_sys_fchroot(td, uap)
if (error)
goto fail;
#endif
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
error = change_root(vp, td);
vrele(vp);
VFS_UNLOCK_GIANT(vfslocked);

View File

@ -391,7 +391,7 @@ zfsctl_root_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, pathname_t *pnp,
if (strcmp(nm, "..") == 0) {
err = VFS_ROOT(dvp->v_vfsp, LK_EXCLUSIVE, vpp, curthread);
if (err == 0)
VOP_UNLOCK(*vpp, 0, curthread);
VOP_UNLOCK(*vpp, 0);
} else {
err = gfs_dir_lookup(dvp, nm, vpp);
}
@ -882,7 +882,7 @@ zfsctl_snapshot_inactive(ap)
VERIFY(gfs_dir_lookup(vp, "..", &dvp) == 0);
sdp = dvp->v_data;
VOP_UNLOCK(dvp, 0, ap->a_td);
VOP_UNLOCK(dvp, 0);
if (!(locked = MUTEX_HELD(&sdp->sd_lock)))
mutex_enter(&sdp->sd_lock);

View File

@ -127,10 +127,10 @@ zfs_replay_create(zfsvfs_t *zfsvfs, lr_create_t *lr, boolean_t byteswap)
default:
error = ENOTSUP;
}
VOP_UNLOCK(ZTOV(dzp), 0, curthread);
VOP_UNLOCK(ZTOV(dzp), 0);
if (error == 0 && vp != NULL) {
VOP_UNLOCK(vp, 0, curthread);
VOP_UNLOCK(vp, 0);
VN_RELE(vp);
}
@ -165,7 +165,7 @@ zfs_replay_remove(zfsvfs_t *zfsvfs, lr_remove_t *lr, boolean_t byteswap)
vn_lock(ZTOV(dzp), LK_EXCLUSIVE | LK_RETRY);
error = VOP_LOOKUP(ZTOV(dzp), &vp, &cn);
if (error != 0) {
VOP_UNLOCK(ZTOV(dzp), 0, curthread);
VOP_UNLOCK(ZTOV(dzp), 0);
goto fail;
}
@ -180,7 +180,7 @@ zfs_replay_remove(zfsvfs_t *zfsvfs, lr_remove_t *lr, boolean_t byteswap)
error = ENOTSUP;
}
vput(vp);
VOP_UNLOCK(ZTOV(dzp), 0, curthread);
VOP_UNLOCK(ZTOV(dzp), 0);
fail:
VN_RELE(ZTOV(dzp));
@ -214,8 +214,8 @@ zfs_replay_link(zfsvfs_t *zfsvfs, lr_link_t *lr, boolean_t byteswap)
vn_lock(ZTOV(dzp), LK_EXCLUSIVE | LK_RETRY);
vn_lock(ZTOV(zp), LK_EXCLUSIVE | LK_RETRY);
error = VOP_LINK(ZTOV(dzp), ZTOV(zp), &cn);
VOP_UNLOCK(ZTOV(zp), 0, curthread);
VOP_UNLOCK(ZTOV(dzp), 0, curthread);
VOP_UNLOCK(ZTOV(zp), 0);
VOP_UNLOCK(ZTOV(dzp), 0);
VN_RELE(ZTOV(zp));
VN_RELE(ZTOV(dzp));
@ -257,10 +257,10 @@ zfs_replay_rename(zfsvfs_t *zfsvfs, lr_rename_t *lr, boolean_t byteswap)
scn.cn_thread = td;
vn_lock(ZTOV(sdzp), LK_EXCLUSIVE | LK_RETRY);
error = VOP_LOOKUP(ZTOV(sdzp), &svp, &scn);
VOP_UNLOCK(ZTOV(sdzp), 0, td);
VOP_UNLOCK(ZTOV(sdzp), 0);
if (error != 0)
goto fail;
VOP_UNLOCK(svp, 0, td);
VOP_UNLOCK(svp, 0);
bzero(&tcn, sizeof(tcn));
tcn.cn_nameptr = tname;
@ -275,7 +275,7 @@ zfs_replay_rename(zfsvfs_t *zfsvfs, lr_rename_t *lr, boolean_t byteswap)
if (error == EJUSTRETURN)
tvp = NULL;
else if (error != 0) {
VOP_UNLOCK(ZTOV(tdzp), 0, td);
VOP_UNLOCK(ZTOV(tdzp), 0);
goto fail;
}
@ -362,7 +362,7 @@ zfs_replay_setattr(zfsvfs_t *zfsvfs, lr_setattr_t *lr, boolean_t byteswap)
vp = ZTOV(zp);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_SETATTR(vp, &va, kcred, curthread);
VOP_UNLOCK(vp, 0, curthread);
VOP_UNLOCK(vp, 0);
VN_RELE(vp);
return (error);

View File

@ -1114,7 +1114,7 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, struct componentname *cnp,
if (cnp->cn_flags & ISDOTDOT) {
ltype = VOP_ISLOCKED(dvp, td);
VOP_UNLOCK(dvp, 0, td);
VOP_UNLOCK(dvp, 0);
}
error = vn_lock(*vpp, cnp->cn_lkflags);
if (cnp->cn_flags & ISDOTDOT)

View File

@ -87,7 +87,7 @@ znode_pageout_func(dmu_buf_t *dbuf, void *user_ptr)
mutex_exit(&zp->z_lock);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
vrecycle(vp, curthread);
VOP_UNLOCK(vp, 0, curthread);
VOP_UNLOCK(vp, 0);
vdrop(vp);
zfs_znode_free(zp);
} else {

View File

@ -678,14 +678,12 @@ pmc_force_context_switch(void)
static void
pmc_getfilename(struct vnode *v, char **fullpath, char **freepath)
{
struct thread *td;
td = curthread;
*fullpath = "unknown";
*freepath = NULL;
vn_lock(v, LK_CANRECURSE | LK_EXCLUSIVE | LK_RETRY);
vn_fullpath(td, v, fullpath, freepath);
VOP_UNLOCK(v, 0, td);
vn_fullpath(curthread, v, fullpath, freepath);
VOP_UNLOCK(v, 0);
}
/*

View File

@ -532,7 +532,7 @@ mdstart_vnode(struct md_s *sc, struct bio *bp)
(void) vn_start_write(vp, &mp, V_WAIT);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_FSYNC(vp, MNT_WAIT, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
VFS_UNLOCK_GIANT(vfslocked);
return (error);
@ -562,13 +562,13 @@ mdstart_vnode(struct md_s *sc, struct bio *bp)
if (bp->bio_cmd == BIO_READ) {
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_READ(vp, &auio, IO_DIRECT, sc->cred);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
} else {
(void) vn_start_write(vp, &mp, V_WAIT);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_WRITE(vp, &auio, sc->flags & MD_ASYNC ? 0 : IO_SYNC,
sc->cred);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
}
VFS_UNLOCK_GIANT(vfslocked);
@ -897,7 +897,7 @@ mdsetcred(struct md_s *sc, struct ucred *cred)
auio.uio_resid = aiov.iov_len;
vn_lock(sc->vnode, LK_EXCLUSIVE | LK_RETRY);
error = VOP_READ(sc->vnode, &auio, 0, sc->cred);
VOP_UNLOCK(sc->vnode, 0, curthread);
VOP_UNLOCK(sc->vnode, 0);
free(tmpbuf, M_TEMP);
}
return (error);
@ -928,13 +928,13 @@ mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, struct thread *td)
NDFREE(&nd, NDF_ONLY_PNBUF);
if (nd.ni_vp->v_type != VREG ||
(error = VOP_GETATTR(nd.ni_vp, &vattr, td->td_ucred, td))) {
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
(void)vn_close(nd.ni_vp, flags, td->td_ucred, td);
VFS_UNLOCK_GIANT(vfslocked);
return (error ? error : EINVAL);
}
nd.ni_vp->v_vflag |= VV_MD;
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
if (mdio->md_fwsectors != 0)
sc->fwsectors = mdio->md_fwsectors;
@ -949,7 +949,7 @@ mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, struct thread *td)
if (error != 0) {
vn_lock(nd.ni_vp, LK_EXCLUSIVE | LK_RETRY);
nd.ni_vp->v_vflag &= ~VV_MD;
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
(void)vn_close(nd.ni_vp, flags, td->td_ucred, td);
VFS_UNLOCK_GIANT(vfslocked);
return (error);
@ -986,7 +986,7 @@ mddestroy(struct md_s *sc, struct thread *td)
vfslocked = VFS_LOCK_GIANT(sc->vnode->v_mount);
vn_lock(sc->vnode, LK_EXCLUSIVE | LK_RETRY);
sc->vnode->v_vflag &= ~VV_MD;
VOP_UNLOCK(sc->vnode, 0, td);
VOP_UNLOCK(sc->vnode, 0);
(void)vn_close(sc->vnode, sc->flags & MD_READONLY ?
FREAD : (FREAD|FWRITE), sc->cred, td);
VFS_UNLOCK_GIANT(vfslocked);

View File

@ -115,7 +115,6 @@ cd9660_lookup(ap)
struct componentname *cnp = ap->a_cnp;
int flags = cnp->cn_flags;
int nameiop = cnp->cn_nameiop;
struct thread *td = cnp->cn_thread;
bp = NULL;
*vpp = NULL;
@ -349,7 +348,7 @@ cd9660_lookup(ap)
*/
if (flags & ISDOTDOT) {
saved_ino = dp->i_ino;
VOP_UNLOCK(pdp, 0, td); /* race to get the inode */
VOP_UNLOCK(pdp, 0); /* race to get the inode */
error = cd9660_vget_internal(vdp->v_mount, saved_ino,
LK_EXCLUSIVE, &tdp,
saved_ino != ino, ep);

View File

@ -178,7 +178,7 @@ cd9660_mount(struct mount *mp, struct thread *td)
vput(devvp);
return (error);
}
VOP_UNLOCK(devvp, 0, td);
VOP_UNLOCK(devvp, 0);
if ((mp->mnt_flag & MNT_UPDATE) == 0) {
error = iso_mountfs(devvp, mp, td);
@ -230,7 +230,7 @@ iso_mountfs(devvp, mp, td)
error = g_vfs_open(devvp, &cp, "cd9660", 0);
g_topology_unlock();
PICKUP_GIANT();
VOP_UNLOCK(devvp, 0, td);
VOP_UNLOCK(devvp, 0);
if (error)
return error;
if (devvp->v_rdev->si_iosize_max != 0)

View File

@ -922,7 +922,7 @@ coda_lookup(struct vop_lookup_args *ap)
*/
if (!error || (error == EJUSTRETURN)) {
if (cnp->cn_flags & ISDOTDOT) {
if ((error = VOP_UNLOCK(dvp, 0, td))) {
if ((error = VOP_UNLOCK(dvp, 0))) {
return error;
}
/*
@ -930,7 +930,7 @@ coda_lookup(struct vop_lookup_args *ap)
* lock it without bothering to check anything else.
*/
if (*ap->a_vpp) {
if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE, td))) {
if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE))) {
vn_lock(dvp, LK_RETRY|LK_EXCLUSIVE);
return (error);
}
@ -940,7 +940,7 @@ coda_lookup(struct vop_lookup_args *ap)
/* The parent is locked, and may be the same as the child */
if (*ap->a_vpp && (*ap->a_vpp != dvp)) {
/* Different, go ahead and lock it. */
if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE, td))) {
if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE))) {
return (error);
}
}
@ -1026,7 +1026,7 @@ coda_create(struct vop_create_args *ap)
if (!error) {
if (cnp->cn_flags & LOCKLEAF) {
if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE, td))) {
if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE))) {
printf("coda_create: ");
panic("unlocked parent but couldn't lock child");
}

View File

@ -245,11 +245,9 @@ void
devfs_delete(struct devfs_mount *dm, struct devfs_dirent *de, int vp_locked)
{
struct vnode *vp;
struct thread *td;
KASSERT((de->de_flags & DE_DOOMED) == 0,
("devfs_delete doomed dirent"));
td = curthread;
de->de_flags |= DE_DOOMED;
mtx_lock(&devfs_de_interlock);
vp = de->de_vnode;
@ -264,7 +262,7 @@ devfs_delete(struct devfs_mount *dm, struct devfs_dirent *de, int vp_locked)
VI_UNLOCK(vp);
vgone(vp);
if (!vp_locked)
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vdrop(vp);
sx_xlock(&dm->dm_lock);
} else

View File

@ -100,7 +100,7 @@ devfs_mount(struct mount *mp, struct thread *td)
return (error);
}
VOP_UNLOCK(rvp, 0, td);
VOP_UNLOCK(rvp, 0);
vfs_mountedfrom(mp, "devfs");

View File

@ -361,7 +361,7 @@ devfs_close(struct vop_close_args *ap)
vholdl(vp);
VI_UNLOCK(vp);
vp_locked = VOP_ISLOCKED(vp, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
KASSERT(dev->si_refcount > 0,
("devfs_close() on un-referenced struct cdev *(%s)", devtoname(dev)));
if (!(dsw->d_flags & D_NEEDGIANT)) {
@ -587,7 +587,7 @@ devfs_lookupx(struct vop_lookup_args *ap, int *dm_unlock)
if (flags & ISDOTDOT) {
if ((flags & ISLASTCN) && nameiop != LOOKUP)
return (EINVAL);
VOP_UNLOCK(dvp, 0, td);
VOP_UNLOCK(dvp, 0);
de = TAILQ_FIRST(&dd->de_dlist); /* "." */
de = TAILQ_NEXT(de, de_list); /* ".." */
de = de->de_dir;
@ -770,7 +770,7 @@ devfs_open(struct vop_open_args *ap)
if (dsw->d_flags & D_TTY)
vp->v_vflag |= VV_ISTTY;
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if(!(dsw->d_flags & D_NEEDGIANT)) {
DROP_GIANT();
@ -1059,7 +1059,7 @@ devfs_revoke(struct vop_revoke_args *ap)
vgone(vp);
vdrop(vp);
VOP_UNLOCK(vp,0,curthread);
VOP_UNLOCK(vp,0);
loop:
for (;;) {
mtx_lock(&devfs_de_interlock);

View File

@ -411,7 +411,7 @@ fdesc_setattr(ap)
if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) == 0) {
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_SETATTR(vp, ap->a_vap, ap->a_cred, ap->a_td);
VOP_UNLOCK(vp, 0, ap->a_td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
}
fdrop(fp, ap->a_td);

View File

@ -254,7 +254,7 @@ fifo_open(ap)
}
if ((ap->a_mode & O_NONBLOCK) == 0) {
if ((ap->a_mode & FREAD) && fip->fi_writers == 0) {
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
error = msleep(&fip->fi_readers, &fifo_mtx,
PDROP | PCATCH | PSOCK, "fifoor", 0);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
@ -274,7 +274,7 @@ fifo_open(ap)
*/
}
if ((ap->a_mode & FWRITE) && fip->fi_readers == 0) {
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
error = msleep(&fip->fi_writers, &fifo_mtx,
PDROP | PCATCH | PSOCK, "fifoow", 0);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);

View File

@ -236,7 +236,7 @@ hpfs_mountfs(devvp, mp, td)
error = g_vfs_open(devvp, &cp, "hpfs", ronly ? 0 : 1);
g_topology_unlock();
PICKUP_GIANT();
VOP_UNLOCK(devvp, 0, td);
VOP_UNLOCK(devvp, 0);
if (error)
return (error);

View File

@ -1063,7 +1063,7 @@ hpfs_lookup(ap)
if (VFS_VGET(hpmp->hpm_mp, dhp->h_fn.fn_parent,
LK_NOWAIT | LK_EXCLUSIVE, ap->a_vpp)) {
VOP_UNLOCK(dvp,0,cnp->cn_thread);
VOP_UNLOCK(dvp,0);
error = VFS_VGET(hpmp->hpm_mp,
dhp->h_fn.fn_parent, LK_EXCLUSIVE, ap->a_vpp);
vn_lock(dvp, LK_EXCLUSIVE|LK_RETRY);

View File

@ -108,7 +108,6 @@ msdosfs_lookup(ap)
u_char dosfilename[12];
int flags = cnp->cn_flags;
int nameiop = cnp->cn_nameiop;
struct thread *td = cnp->cn_thread;
int unlen;
int wincnt = 1;
@ -520,7 +519,7 @@ msdosfs_lookup(ap)
*/
pdp = vdp;
if (flags & ISDOTDOT) {
VOP_UNLOCK(pdp, 0, td);
VOP_UNLOCK(pdp, 0);
error = deget(pmp, cluster, blkoff, &tdp);
vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY);
if (error)

View File

@ -318,10 +318,10 @@ msdosfs_mount(struct mount *mp, struct thread *td)
if (error)
error = priv_check(td, PRIV_VFS_MOUNT_PERM);
if (error) {
VOP_UNLOCK(devvp, 0, td);
VOP_UNLOCK(devvp, 0);
return (error);
}
VOP_UNLOCK(devvp, 0, td);
VOP_UNLOCK(devvp, 0);
DROP_GIANT();
g_topology_lock();
error = g_access(pmp->pm_cp, 0, 1, 0);
@ -426,7 +426,7 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp, struct thread *td)
error = g_vfs_open(devvp, &cp, "msdosfs", ronly ? 0 : 1);
g_topology_unlock();
PICKUP_GIANT();
VOP_UNLOCK(devvp, 0, td);
VOP_UNLOCK(devvp, 0);
if (error)
return (error);
@ -918,7 +918,7 @@ msdosfs_sync(struct mount *mp, int waitfor, struct thread *td)
error = VOP_FSYNC(vp, waitfor, td);
if (error)
allerror = error;
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vrele(vp);
MNT_ILOCK(mp);
}
@ -932,7 +932,7 @@ msdosfs_sync(struct mount *mp, int waitfor, struct thread *td)
error = VOP_FSYNC(pmp->pm_devvp, waitfor, td);
if (error)
allerror = error;
VOP_UNLOCK(pmp->pm_devvp, 0, td);
VOP_UNLOCK(pmp->pm_devvp, 0);
}
return (allerror);
}

View File

@ -982,7 +982,6 @@ msdosfs_rename(ap)
struct vnode *tvp = ap->a_tvp;
struct componentname *tcnp = ap->a_tcnp;
struct componentname *fcnp = ap->a_fcnp;
struct thread *td = fcnp->cn_thread;
struct denode *ip, *xp, *dp, *zp;
u_char toname[11], oldname[11];
u_long from_diroffset, to_diroffset;
@ -1053,7 +1052,7 @@ msdosfs_rename(ap)
(fcnp->cn_flags & ISDOTDOT) ||
(tcnp->cn_flags & ISDOTDOT) ||
(ip->de_flag & DE_RENAME)) {
VOP_UNLOCK(fvp, 0, td);
VOP_UNLOCK(fvp, 0);
error = EINVAL;
goto abortit;
}
@ -1084,7 +1083,7 @@ msdosfs_rename(ap)
* call to doscheckpath().
*/
error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_thread);
VOP_UNLOCK(fvp, 0, td);
VOP_UNLOCK(fvp, 0);
if (VTODE(fdvp)->de_StartCluster != VTODE(tdvp)->de_StartCluster)
newparent = 1;
if (doingdirectory && newparent) {
@ -1153,7 +1152,7 @@ msdosfs_rename(ap)
if ((fcnp->cn_flags & SAVESTART) == 0)
panic("msdosfs_rename: lost from startdir");
if (!newparent)
VOP_UNLOCK(tdvp, 0, td);
VOP_UNLOCK(tdvp, 0);
if (relookup(fdvp, &fvp, fcnp) == 0)
vrele(fdvp);
if (fvp == NULL) {
@ -1163,7 +1162,7 @@ msdosfs_rename(ap)
if (doingdirectory)
panic("rename: lost dir entry");
if (newparent)
VOP_UNLOCK(tdvp, 0, td);
VOP_UNLOCK(tdvp, 0);
vrele(tdvp);
vrele(ap->a_fvp);
return 0;
@ -1183,9 +1182,9 @@ msdosfs_rename(ap)
if (xp != ip) {
if (doingdirectory)
panic("rename: lost dir entry");
VOP_UNLOCK(fvp, 0, td);
VOP_UNLOCK(fvp, 0);
if (newparent)
VOP_UNLOCK(fdvp, 0, td);
VOP_UNLOCK(fdvp, 0);
vrele(ap->a_fvp);
xp = NULL;
} else {
@ -1208,8 +1207,8 @@ msdosfs_rename(ap)
if (error) {
bcopy(oldname, ip->de_Name, 11);
if (newparent)
VOP_UNLOCK(fdvp, 0, td);
VOP_UNLOCK(fvp, 0, td);
VOP_UNLOCK(fdvp, 0);
VOP_UNLOCK(fvp, 0);
goto bad;
}
ip->de_refcnt++;
@ -1218,8 +1217,8 @@ msdosfs_rename(ap)
if (error) {
/* XXX should downgrade to ro here, fs is corrupt */
if (newparent)
VOP_UNLOCK(fdvp, 0, td);
VOP_UNLOCK(fvp, 0, td);
VOP_UNLOCK(fdvp, 0);
VOP_UNLOCK(fvp, 0);
goto bad;
}
if (!doingdirectory) {
@ -1228,8 +1227,8 @@ msdosfs_rename(ap)
if (error) {
/* XXX should downgrade to ro here, fs is corrupt */
if (newparent)
VOP_UNLOCK(fdvp, 0, td);
VOP_UNLOCK(fvp, 0, td);
VOP_UNLOCK(fdvp, 0);
VOP_UNLOCK(fvp, 0);
goto bad;
}
if (ip->de_dirclust == MSDOSFSROOT)
@ -1239,7 +1238,7 @@ msdosfs_rename(ap)
}
reinsert(ip);
if (newparent)
VOP_UNLOCK(fdvp, 0, td);
VOP_UNLOCK(fdvp, 0);
}
/*
@ -1258,7 +1257,7 @@ msdosfs_rename(ap)
if (error) {
/* XXX should downgrade to ro here, fs is corrupt */
brelse(bp);
VOP_UNLOCK(fvp, 0, td);
VOP_UNLOCK(fvp, 0);
goto bad;
}
dotdotp = (struct direntry *)bp->b_data + 1;
@ -1269,12 +1268,12 @@ msdosfs_rename(ap)
bdwrite(bp);
else if ((error = bwrite(bp)) != 0) {
/* XXX should downgrade to ro here, fs is corrupt */
VOP_UNLOCK(fvp, 0, td);
VOP_UNLOCK(fvp, 0);
goto bad;
}
}
VOP_UNLOCK(fvp, 0, td);
VOP_UNLOCK(fvp, 0);
bad:
if (xp)
vput(tvp);
@ -1473,7 +1472,7 @@ msdosfs_rmdir(ap)
* the name cache.
*/
cache_purge(dvp);
VOP_UNLOCK(dvp, 0, td);
VOP_UNLOCK(dvp, 0);
/*
* Truncate the directory that is being deleted.
*/

View File

@ -284,7 +284,7 @@ ntfs_mountfs(devvp, mp, td)
g_topology_unlock();
PICKUP_GIANT();
VOP_UNLOCK(devvp, 0, td);
VOP_UNLOCK(devvp, 0);
if (error)
return (error);

View File

@ -657,7 +657,7 @@ ntfs_lookup(ap)
if(error)
return (error);
VOP_UNLOCK(dvp,0,cnp->cn_thread);
VOP_UNLOCK(dvp,0);
dprintf(("ntfs_lookup: parentdir: %d\n",
vap->va_a_name->n_pnumber));
error = VFS_VGET(ntmp->ntm_mountp, vap->va_a_name->n_pnumber,

View File

@ -108,7 +108,7 @@ nullfs_mount(struct mount *mp, struct thread *td)
*/
if ((mp->mnt_vnodecovered->v_op == &null_vnodeops) &&
VOP_ISLOCKED(mp->mnt_vnodecovered, NULL)) {
VOP_UNLOCK(mp->mnt_vnodecovered, 0, td);
VOP_UNLOCK(mp->mnt_vnodecovered, 0);
isvnunlocked = 1;
}
/*
@ -158,7 +158,7 @@ nullfs_mount(struct mount *mp, struct thread *td)
* Make sure the node alias worked
*/
if (error) {
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vrele(lowerrootvp);
free(xmp, M_NULLFSMNT); /* XXX */
return (error);
@ -175,7 +175,7 @@ nullfs_mount(struct mount *mp, struct thread *td)
/*
* Unlock the node (either the lower or the alias)
*/
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if (NULLVPTOLOWERVP(nullm_rootvp)->v_mount->mnt_flag & MNT_LOCAL) {
MNT_ILOCK(mp);

View File

@ -296,7 +296,7 @@ null_bypass(struct vop_generic_args *ap)
*(vps_p[i]) = old_vps[i];
#if 0
if (reles & VDESC_VP0_WILLUNLOCK)
VOP_UNLOCK(*(vps_p[i]), 0, curthread);
VOP_UNLOCK(*(vps_p[i]), 0);
#endif
if (reles & VDESC_VP0_WILLRELE)
vrele(*(vps_p[i]));
@ -513,7 +513,6 @@ null_lock(struct vop_lock1_args *ap)
{
struct vnode *vp = ap->a_vp;
int flags = ap->a_flags;
struct thread *td = ap->a_td;
struct null_node *nn;
struct vnode *lvp;
int error;
@ -544,7 +543,7 @@ null_lock(struct vop_lock1_args *ap)
* here.
*/
vholdl(lvp);
error = VOP_LOCK(lvp, flags, td);
error = VOP_LOCK(lvp, flags);
/*
* We might have slept to get the lock and someone might have
@ -566,7 +565,7 @@ null_lock(struct vop_lock1_args *ap)
panic("Unsupported lock request %d\n",
ap->a_flags);
}
VOP_UNLOCK(lvp, 0, td);
VOP_UNLOCK(lvp, 0);
error = vop_stdlock(ap);
}
vdrop(lvp);
@ -587,7 +586,6 @@ null_unlock(struct vop_unlock_args *ap)
struct vnode *vp = ap->a_vp;
int flags = ap->a_flags;
int mtxlkflag = 0;
struct thread *td = ap->a_td;
struct null_node *nn;
struct vnode *lvp;
int error;
@ -604,7 +602,7 @@ null_unlock(struct vop_unlock_args *ap)
flags |= LK_INTERLOCK;
vholdl(lvp);
VI_UNLOCK(vp);
error = VOP_UNLOCK(lvp, flags, td);
error = VOP_UNLOCK(lvp, flags);
vdrop(lvp);
if (mtxlkflag == 0)
VI_LOCK(vp);

View File

@ -230,7 +230,7 @@ static int nwfs_mount(struct mount *mp, struct thread *td)
/*
* Lose the lock but keep the ref.
*/
VOP_UNLOCK(vp, 0, curthread);
VOP_UNLOCK(vp, 0);
NCPVODEBUG("rootvp.vrefcnt=%d\n",vrefcnt(vp));
return error;
bad:

View File

@ -958,7 +958,7 @@ printf("dvp %d:%d:%d\n", (int)mp, (int)dvp->v_vflag & VV_ROOT, (int)flags & ISDO
return (0);
}
if (flags & ISDOTDOT) {
VOP_UNLOCK(dvp, 0, td); /* race to get the inode */
VOP_UNLOCK(dvp, 0); /* race to get the inode */
error = nwfs_nget(mp, fid, NULL, NULL, &vp);
vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
if (error)

View File

@ -80,7 +80,7 @@ procfs_doprocfile(PFS_FILL_ARGS)
if (err)
return (err);
vn_fullpath(td, textvp, &fullpath, &freepath);
VOP_UNLOCK(textvp, 0, td);
VOP_UNLOCK(textvp, 0);
sbuf_printf(sb, "%s", fullpath);
if (freepath)
free(freepath, M_TEMP);

View File

@ -268,9 +268,9 @@ pfs_purge(struct pfs_node *pn)
vnp = pvd->pvd_vnode;
vhold(vnp);
mtx_unlock(&pfs_vncache_mutex);
VOP_LOCK(vnp, LK_EXCLUSIVE, curthread);
VOP_LOCK(vnp, LK_EXCLUSIVE);
vgone(vnp);
VOP_UNLOCK(vnp, 0, curthread);
VOP_UNLOCK(vnp, 0);
vdrop(vnp);
mtx_lock(&pfs_vncache_mutex);
pvd = pfs_vncache;

View File

@ -366,7 +366,7 @@ pfs_lookup(struct vop_cachedlookup_args *va)
if (cnp->cn_flags & ISDOTDOT) {
if (pd->pn_type == pfstype_root)
PFS_RETURN (EIO);
VOP_UNLOCK(vn, 0, cnp->cn_thread);
VOP_UNLOCK(vn, 0);
KASSERT(pd->pn_parent != NULL,
("%s(): non-root directory has no parent", __func__));
/*

View File

@ -253,7 +253,7 @@ smbfs_mount(struct mount *mp, struct thread *td)
vfs_mount_error(mp, "smbfs_root error: %d", error);
goto bad;
}
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
SMBVDEBUG("root.v_usecount = %d\n", vrefcnt(vp));
#ifdef DIAGNOSTICS

View File

@ -1247,7 +1247,7 @@ smbfs_lookup(ap)
return 0;
}
if (flags & ISDOTDOT) {
VOP_UNLOCK(dvp, 0, td);
VOP_UNLOCK(dvp, 0);
error = smbfs_nget(mp, dvp, name, nmlen, NULL, &vp);
vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
if (error)

View File

@ -219,7 +219,7 @@ tmpfs_mount(struct mount *mp, struct thread *td)
vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY);
error = VOP_GETATTR(mp->mnt_vnodecovered, &va, mp->mnt_cred, td);
VOP_UNLOCK(mp->mnt_vnodecovered, 0, td);
VOP_UNLOCK(mp->mnt_vnodecovered, 0);
if (error)
return (error);

View File

@ -99,7 +99,7 @@ tmpfs_lookup(struct vop_cachedlookup_args *v)
ltype = VOP_ISLOCKED(dvp, td);
vhold(dvp);
VOP_UNLOCK(dvp, 0, td);
VOP_UNLOCK(dvp, 0);
/* Allocate a new vnode on the matching entry. */
error = tmpfs_alloc_vp(dvp->v_mount, dnode->tn_dir.tn_parent,
cnp->cn_lkflags, vpp, td);
@ -1056,7 +1056,7 @@ tmpfs_rename(struct vop_rename_args *v)
out_locked:
if (fdnode != tdnode)
VOP_UNLOCK(fdvp, 0, tcnp->cn_thread);
VOP_UNLOCK(fdvp, 0);
out:
/* Release target nodes. */

View File

@ -324,7 +324,7 @@ udf_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td) {
error = g_vfs_open(devvp, &cp, "udf", 0);
g_topology_unlock();
PICKUP_GIANT();
VOP_UNLOCK(devvp, 0, td);
VOP_UNLOCK(devvp, 0);
if (error)
return error;

View File

@ -955,7 +955,7 @@ udf_lookup(struct vop_cachedlookup_args *a)
/* Did we have a match? */
if (id) {
if (flags & ISDOTDOT)
VOP_UNLOCK(dvp, 0, a->a_cnp->cn_thread);
VOP_UNLOCK(dvp, 0);
error = udf_vget(udfmp->im_mountp, id, LK_EXCLUSIVE, &tdp);
if (flags & ISDOTDOT)
vn_lock(dvp, LK_EXCLUSIVE|LK_RETRY);

View File

@ -200,9 +200,9 @@ unionfs_noderem(struct vnode *vp, struct thread *td)
vp->v_data = NULL;
lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_INTERLOCK, VI_MTX(vp), td);
if (lvp != NULLVP)
VOP_UNLOCK(lvp, 0, td);
VOP_UNLOCK(lvp, 0);
if (uvp != NULLVP)
VOP_UNLOCK(uvp, 0, td);
VOP_UNLOCK(uvp, 0);
vp->v_object = NULL;
if (lvp != NULLVP) {
@ -381,7 +381,7 @@ unionfs_relookup(struct vnode *dvp, struct vnode **vpp,
cn->cn_flags |= (cnp->cn_flags & SAVESTART);
vref(dvp);
VOP_UNLOCK(dvp, 0, td);
VOP_UNLOCK(dvp, 0);
if ((error = relookup(dvp, vpp, cn))) {
uma_zfree(namei_zone, cn->cn_pnbuf);
@ -776,7 +776,7 @@ unionfs_vn_create_on_upper(struct vnode **vpp, struct vnode *udvp,
*vpp = vp;
unionfs_vn_create_on_upper_free_out1:
VOP_UNLOCK(udvp, 0, td);
VOP_UNLOCK(udvp, 0);
unionfs_vn_create_on_upper_free_out2:
if (cn.cn_flags & HASBUF) {

View File

@ -200,7 +200,7 @@ unionfs_domount(struct mount *mp, struct thread *td)
uid = va.va_uid;
gid = va.va_gid;
}
VOP_UNLOCK(mp->mnt_vnodecovered, 0, td);
VOP_UNLOCK(mp->mnt_vnodecovered, 0);
if (error)
return (error);
@ -288,7 +288,7 @@ unionfs_domount(struct mount *mp, struct thread *td)
* Save reference
*/
if (below) {
VOP_UNLOCK(upperrootvp, 0, td);
VOP_UNLOCK(upperrootvp, 0);
vn_lock(lowerrootvp, LK_EXCLUSIVE | LK_RETRY);
ump->um_lowervp = upperrootvp;
ump->um_uppervp = lowerrootvp;
@ -326,7 +326,7 @@ unionfs_domount(struct mount *mp, struct thread *td)
error = VOP_WHITEOUT(ump->um_uppervp, &fakecn, LOOKUP);
if (error) {
if (below) {
VOP_UNLOCK(ump->um_uppervp, 0, td);
VOP_UNLOCK(ump->um_uppervp, 0);
vrele(upperrootvp);
} else
vput(ump->um_uppervp);
@ -339,7 +339,7 @@ unionfs_domount(struct mount *mp, struct thread *td)
/*
* Unlock the node
*/
VOP_UNLOCK(ump->um_uppervp, 0, td);
VOP_UNLOCK(ump->um_uppervp, 0);
/*
* Get the unionfs root vnode.

View File

@ -137,7 +137,7 @@ unionfs_lookup(struct vop_cachedlookup_args *ap)
if (udvp != NULLVP) {
dtmpvp = udvp;
if (ldvp != NULLVP)
VOP_UNLOCK(ldvp, 0, td);
VOP_UNLOCK(ldvp, 0);
}
else
dtmpvp = ldvp;
@ -145,7 +145,7 @@ unionfs_lookup(struct vop_cachedlookup_args *ap)
error = VOP_LOOKUP(dtmpvp, &vp, cnp);
if (dtmpvp == udvp && ldvp != NULLVP) {
VOP_UNLOCK(udvp, 0, td);
VOP_UNLOCK(udvp, 0);
vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
}
@ -157,10 +157,10 @@ unionfs_lookup(struct vop_cachedlookup_args *ap)
*/
if (nameiop == DELETE || nameiop == RENAME ||
(cnp->cn_lkflags & LK_TYPE_MASK))
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vrele(vp);
VOP_UNLOCK(dvp, 0, td);
VOP_UNLOCK(dvp, 0);
*(ap->a_vpp) = dunp->un_dvp;
vref(dunp->un_dvp);
@ -198,7 +198,7 @@ unionfs_lookup(struct vop_cachedlookup_args *ap)
}
if (nameiop == DELETE || nameiop == RENAME ||
(cnp->cn_lkflags & LK_TYPE_MASK))
VOP_UNLOCK(uvp, 0, td);
VOP_UNLOCK(uvp, 0);
}
/* check whiteout */
@ -242,7 +242,7 @@ unionfs_lookup(struct vop_cachedlookup_args *ap)
return (lerror);
}
if (cnp->cn_lkflags & LK_TYPE_MASK)
VOP_UNLOCK(lvp, 0, td);
VOP_UNLOCK(lvp, 0);
}
}
@ -277,7 +277,7 @@ unionfs_lookup(struct vop_cachedlookup_args *ap)
goto unionfs_lookup_out;
if (LK_SHARED == (cnp->cn_lkflags & LK_TYPE_MASK))
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if (LK_EXCLUSIVE != VOP_ISLOCKED(vp, td)) {
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
lockflag = 1;
@ -285,7 +285,7 @@ unionfs_lookup(struct vop_cachedlookup_args *ap)
error = unionfs_mkshadowdir(MOUNTTOUNIONFSMOUNT(dvp->v_mount),
udvp, VTOUNIONFS(vp), cnp, td);
if (lockflag != 0)
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if (error != 0) {
UNIONFSDEBUG("unionfs_lookup: Unable to create shadow dir.");
if ((cnp->cn_lkflags & LK_TYPE_MASK) == LK_EXCLUSIVE)
@ -342,7 +342,6 @@ unionfs_create(struct vop_create_args *ap)
{
struct unionfs_node *dunp;
struct componentname *cnp;
struct thread *td;
struct vnode *udvp;
struct vnode *vp;
int error;
@ -351,15 +350,14 @@ unionfs_create(struct vop_create_args *ap)
dunp = VTOUNIONFS(ap->a_dvp);
cnp = ap->a_cnp;
td = curthread;
udvp = dunp->un_uppervp;
error = EROFS;
if (udvp != NULLVP) {
if ((error = VOP_CREATE(udvp, &vp, cnp, ap->a_vap)) == 0) {
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
error = unionfs_nodeget(ap->a_dvp->v_mount, vp, NULLVP,
ap->a_dvp, ap->a_vpp, cnp, td);
ap->a_dvp, ap->a_vpp, cnp, curthread);
vrele(vp);
}
}
@ -407,7 +405,6 @@ unionfs_mknod(struct vop_mknod_args *ap)
{
struct unionfs_node *dunp;
struct componentname *cnp;
struct thread *td;
struct vnode *udvp;
struct vnode *vp;
int error;
@ -416,15 +413,14 @@ unionfs_mknod(struct vop_mknod_args *ap)
dunp = VTOUNIONFS(ap->a_dvp);
cnp = ap->a_cnp;
td = curthread;
udvp = dunp->un_uppervp;
error = EROFS;
if (udvp != NULLVP) {
if ((error = VOP_MKNOD(udvp, &vp, cnp, ap->a_vap)) == 0) {
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
error = unionfs_nodeget(ap->a_dvp->v_mount, vp, NULLVP,
ap->a_dvp, ap->a_vpp, cnp, td);
ap->a_dvp, ap->a_vpp, cnp, curthread);
vrele(vp);
}
}
@ -576,7 +572,7 @@ unionfs_close(struct vop_close_args *ap)
unionfs_tryrem_node_status(unp, td, unsp);
if (locked != 0)
VOP_UNLOCK(ap->a_vp, 0, td);
VOP_UNLOCK(ap->a_vp, 0);
UNIONFS_INTERNAL_DEBUG("unionfs_close: leave (%d)\n", error);
@ -882,7 +878,7 @@ unionfs_ioctl(struct vop_ioctl_args *ap)
unionfs_get_node_status(unp, ap->a_td, &unsp);
ovp = (unsp->uns_upper_opencnt ? unp->un_uppervp : unp->un_lowervp);
unionfs_tryrem_node_status(unp, ap->a_td, unsp);
VOP_UNLOCK(ap->a_vp, 0, ap->a_td);
VOP_UNLOCK(ap->a_vp, 0);
if (ovp == NULLVP)
return (EBADF);
@ -907,7 +903,7 @@ unionfs_poll(struct vop_poll_args *ap)
unionfs_get_node_status(unp, ap->a_td, &unsp);
ovp = (unsp->uns_upper_opencnt ? unp->un_uppervp : unp->un_lowervp);
unionfs_tryrem_node_status(unp, ap->a_td, unsp);
VOP_UNLOCK(ap->a_vp, 0, ap->a_td);
VOP_UNLOCK(ap->a_vp, 0);
if (ovp == NULLVP)
return (EBADF);
@ -1111,7 +1107,7 @@ unionfs_rename(struct vop_rename_args *ap)
if ((error = vn_lock(fvp, LK_EXCLUSIVE)) != 0)
goto unionfs_rename_abort;
error = unionfs_copyfile(unp, 1, fcnp->cn_cred, td);
VOP_UNLOCK(fvp, 0, td);
VOP_UNLOCK(fvp, 0);
if (error != 0)
goto unionfs_rename_abort;
break;
@ -1119,7 +1115,7 @@ unionfs_rename(struct vop_rename_args *ap)
if ((error = vn_lock(fvp, LK_EXCLUSIVE)) != 0)
goto unionfs_rename_abort;
error = unionfs_mkshadowdir(ump, rfdvp, unp, fcnp, td);
VOP_UNLOCK(fvp, 0, td);
VOP_UNLOCK(fvp, 0);
if (error != 0)
goto unionfs_rename_abort;
break;
@ -1173,13 +1169,13 @@ unionfs_rename(struct vop_rename_args *ap)
if ((error = vn_lock(fdvp, LK_EXCLUSIVE)) != 0)
goto unionfs_rename_abort;
error = unionfs_relookup_for_delete(fdvp, fcnp, td);
VOP_UNLOCK(fdvp, 0, td);
VOP_UNLOCK(fdvp, 0);
if (error != 0)
goto unionfs_rename_abort;
/* Locke of tvp is canceled in order to avoid recursive lock. */
if (tvp != NULLVP && tvp != tdvp)
VOP_UNLOCK(tvp, 0, td);
VOP_UNLOCK(tvp, 0);
error = unionfs_relookup_for_rename(tdvp, tcnp, td);
if (tvp != NULLVP && tvp != tdvp)
vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY);
@ -1201,11 +1197,11 @@ unionfs_rename(struct vop_rename_args *ap)
if (fvp != rfvp)
vrele(fvp);
if (ltdvp != NULLVP)
VOP_UNLOCK(ltdvp, 0, td);
VOP_UNLOCK(ltdvp, 0);
if (tdvp != rtdvp)
vrele(tdvp);
if (ltvp != NULLVP)
VOP_UNLOCK(ltvp, 0, td);
VOP_UNLOCK(ltvp, 0);
if (tvp != rtvp && tvp != NULLVP) {
if (rtvp == NULLVP)
vput(tvp);
@ -1273,7 +1269,7 @@ unionfs_mkdir(struct vop_mkdir_args *ap)
}
if ((error = VOP_MKDIR(udvp, &uvp, cnp, ap->a_vap)) == 0) {
VOP_UNLOCK(uvp, 0, td);
VOP_UNLOCK(uvp, 0);
cnp->cn_lkflags = LK_EXCLUSIVE;
error = unionfs_nodeget(ap->a_dvp->v_mount, uvp, NULLVP,
ap->a_dvp, ap->a_vpp, cnp, td);
@ -1364,7 +1360,7 @@ unionfs_symlink(struct vop_symlink_args *ap)
if (udvp != NULLVP) {
error = VOP_SYMLINK(udvp, &uvp, cnp, ap->a_vap, ap->a_target);
if (error == 0) {
VOP_UNLOCK(uvp, 0, td);
VOP_UNLOCK(uvp, 0);
cnp->cn_lkflags = LK_EXCLUSIVE;
error = unionfs_nodeget(ap->a_dvp->v_mount, uvp, NULLVP,
ap->a_dvp, ap->a_vpp, cnp, td);
@ -1661,16 +1657,14 @@ unionfs_lock(struct vop_lock1_args *ap)
struct vnode *vp;
struct vnode *uvp;
struct vnode *lvp;
struct thread *td;
error = 0;
uhold = 0;
flags = ap->a_flags;
vp = ap->a_vp;
td = ap->a_td;
if (LK_RELEASE == (flags & LK_TYPE_MASK) || !(flags & LK_TYPE_MASK))
return (VOP_UNLOCK(vp, flags, td));
return (VOP_UNLOCK(vp, flags));
if ((revlock = unionfs_get_llt_revlock(flags)) == 0)
panic("unknown lock type: 0x%x", flags & LK_TYPE_MASK);
@ -1709,14 +1703,14 @@ unionfs_lock(struct vop_lock1_args *ap)
VI_UNLOCK(vp);
ap->a_flags &= ~LK_INTERLOCK;
error = VOP_LOCK(lvp, flags, td);
error = VOP_LOCK(lvp, flags);
VI_LOCK(vp);
unp = VTOUNIONFS(vp);
if (unp == NULL) {
VI_UNLOCK(vp);
if (error == 0)
VOP_UNLOCK(lvp, 0, td);
VOP_UNLOCK(lvp, 0);
vdrop(lvp);
return (vop_stdlock(ap));
}
@ -1731,16 +1725,16 @@ unionfs_lock(struct vop_lock1_args *ap)
VI_UNLOCK(vp);
ap->a_flags &= ~LK_INTERLOCK;
error = VOP_LOCK(uvp, flags, td);
error = VOP_LOCK(uvp, flags);
VI_LOCK(vp);
unp = VTOUNIONFS(vp);
if (unp == NULL) {
VI_UNLOCK(vp);
if (error == 0) {
VOP_UNLOCK(uvp, 0, td);
VOP_UNLOCK(uvp, 0);
if (lvp != NULLVP)
VOP_UNLOCK(lvp, 0, td);
VOP_UNLOCK(lvp, 0);
}
if (lvp != NULLVP)
vdrop(lvp);
@ -1751,7 +1745,7 @@ unionfs_lock(struct vop_lock1_args *ap)
if (error != 0 && lvp != NULLVP) {
VI_UNLOCK(vp);
if ((revlock & LK_TYPE_MASK) == LK_RELEASE)
VOP_UNLOCK(lvp, revlock, td);
VOP_UNLOCK(lvp, revlock);
else
vn_lock(lvp, revlock | LK_RETRY);
goto unionfs_lock_abort;
@ -1811,7 +1805,7 @@ unionfs_unlock(struct vop_unlock_args *ap)
VI_UNLOCK(vp);
ap->a_flags &= ~LK_INTERLOCK;
error = VOP_UNLOCK(lvp, flags, ap->a_td);
error = VOP_UNLOCK(lvp, flags);
VI_LOCK(vp);
}
@ -1825,7 +1819,7 @@ unionfs_unlock(struct vop_unlock_args *ap)
VI_UNLOCK(vp);
ap->a_flags &= ~LK_INTERLOCK;
error = VOP_UNLOCK(uvp, flags, ap->a_td);
error = VOP_UNLOCK(uvp, flags);
VI_LOCK(vp);
}
@ -1898,7 +1892,7 @@ unionfs_advlock(struct vop_advlock_args *ap)
unionfs_tryrem_node_status(unp, td, unsp);
}
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
error = VOP_ADVLOCK(uvp, ap->a_id, ap->a_op, ap->a_fl, ap->a_flags);
@ -1907,7 +1901,7 @@ unionfs_advlock(struct vop_advlock_args *ap)
return error;
unionfs_advlock_abort:
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
UNIONFS_INTERNAL_DEBUG("unionfs_advlock: leave (%d)\n", error);

View File

@ -318,7 +318,6 @@ ext2_lookup(ap)
struct ucred *cred = cnp->cn_cred;
int flags = cnp->cn_flags;
int nameiop = cnp->cn_nameiop;
struct thread *td = cnp->cn_thread;
ino_t saved_ino;
int DIRBLKSIZ = VTOI(ap->a_dvp)->i_e2fs->s_blocksize;
@ -657,7 +656,7 @@ ext2_lookup(ap)
pdp = vdp;
if (flags & ISDOTDOT) {
saved_ino = dp->i_ino;
VOP_UNLOCK(pdp, 0, td); /* race to get the inode */
VOP_UNLOCK(pdp, 0); /* race to get the inode */
error = VFS_VGET(vdp->v_mount, saved_ino, LK_EXCLUSIVE, &tdp);
vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY);
if (error != 0)

View File

@ -205,10 +205,10 @@ ext2_mount(mp, td)
if (error)
error = priv_check(td, PRIV_VFS_MOUNT_PERM);
if (error) {
VOP_UNLOCK(devvp, 0, td);
VOP_UNLOCK(devvp, 0);
return (error);
}
VOP_UNLOCK(devvp, 0, td);
VOP_UNLOCK(devvp, 0);
DROP_GIANT();
g_topology_lock();
error = g_access(ump->um_cp, 0, 1, 0);
@ -520,7 +520,7 @@ ext2_reload(struct mount *mp, struct thread *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);
VOP_UNLOCK(devvp, 0);
/*
* Step 2: re-read superblock from disk.
@ -572,7 +572,7 @@ ext2_reload(struct mount *mp, struct thread *td)
bread(devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)),
(int)fs->s_blocksize, NOCRED, &bp);
if (error) {
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vrele(vp);
MNT_VNODE_FOREACH_ABORT(mp, mvp);
return (error);
@ -580,7 +580,7 @@ ext2_reload(struct mount *mp, struct thread *td)
ext2_ei2i((struct ext2_inode *) ((char *)bp->b_data +
EXT2_INODE_SIZE * ino_to_fsbo(fs, ip->i_number)), ip);
brelse(bp);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vrele(vp);
MNT_ILOCK(mp);
}
@ -614,7 +614,7 @@ ext2_mountfs(devvp, mp, td)
error = g_vfs_open(devvp, &cp, "ext2fs", ronly ? 0 : 1);
g_topology_unlock();
PICKUP_GIANT();
VOP_UNLOCK(devvp, 0, td);
VOP_UNLOCK(devvp, 0);
if (error)
return (error);
@ -907,7 +907,7 @@ ext2_sync(mp, waitfor, td)
}
if ((error = VOP_FSYNC(vp, waitfor, td)) != 0)
allerror = error;
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vrele(vp);
MNT_ILOCK(mp);
}
@ -919,7 +919,7 @@ ext2_sync(mp, waitfor, 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);
VOP_UNLOCK(ump->um_devvp, 0);
}
/*
* Write back modified superblock.

View File

@ -767,7 +767,6 @@ ext2_rename(ap)
struct vnode *fdvp = ap->a_fdvp;
struct componentname *tcnp = ap->a_tcnp;
struct componentname *fcnp = ap->a_fcnp;
struct thread *td = fcnp->cn_thread;
struct inode *ip, *xp, *dp;
struct dirtemplate dirbuf;
int doingdirectory = 0, oldparent = 0, newparent = 0;
@ -818,13 +817,13 @@ ext2_rename(ap)
dp = VTOI(fdvp);
ip = VTOI(fvp);
if (ip->i_nlink >= LINK_MAX) {
VOP_UNLOCK(fvp, 0, td);
VOP_UNLOCK(fvp, 0);
error = EMLINK;
goto abortit;
}
if ((ip->i_flags & (NOUNLINK | IMMUTABLE | APPEND))
|| (dp->i_flags & APPEND)) {
VOP_UNLOCK(fvp, 0, td);
VOP_UNLOCK(fvp, 0);
error = EPERM;
goto abortit;
}
@ -835,7 +834,7 @@ ext2_rename(ap)
if ((fcnp->cn_namelen == 1 && fcnp->cn_nameptr[0] == '.') ||
dp == ip || (fcnp->cn_flags | tcnp->cn_flags) & ISDOTDOT ||
(ip->i_flag & IN_RENAME)) {
VOP_UNLOCK(fvp, 0, td);
VOP_UNLOCK(fvp, 0);
error = EINVAL;
goto abortit;
}
@ -863,7 +862,7 @@ ext2_rename(ap)
ip->i_nlink++;
ip->i_flag |= IN_CHANGE;
if ((error = ext2_update(fvp, 1)) != 0) {
VOP_UNLOCK(fvp, 0, td);
VOP_UNLOCK(fvp, 0);
goto bad;
}
@ -878,7 +877,7 @@ ext2_rename(ap)
* call to checkpath().
*/
error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_thread);
VOP_UNLOCK(fvp, 0, td);
VOP_UNLOCK(fvp, 0);
if (oldparent != dp->i_number)
newparent = dp->i_number;
if (doingdirectory && newparent) {
@ -1264,7 +1263,6 @@ ext2_rmdir(ap)
struct vnode *vp = ap->a_vp;
struct vnode *dvp = ap->a_dvp;
struct componentname *cnp = ap->a_cnp;
struct thread *td = cnp->cn_thread;
struct inode *ip, *dp;
int error;
@ -1299,7 +1297,7 @@ ext2_rmdir(ap)
dp->i_nlink--;
dp->i_flag |= IN_CHANGE;
cache_purge(dvp);
VOP_UNLOCK(dvp, 0, td);
VOP_UNLOCK(dvp, 0);
/*
* Truncate inode. The only stuff left
* in the directory is "." and "..". The
@ -1312,7 +1310,8 @@ ext2_rmdir(ap)
* worry about them later.
*/
ip->i_nlink -= 2;
error = ext2_truncate(vp, (off_t)0, IO_SYNC, cnp->cn_cred, td);
error = ext2_truncate(vp, (off_t)0, IO_SYNC, cnp->cn_cred,
cnp->cn_thread);
cache_purge(ITOV(ip));
vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
out:

View File

@ -146,7 +146,7 @@ extern u_char *fragtbl[];
*/
#define DEVVP(inode) (VFSTOEXT2(ITOV(inode)->v_mount)->um_devvp)
#define lock_super(devvp) vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY)
#define unlock_super(devvp) VOP_UNLOCK(devvp, 0, curthread)
#define unlock_super(devvp) VOP_UNLOCK(devvp, 0)
/*
* Historically, ext2fs kept it's metadata buffers on the LOCKED queue. Now,

View File

@ -804,7 +804,7 @@ reiserfs_iget(
vp->v_vflag |= VV_ROOT;
#if 0
if (VOP_LOCK(vp, LK_EXCLUSIVE, td) != 0)
if (VOP_LOCK(vp, LK_EXCLUSIVE) != 0)
panic("reiserfs/iget: unexpected lock failure");
/*

View File

@ -79,7 +79,7 @@ reiserfs_lookup(struct vop_cachedlookup_args *ap)
pdp = vdp;
if (flags & ISDOTDOT) {
saved_ino = (struct cpu_key *)&(de.de_dir_id);
VOP_UNLOCK(pdp, 0, td);
VOP_UNLOCK(pdp, 0);
error = reiserfs_iget(vdp->v_mount,
saved_ino, &vp, td);
vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY);

View File

@ -449,7 +449,7 @@ reiserfs_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td)
error = vinvalbuf(devvp, V_SAVE, td->td_ucred, td, 0, 0);
if (error) {
VOP_UNLOCK(devvp, 0, td);
VOP_UNLOCK(devvp, 0);
return (error);
}
@ -458,7 +458,7 @@ reiserfs_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td)
* for now
*/
error = VOP_OPEN(devvp, FREAD, FSCRED, td, NULL);
VOP_UNLOCK(devvp, 0, td);
VOP_UNLOCK(devvp, 0);
if (error)
return (error);
#else
@ -467,7 +467,7 @@ reiserfs_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td)
error = g_vfs_open(devvp, &cp, "reiserfs", /* read-only */ 0);
g_topology_unlock();
PICKUP_GIANT();
VOP_UNLOCK(devvp, 0, td);
VOP_UNLOCK(devvp, 0);
if (error)
return (error);

View File

@ -302,7 +302,7 @@ _xfs_root(mp, flags, vpp, td)
XVFS_ROOT(MNTTOVFS(mp), &vp, error);
if (error == 0) {
*vpp = vp->v_vnode;
VOP_LOCK(*vpp, flags, curthread);
VOP_LOCK(*vpp, flags);
}
return (error);
}

View File

@ -105,7 +105,7 @@ xfs_initialize_vnode(
* and unlock the inode.
*/
if (ip->i_d.di_mode != 0 && unlock)
VOP_UNLOCK(xvp->v_vnode, 0, curthread);
VOP_UNLOCK(xvp->v_vnode, 0);
}
#if 0
@ -189,7 +189,7 @@ xfs_blkdev_get(
vput(devvp);
return (error);
}
VOP_UNLOCK(devvp, 0, td);
VOP_UNLOCK(devvp, 0);
devvp->v_bufobj.bo_private = cp;
devvp->v_bufobj.bo_ops = &xfs_bo_ops;

View File

@ -139,7 +139,7 @@ vn_purge(struct xfs_vnode *xfs_vp)
if (vp->v_holdcnt == 0)
vhold(vp);
vgone(vp);
VOP_UNLOCK(vp, 0, curthread);
VOP_UNLOCK(vp, 0);
}
void xfs_ichgtime(

View File

@ -751,7 +751,7 @@ _xfs_create(
if (error == 0) {
*ap->a_vpp = xvp->v_vnode;
VOP_LOCK(xvp->v_vnode, LK_EXCLUSIVE, td);
VOP_LOCK(xvp->v_vnode, LK_EXCLUSIVE);
}
return (error);
@ -886,7 +886,7 @@ _xfs_symlink(
if (error == 0) {
*ap->a_vpp = xvp->v_vnode;
VOP_LOCK(xvp->v_vnode, LK_EXCLUSIVE, td);
VOP_LOCK(xvp->v_vnode, LK_EXCLUSIVE);
}
return (error);
@ -922,7 +922,7 @@ _xfs_mknod(
if (error == 0) {
*ap->a_vpp = xvp->v_vnode;
VOP_LOCK(xvp->v_vnode, LK_EXCLUSIVE, td);
VOP_LOCK(xvp->v_vnode, LK_EXCLUSIVE);
}
return (error);
@ -956,7 +956,7 @@ _xfs_mkdir(
if (error == 0) {
*ap->a_vpp = xvp->v_vnode;
VOP_LOCK(xvp->v_vnode, LK_EXCLUSIVE, td);
VOP_LOCK(xvp->v_vnode, LK_EXCLUSIVE);
}
return (error);
@ -1322,7 +1322,7 @@ _xfs_cachedlookup(
}
if (flags & ISDOTDOT) {
VOP_UNLOCK(dvp, 0, td);
VOP_UNLOCK(dvp, 0);
error = vn_lock(tvp, cnp->cn_lkflags);
if (error) {
vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);

View File

@ -462,7 +462,7 @@ ibcs2_getdents(td, uap)
eof:
td->td_retval[0] = uap->nbytes - resid;
out:
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
fdrop(fp, td);
if (cookies)
@ -628,7 +628,7 @@ ibcs2_read(td, uap)
eof:
td->td_retval[0] = uap->nbytes - resid;
out:
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
fdrop(fp, td);
if (cookies)

View File

@ -211,7 +211,7 @@ coff_load_file(struct thread *td, char *name)
* Lose the lock on the vnode. It's no longer needed, and must not
* exist for the pagefault paging to work below.
*/
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if ((error = vm_mmap(kernel_map,
(vm_offset_t *) &ptr,
@ -285,7 +285,7 @@ coff_load_file(struct thread *td, char *name)
panic("%s vm_map_remove failed", __func__);
fail:
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
unlocked_fail:
NDFREE(&nd, NDF_ONLY_PNBUF);
vrele(nd.ni_vp);
@ -307,7 +307,6 @@ exec_coff_imgact(imgp)
unsigned long data_offset = 0, data_address = 0, data_size = 0;
unsigned long bss_size = 0;
caddr_t hole;
struct thread *td = curthread;
if (fhdr->f_magic != I386_COFF ||
!(fhdr->f_flags & F_EXEC)) {
@ -335,7 +334,7 @@ exec_coff_imgact(imgp)
((const char*)(imgp->image_header) + sizeof(struct filehdr) +
sizeof(struct aouthdr));
VOP_UNLOCK(imgp->vp, 0, td);
VOP_UNLOCK(imgp->vp, 0);
error = exec_new_vmspace(imgp, &ibcs2_svr3_sysvec);
if (error)

View File

@ -65,7 +65,6 @@ exec_linux_imgact(struct image_params *imgp)
unsigned long virtual_offset, file_offset;
vm_offset_t buffer;
unsigned long bss_size;
struct thread *td = curthread;
int error;
if (((a_out->a_magic >> 16) & 0xff) != 0x64)
@ -114,7 +113,7 @@ exec_linux_imgact(struct image_params *imgp)
}
PROC_UNLOCK(imgp->proc);
VOP_UNLOCK(imgp->vp, 0, td);
VOP_UNLOCK(imgp->vp, 0);
/*
* Destroy old process VM and create a new one (with a new stack)

View File

@ -192,7 +192,7 @@ exec_aout_imgact(imgp)
* However, in cases where the vnode lock is external, such as nullfs,
* v_usecount may become zero.
*/
VOP_UNLOCK(imgp->vp, 0, curthread);
VOP_UNLOCK(imgp->vp, 0);
/*
* Destroy old process VM and create a new one (with a new stack)

View File

@ -617,7 +617,6 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
const Elf_Note *note, *note_end;
char *path;
const char *note_name;
struct thread *td = curthread;
struct sysentvec *sv;
/*
@ -675,7 +674,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
* However, in cases where the vnode lock is external, such as nullfs,
* v_usecount may become zero.
*/
VOP_UNLOCK(imgp->vp, 0, td);
VOP_UNLOCK(imgp->vp, 0);
error = exec_new_vmspace(imgp, sv);
imgp->proc->p_sysent = sv;
@ -803,7 +802,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
if (interp != NULL) {
int have_interp = FALSE;
VOP_UNLOCK(imgp->vp, 0, td);
VOP_UNLOCK(imgp->vp, 0);
if (brand_info->emul_path != NULL &&
brand_info->emul_path[0] != '\0') {
path = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);

View File

@ -158,7 +158,6 @@ static int
do_aout_hdr(struct imgact_gzip * gz)
{
int error;
struct thread *td = curthread;
struct vmspace *vmspace;
vm_offset_t vmaddr;
@ -234,7 +233,7 @@ do_aout_hdr(struct imgact_gzip * gz)
* However, in cases where the vnode lock is external, such as nullfs,
* v_usecount may become zero.
*/
VOP_UNLOCK(gz->ip->vp, 0, td);
VOP_UNLOCK(gz->ip->vp, 0);
/*
* Destroy old process VM and create a new one (with a new stack)

View File

@ -220,13 +220,13 @@ acct(struct thread *td, struct acct_args *uap)
#ifdef MAC
error = mac_system_check_acct(td->td_ucred, nd.ni_vp);
if (error) {
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
vn_close(nd.ni_vp, flags, td->td_ucred, td);
VFS_UNLOCK_GIANT(vfslocked);
return (error);
}
#endif
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
if (nd.ni_vp->v_type != VREG) {
vn_close(nd.ni_vp, flags, td->td_ucred, td);
VFS_UNLOCK_GIANT(vfslocked);

View File

@ -303,7 +303,7 @@ alq_doio(struct alq *alq)
if (mac_vnode_check_write(alq->aq_cred, NOCRED, vp) == 0)
#endif
VOP_WRITE(vp, &auio, IO_UNIT | IO_APPEND, alq->aq_cred);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
VFS_UNLOCK_GIANT(vfslocked);
@ -363,7 +363,7 @@ alq_open(struct alq **alqp, const char *file, struct ucred *cred, int cmode,
vfslocked = NDHASGIANT(&nd);
NDFREE(&nd, NDF_ONLY_PNBUF);
/* We just unlock so we hold a reference */
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
alq = malloc(sizeof(*alq), M_ALD, M_WAITOK|M_ZERO);

View File

@ -1185,7 +1185,7 @@ fpathconf(struct thread *td, struct fpathconf_args *uap)
vfslocked = VFS_LOCK_GIANT(vp->v_mount);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_PATHCONF(vp, uap->name, td->td_retval);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
} else if (fp->f_type == DTYPE_PIPE || fp->f_type == DTYPE_SOCKET) {
if (uap->name != _PC_PIPE_BUF) {

View File

@ -491,7 +491,7 @@ do_execve(td, args, mac_p)
}
/* close files on exec */
VOP_UNLOCK(imgp->vp, 0, td);
VOP_UNLOCK(imgp->vp, 0);
fdcloseexec(td);
vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY);
@ -591,7 +591,7 @@ do_execve(td, args, mac_p)
*/
PROC_UNLOCK(p);
setugidsafety(td);
VOP_UNLOCK(imgp->vp, 0, td);
VOP_UNLOCK(imgp->vp, 0);
error = fdcheckstd(td);
vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY);
if (error != 0)
@ -725,7 +725,7 @@ do_execve(td, args, mac_p)
crfree(oldcred);
else
crfree(newcred);
VOP_UNLOCK(imgp->vp, 0, td);
VOP_UNLOCK(imgp->vp, 0);
/*
* Handle deferred decrement of ref counts.
*/

View File

@ -326,7 +326,7 @@ exit1(struct thread *td, int rv)
sp->s_ttyvp = NULL;
SESS_UNLOCK(p->p_session);
sx_xunlock(&proctree_lock);
VOP_LOCK(ttyvp, LK_EXCLUSIVE, td);
VOP_LOCK(ttyvp, LK_EXCLUSIVE);
VOP_REVOKE(ttyvp, REVOKEALL);
vput(ttyvp);
sx_xlock(&proctree_lock);

View File

@ -148,7 +148,7 @@ jail(struct thread *td, struct jail_args *uap)
goto e_killmtx;
vfslocked = NDHASGIANT(&nd);
pr->pr_root = nd.ni_vp;
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
NDFREE(&nd, NDF_ONLY_PNBUF);
VFS_UNLOCK_GIANT(vfslocked);
error = copyinstr(j.hostname, &pr->pr_host, sizeof(pr->pr_host), 0);
@ -261,7 +261,7 @@ jail_attach(struct thread *td, struct jail_attach_args *uap)
if ((error = mac_vnode_check_chroot(td->td_ucred, pr->pr_root)))
goto e_unlock;
#endif
VOP_UNLOCK(pr->pr_root, 0, td);
VOP_UNLOCK(pr->pr_root, 0);
change_root(pr->pr_root, td);
VFS_UNLOCK_GIANT(vfslocked);
@ -276,7 +276,7 @@ jail_attach(struct thread *td, struct jail_attach_args *uap)
crfree(oldcred);
return (0);
e_unlock:
VOP_UNLOCK(pr->pr_root, 0, td);
VOP_UNLOCK(pr->pr_root, 0);
VFS_UNLOCK_GIANT(vfslocked);
mtx_lock(&pr->pr_mtx);
pr->pr_ref--;

View File

@ -604,7 +604,7 @@ ktrace(td, uap)
vfslocked = NDHASGIANT(&nd);
NDFREE(&nd, NDF_ONLY_PNBUF);
vp = nd.ni_vp;
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if (vp->v_type != VREG) {
(void) vn_close(vp, FREAD|FWRITE, td->td_ucred, td);
VFS_UNLOCK_GIANT(vfslocked);
@ -931,7 +931,7 @@ ktr_writerequest(struct thread *td, struct ktr_request *req)
if (error == 0)
#endif
error = VOP_WRITE(vp, &auio, IO_UNIT | IO_APPEND, cred);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
vrele(vp);
VFS_UNLOCK_GIANT(vfslocked);

View File

@ -1632,7 +1632,7 @@ linker_lookup_file(const char *path, int pathlen, const char *name,
type = nd.ni_vp->v_type;
if (vap)
VOP_GETATTR(nd.ni_vp, vap, td->td_ucred, td);
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
vn_close(nd.ni_vp, FREAD, td->td_ucred, td);
VFS_UNLOCK_GIANT(vfslocked);
if (type == VREG)
@ -1701,7 +1701,7 @@ linker_hints_lookup(const char *path, int pathlen, const char *modname,
UIO_SYSSPACE, IO_NODELOCKED, cred, NOCRED, &reclen, td);
if (error)
goto bad;
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
vn_close(nd.ni_vp, FREAD, cred, td);
VFS_UNLOCK_GIANT(vfslocked);
nd.ni_vp = NULL;
@ -1770,7 +1770,7 @@ linker_hints_lookup(const char *path, int pathlen, const char *modname,
if (hints)
free(hints, M_TEMP);
if (nd.ni_vp != NULL) {
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
vn_close(nd.ni_vp, FREAD, cred, td);
VFS_UNLOCK_GIANT(vfslocked);
}

View File

@ -3113,12 +3113,12 @@ coredump(struct thread *td)
/* Don't dump to non-regular files or files with links. */
if (vp->v_type != VREG ||
VOP_GETATTR(vp, &vattr, cred, td) || vattr.va_nlink != 1) {
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
error = EFAULT;
goto close;
}
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
lf.l_whence = SEEK_SET;
lf.l_start = 0;
lf.l_len = 0;
@ -3144,7 +3144,7 @@ coredump(struct thread *td)
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
VOP_LEASE(vp, td, cred, LEASE_WRITE);
VOP_SETATTR(vp, &vattr, cred, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
PROC_LOCK(p);
p->p_acflag |= ACORE;

View File

@ -862,7 +862,7 @@ link_elf_load_file(linker_class_t cls, const char* filename,
free(shdr, M_LINKER);
if (firstpage)
free(firstpage, M_LINKER);
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
vn_close(nd.ni_vp, FREAD, td->td_ucred, td);
VFS_UNLOCK_GIANT(vfslocked);

View File

@ -788,7 +788,7 @@ link_elf_load_file(linker_class_t cls, const char *filename,
linker_file_unload(lf, LINKER_UNLOAD_FORCE);
if (hdr)
free(hdr, M_LINKER);
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
vn_close(nd.ni_vp, FREAD, td->td_ucred, td);
VFS_UNLOCK_GIANT(vfslocked);

View File

@ -405,7 +405,7 @@ cn_devopen(struct cn_device *cnd, struct thread *td, int forceopen)
error = vn_open(&nd, &openflag, 0, NULL);
if (error == 0) {
NDFREE(&nd, NDF_ONLY_PNBUF);
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
if (nd.ni_vp->v_type == VCHR)
cnd->cnd_vp = nd.ni_vp;
else

View File

@ -819,7 +819,7 @@ mqfs_lookupx(struct vop_cachedlookup_args *ap)
return (EIO);
if ((flags & ISLASTCN) && nameiop != LOOKUP)
return (EINVAL);
VOP_UNLOCK(dvp, 0, cnp->cn_thread);
VOP_UNLOCK(dvp, 0);
KASSERT(pd->mn_parent, ("non-root directory has no parent"));
pn = pd->mn_parent;
error = mqfs_allocv(dvp->v_mount, vpp, pn);

View File

@ -1794,7 +1794,7 @@ kern_sendfile(struct thread *td, struct sendfile_args *uap,
obj = NULL;
}
}
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
if (obj == NULL) {
error = EINVAL;
@ -2036,7 +2036,7 @@ kern_sendfile(struct thread *td, struct sendfile_args *uap,
trunc_page(off), UIO_NOCOPY, IO_NODELOCKED |
IO_VMIO | ((MAXBSIZE / bsize) << IO_SEQSHIFT),
td->td_ucred, NOCRED, &resid, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
VM_OBJECT_LOCK(obj);
vm_page_io_finish(pg);

View File

@ -474,7 +474,7 @@ uipc_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
unp->unp_flags &= ~UNP_BINDING;
UNP_PCB_UNLOCK(unp);
UNP_GLOBAL_WUNLOCK();
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
VFS_UNLOCK_GIANT(vfslocked);
free(buf, M_TEMP);

View File

@ -101,7 +101,7 @@ vacl_set_acl(struct thread *td, struct vnode *vp, acl_type_t type,
#ifdef MAC
out:
#endif
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
return(error);
}
@ -127,7 +127,7 @@ vacl_get_acl(struct thread *td, struct vnode *vp, acl_type_t type,
#ifdef MAC
out:
#endif
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if (error == 0)
error = copyout(&inkernelacl, aclp, sizeof(struct acl));
return (error);
@ -156,7 +156,7 @@ vacl_delete(struct thread *td, struct vnode *vp, acl_type_t type)
#ifdef MAC
out:
#endif
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
return (error);
}

View File

@ -772,7 +772,7 @@ aio_fsync_vnode(struct thread *td, struct vnode *vp)
}
error = VOP_FSYNC(vp, MNT_WAIT, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
drop:
VFS_UNLOCK_GIANT(vfslocked);

View File

@ -2136,7 +2136,6 @@ SYSCTL_INT(_vfs, OID_AUTO, flushwithdeps, CTLFLAG_RW, &flushwithdeps,
static int
flushbufqueues(int queue, int flushdeps)
{
struct thread *td = curthread;
struct buf sentinel;
struct vnode *vp;
struct mount *mp;
@ -2212,7 +2211,7 @@ flushbufqueues(int queue, int flushdeps)
bp, bp->b_vp, bp->b_flags);
vfs_bio_awrite(bp);
vn_finished_write(mp);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
flushwithdeps += hasdeps;
flushed++;
waitrunningbufspace();

View File

@ -435,7 +435,7 @@ cache_lookup(dvp, vpp, cnp)
ltype = 0; /* silence gcc warning */
if (cnp->cn_flags & ISDOTDOT) {
ltype = VOP_ISLOCKED(dvp, td);
VOP_UNLOCK(dvp, 0, td);
VOP_UNLOCK(dvp, 0);
}
VI_LOCK(*vpp);
CACHE_UNLOCK();

View File

@ -263,7 +263,8 @@ vop_stdlock(ap)
{
struct vnode *vp = ap->a_vp;
return (_lockmgr(vp->v_vnlock, ap->a_flags, VI_MTX(vp), ap->a_td, ap->a_file, ap->a_line));
return (_lockmgr(vp->v_vnlock, ap->a_flags, VI_MTX(vp), curthread,
ap->a_file, ap->a_line));
}
/* See above. */
@ -278,7 +279,7 @@ vop_stdunlock(ap)
struct vnode *vp = ap->a_vp;
return (lockmgr(vp->v_vnlock, ap->a_flags | LK_RELEASE, VI_MTX(vp),
ap->a_td));
curthread));
}
/* See above. */
@ -594,7 +595,7 @@ vfs_stdsync(mp, waitfor, td)
allerror = error;
/* Do not turn this into vput. td is not always curthread. */
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vrele(vp);
MNT_ILOCK(mp);
}
@ -660,7 +661,7 @@ vfs_stdextattrctl(mp, cmd, filename_vp, attrnamespace, attrname, td)
{
if (filename_vp != NULL)
VOP_UNLOCK(filename_vp, 0, td);
VOP_UNLOCK(filename_vp, 0);
return (EOPNOTSUPP);
}

View File

@ -192,7 +192,7 @@ extattr_set_vp(struct vnode *vp, int attrnamespace, const char *attrname,
td->td_retval[0] = cnt;
done:
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
return (error);
}
@ -374,7 +374,7 @@ extattr_get_vp(struct vnode *vp, int attrnamespace, const char *attrname,
td->td_retval[0] = size;
done:
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
return (error);
}
@ -526,7 +526,7 @@ extattr_delete_vp(struct vnode *vp, int attrnamespace, const char *attrname,
#ifdef MAC
done:
#endif
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
return (error);
}
@ -691,7 +691,7 @@ extattr_list_vp(struct vnode *vp, int attrnamespace, void *data,
td->td_retval[0] = size;
done:
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
return (error);
}

View File

@ -495,7 +495,7 @@ lookup(struct nameidata *ndp)
AUDIT_ARG(vnode, dp, ARG_VNODE2);
if (!(cnp->cn_flags & (LOCKPARENT | LOCKLEAF)))
VOP_UNLOCK(dp, 0, td);
VOP_UNLOCK(dp, 0);
/* XXX This should probably move to the top of function. */
if (cnp->cn_flags & SAVESTART)
panic("lookup: SAVESTART");
@ -626,7 +626,7 @@ lookup(struct nameidata *ndp)
goto bad;
}
if ((cnp->cn_flags & LOCKPARENT) == 0)
VOP_UNLOCK(dp, 0, td);
VOP_UNLOCK(dp, 0);
/*
* This is a temporary assert to make sure I know what the
* behavior here was.
@ -713,7 +713,7 @@ lookup(struct nameidata *ndp)
* Symlink code always expects an unlocked dvp.
*/
if (ndp->ni_dvp != ndp->ni_vp)
VOP_UNLOCK(ndp->ni_dvp, 0, td);
VOP_UNLOCK(ndp->ni_dvp, 0);
goto success;
}
@ -767,7 +767,7 @@ lookup(struct nameidata *ndp)
VFS_UNLOCK_GIANT(dvfslocked);
dvfslocked = 0;
} else if ((cnp->cn_flags & LOCKPARENT) == 0 && ndp->ni_dvp != dp)
VOP_UNLOCK(ndp->ni_dvp, 0, td);
VOP_UNLOCK(ndp->ni_dvp, 0);
if (cnp->cn_flags & AUDITVNODE1)
AUDIT_ARG(vnode, dp, ARG_VNODE1);
@ -775,7 +775,7 @@ lookup(struct nameidata *ndp)
AUDIT_ARG(vnode, dp, ARG_VNODE2);
if ((cnp->cn_flags & LOCKLEAF) == 0)
VOP_UNLOCK(dp, 0, td);
VOP_UNLOCK(dp, 0);
success:
/*
* Because of lookup_shared we may have the vnode shared locked, but
@ -813,7 +813,6 @@ lookup(struct nameidata *ndp)
int
relookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp)
{
struct thread *td = cnp->cn_thread;
struct vnode *dp = 0; /* the directory we are searching */
int wantparent; /* 1 => wantparent or lockparent flag */
int rdonly; /* lookup read-only flag bit */
@ -859,7 +858,7 @@ relookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp)
goto bad;
}
if (!(cnp->cn_flags & LOCKLEAF))
VOP_UNLOCK(dp, 0, td);
VOP_UNLOCK(dp, 0);
*vpp = dp;
/* XXX This should probably move to the top of function. */
if (cnp->cn_flags & SAVESTART)
@ -892,7 +891,7 @@ relookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp)
if (cnp->cn_flags & SAVESTART)
VREF(dvp);
if ((cnp->cn_flags & LOCKPARENT) == 0)
VOP_UNLOCK(dp, 0, td);
VOP_UNLOCK(dp, 0);
/*
* This is a temporary assert to make sure I know what the
* behavior here was.
@ -926,7 +925,7 @@ relookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp)
*/
if ((cnp->cn_flags & LOCKPARENT) == 0 && dvp != dp) {
if (wantparent)
VOP_UNLOCK(dvp, 0, td);
VOP_UNLOCK(dvp, 0);
else
vput(dvp);
} else if (!wantparent)
@ -942,7 +941,7 @@ relookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp)
VREF(dvp);
if ((cnp->cn_flags & LOCKLEAF) == 0)
VOP_UNLOCK(dp, 0, td);
VOP_UNLOCK(dp, 0);
return (0);
bad:
vput(dp);
@ -979,7 +978,7 @@ NDFREE(struct nameidata *ndp, const u_int flags)
ndp->ni_vp = NULL;
}
if (unlock_vp)
VOP_UNLOCK(ndp->ni_vp, 0, ndp->ni_cnd.cn_thread);
VOP_UNLOCK(ndp->ni_vp, 0);
if (!(flags & NDF_NO_DVP_UNLOCK) &&
(ndp->ni_cnd.cn_flags & LOCKPARENT) &&
ndp->ni_dvp != ndp->ni_vp)
@ -994,7 +993,7 @@ NDFREE(struct nameidata *ndp, const u_int flags)
ndp->ni_dvp = NULL;
}
if (unlock_dvp)
VOP_UNLOCK(ndp->ni_dvp, 0, ndp->ni_cnd.cn_thread);
VOP_UNLOCK(ndp->ni_dvp, 0);
if (!(flags & NDF_NO_STARTDIR_RELE) &&
(ndp->ni_cnd.cn_flags & SAVESTART)) {
vrele(ndp->ni_startdir);

View File

@ -939,7 +939,7 @@ vfs_domount(
mp->mnt_flag |= fsflags &
(MNT_RELOAD | MNT_FORCE | MNT_UPDATE | MNT_SNAPSHOT | MNT_ROOTFS);
MNT_IUNLOCK(mp);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
mp->mnt_optnew = fsdata;
vfs_mergeopts(mp->mnt_optnew, mp->mnt_opt);
} else {
@ -983,7 +983,7 @@ vfs_domount(
* Allocate and initialize the filesystem.
*/
mp = vfs_mount_alloc(vp, vfsp, fspath, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
/* XXXMAC: pass to vfs_mount_alloc? */
mp->mnt_optnew = fsdata;
@ -1081,7 +1081,7 @@ vfs_domount(
panic("mount: lost mount");
mountcheckdirs(vp, newdp);
vput(newdp);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if ((mp->mnt_flag & MNT_RDONLY) == 0)
error = vfs_allocate_syncvnode(mp);
vfs_unbusy(mp, td);
@ -1212,7 +1212,7 @@ dounmount(mp, flags, td)
*/
if (coveredvp->v_mountedhere != mp ||
coveredvp->v_mountedhere->mnt_gen != mnt_gen_r) {
VOP_UNLOCK(coveredvp, 0, td);
VOP_UNLOCK(coveredvp, 0);
return (EBUSY);
}
}
@ -1223,7 +1223,7 @@ dounmount(mp, flags, td)
error = vfs_suser(mp, td);
if (error) {
if (coveredvp)
VOP_UNLOCK(coveredvp, 0, td);
VOP_UNLOCK(coveredvp, 0);
return (error);
}
@ -1231,7 +1231,7 @@ dounmount(mp, flags, td)
if (mp->mnt_kern_flag & MNTK_UNMOUNT) {
MNT_IUNLOCK(mp);
if (coveredvp)
VOP_UNLOCK(coveredvp, 0, td);
VOP_UNLOCK(coveredvp, 0);
return (EBUSY);
}
mp->mnt_kern_flag |= MNTK_UNMOUNT | MNTK_NOINSMNTQ;
@ -1248,7 +1248,7 @@ dounmount(mp, flags, td)
wakeup(mp);
MNT_IUNLOCK(mp);
if (coveredvp)
VOP_UNLOCK(coveredvp, 0, td);
VOP_UNLOCK(coveredvp, 0);
return (error);
}
vn_start_write(NULL, &mp, V_WAIT);
@ -1319,7 +1319,7 @@ dounmount(mp, flags, td)
wakeup(mp);
MNT_IUNLOCK(mp);
if (coveredvp)
VOP_UNLOCK(coveredvp, 0, td);
VOP_UNLOCK(coveredvp, 0);
return (error);
}
mtx_lock(&mountlist_mtx);
@ -1479,7 +1479,7 @@ set_rootvnode(struct thread *td)
FILEDESC_SUNLOCK(p->p_fd);
VOP_UNLOCK(rootvnode, 0, td);
VOP_UNLOCK(rootvnode, 0);
}
/*
@ -1574,7 +1574,7 @@ devfs_fixup(struct thread *td)
mtx_lock(&mountlist_mtx);
TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list);
mtx_unlock(&mountlist_mtx);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vput(dvp);
vfs_unbusy(mp, td);

View File

@ -610,7 +610,7 @@ vlrureclaim(struct mount *mp)
}
MNT_IUNLOCK(mp);
vholdl(vp);
if (VOP_LOCK(vp, LK_INTERLOCK|LK_EXCLUSIVE|LK_NOWAIT, td)) {
if (VOP_LOCK(vp, LK_INTERLOCK|LK_EXCLUSIVE|LK_NOWAIT)) {
vdrop(vp);
goto next_iter_mntunlocked;
}
@ -630,13 +630,13 @@ vlrureclaim(struct mount *mp)
if (vp->v_usecount || !LIST_EMPTY(&(vp)->v_cache_src) ||
(vp->v_object != NULL &&
vp->v_object->resident_page_count > trigger)) {
VOP_UNLOCK(vp, LK_INTERLOCK, td);
VOP_UNLOCK(vp, LK_INTERLOCK);
goto next_iter_mntunlocked;
}
KASSERT((vp->v_iflag & VI_DOOMED) == 0,
("VI_DOOMED unexpectedly detected in vlrureclaim()"));
vgonel(vp);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vdropl(vp);
done++;
next_iter_mntunlocked:
@ -836,7 +836,6 @@ vdestroy(struct vnode *vp)
static int
vtryrecycle(struct vnode *vp)
{
struct thread *td = curthread;
struct mount *vnmp;
CTR1(KTR_VFS, "vtryrecycle: trying vp %p", vp);
@ -846,13 +845,13 @@ vtryrecycle(struct vnode *vp)
* This vnode may found and locked via some other list, if so we
* can't recycle it yet.
*/
if (VOP_LOCK(vp, LK_EXCLUSIVE | LK_NOWAIT, td) != 0)
if (VOP_LOCK(vp, LK_EXCLUSIVE | LK_NOWAIT) != 0)
return (EWOULDBLOCK);
/*
* Don't recycle if its filesystem is being suspended.
*/
if (vn_start_write(vp, &vnmp, V_NOWAIT) != 0) {
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
return (EBUSY);
}
/*
@ -863,13 +862,13 @@ vtryrecycle(struct vnode *vp)
*/
VI_LOCK(vp);
if (vp->v_usecount) {
VOP_UNLOCK(vp, LK_INTERLOCK, td);
VOP_UNLOCK(vp, LK_INTERLOCK);
vn_finished_write(vnmp);
return (EBUSY);
}
if ((vp->v_iflag & VI_DOOMED) == 0)
vgonel(vp);
VOP_UNLOCK(vp, LK_INTERLOCK, td);
VOP_UNLOCK(vp, LK_INTERLOCK);
vn_finished_write(vnmp);
CTR1(KTR_VFS, "vtryrecycle: recycled vp %p", vp);
return (0);
@ -1664,7 +1663,7 @@ sync_vnode(struct synclist *slp, struct bufobj **bo, struct thread *td)
}
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
(void) VOP_FSYNC(vp, MNT_LAZY, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
VI_LOCK(vp);
if (((*bo)->bo_flag & BO_ONWORKLST) != 0) {
@ -2073,7 +2072,7 @@ vget(struct vnode *vp, int flags, struct thread *td)
vinactive(vp, td);
VI_UNLOCK(vp);
if ((oldflags & LK_TYPE_MASK) == 0)
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
} else
VI_UNLOCK(vp);
return (0);
@ -2160,7 +2159,7 @@ vrele(struct vnode *vp)
vp->v_iflag &= ~VI_OWEINACT;
if (vp->v_iflag & VI_OWEINACT)
vinactive(vp, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
} else {
VI_LOCK(vp);
if (vp->v_usecount > 0)
@ -2191,7 +2190,7 @@ vput(struct vnode *vp)
if (vp->v_usecount > 1 || ((vp->v_iflag & VI_DOINGINACT) &&
vp->v_usecount == 1)) {
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
v_decr_usecount(vp);
return;
}
@ -2210,7 +2209,7 @@ vput(struct vnode *vp)
v_decr_useonly(vp);
vp->v_iflag |= VI_OWEINACT;
if (VOP_ISLOCKED(vp, NULL) != LK_EXCLUSIVE) {
error = VOP_LOCK(vp, LK_UPGRADE|LK_INTERLOCK|LK_NOWAIT, td);
error = VOP_LOCK(vp, LK_UPGRADE|LK_INTERLOCK|LK_NOWAIT);
VI_LOCK(vp);
if (error) {
if (vp->v_usecount > 0)
@ -2222,7 +2221,7 @@ vput(struct vnode *vp)
vp->v_iflag &= ~VI_OWEINACT;
if (vp->v_iflag & VI_OWEINACT)
vinactive(vp, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
done:
vdropl(vp);
}
@ -2370,7 +2369,7 @@ vflush( struct mount *mp, int rootrefs, int flags, struct thread *td)
* Skip over a vnodes marked VV_SYSTEM.
*/
if ((flags & SKIPSYSTEM) && (vp->v_vflag & VV_SYSTEM)) {
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vdrop(vp);
MNT_ILOCK(mp);
continue;
@ -2387,7 +2386,7 @@ vflush( struct mount *mp, int rootrefs, int flags, struct thread *td)
if ((vp->v_type == VNON ||
(error == 0 && vattr.va_nlink > 0)) &&
(vp->v_writecount == 0 || vp->v_type != VREG)) {
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vdropl(vp);
MNT_ILOCK(mp);
continue;
@ -2412,7 +2411,7 @@ vflush( struct mount *mp, int rootrefs, int flags, struct thread *td)
vprint("vflush: busy vnode", vp);
#endif
}
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vdropl(vp);
MNT_ILOCK(mp);
}
@ -2428,9 +2427,9 @@ vflush( struct mount *mp, int rootrefs, int flags, struct thread *td)
("vflush: usecount %d < rootrefs %d",
rootvp->v_usecount, rootrefs));
if (busy == 1 && rootvp->v_usecount == rootrefs) {
VOP_LOCK(rootvp, LK_EXCLUSIVE|LK_INTERLOCK, td);
VOP_LOCK(rootvp, LK_EXCLUSIVE|LK_INTERLOCK);
vgone(rootvp);
VOP_UNLOCK(rootvp, 0, td);
VOP_UNLOCK(rootvp, 0);
busy = 0;
} else
VI_UNLOCK(rootvp);
@ -3877,7 +3876,7 @@ vfs_knlunlock(void *arg)
{
struct vnode *vp = arg;
VOP_UNLOCK(vp, 0, curthread);
VOP_UNLOCK(vp, 0);
}
static int

View File

@ -371,7 +371,7 @@ kern_fstatfs(struct thread *td, int fd, struct statfs *buf)
mp = vp->v_mount;
if (mp)
vfs_ref(mp);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
fdrop(fp, td);
if (vp->v_iflag & VI_DOOMED) {
error = EBADF;
@ -756,7 +756,7 @@ fchdir(td, uap)
VFS_UNLOCK_GIANT(vfslocked);
return (error);
}
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
FILEDESC_XLOCK(fdp);
vpold = fdp->fd_cdir;
@ -807,7 +807,7 @@ kern_chdir(struct thread *td, char *path, enum uio_seg pathseg)
NDFREE(&nd, NDF_ONLY_PNBUF);
return (error);
}
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
NDFREE(&nd, NDF_ONLY_PNBUF);
FILEDESC_XLOCK(fdp);
@ -894,7 +894,7 @@ chroot(td, uap)
if ((error = mac_vnode_check_chroot(td->td_ucred, nd.ni_vp)))
goto e_vunlock;
#endif
VOP_UNLOCK(nd.ni_vp, 0, td);
VOP_UNLOCK(nd.ni_vp, 0);
error = change_root(nd.ni_vp, td);
vrele(nd.ni_vp);
VFS_UNLOCK_GIANT(vfslocked);
@ -1080,7 +1080,7 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
finit(fp, flags & FMASK, DTYPE_VNODE, vp, &vnops);
}
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if (flags & (O_EXLOCK | O_SHLOCK)) {
lf.l_whence = SEEK_SET;
lf.l_start = 0;
@ -1109,7 +1109,7 @@ kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
if (error == 0)
#endif
error = VOP_SETATTR(vp, &vat, td->td_ucred, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
if (error)
goto bad;
@ -1474,7 +1474,7 @@ kern_link(struct thread *td, char *path, char *link, enum uio_seg segflg)
if (error == 0)
#endif
error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vput(nd.ni_dvp);
}
NDFREE(&nd, NDF_ONLY_PNBUF);
@ -1769,7 +1769,7 @@ lseek(td, uap)
case L_XTND:
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_GETATTR(vp, &vattr, cred, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if (error)
break;
if (noneg &&
@ -2406,7 +2406,7 @@ setfflags(td, vp, flags)
if (error == 0)
#endif
error = VOP_SETATTR(vp, &vattr, td->td_ucred, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
return (error);
}
@ -2502,7 +2502,7 @@ fchflags(td, uap)
#ifdef AUDIT
vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY);
AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1);
VOP_UNLOCK(fp->f_vnode, 0, td);
VOP_UNLOCK(fp->f_vnode, 0);
#endif
error = setfflags(td, fp->f_vnode, uap->flags);
VFS_UNLOCK_GIANT(vfslocked);
@ -2534,7 +2534,7 @@ setfmode(td, vp, mode)
if (error == 0)
#endif
error = VOP_SETATTR(vp, &vattr, td->td_ucred, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
return (error);
}
@ -2642,7 +2642,7 @@ fchmod(td, uap)
#ifdef AUDIT
vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY);
AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1);
VOP_UNLOCK(fp->f_vnode, 0, td);
VOP_UNLOCK(fp->f_vnode, 0);
#endif
error = setfmode(td, fp->f_vnode, uap->mode);
VFS_UNLOCK_GIANT(vfslocked);
@ -2677,7 +2677,7 @@ setfown(td, vp, uid, gid)
if (error == 0)
#endif
error = VOP_SETATTR(vp, &vattr, td->td_ucred, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
return (error);
}
@ -2799,7 +2799,7 @@ fchown(td, uap)
#ifdef AUDIT
vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY);
AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1);
VOP_UNLOCK(fp->f_vnode, 0, td);
VOP_UNLOCK(fp->f_vnode, 0);
#endif
error = setfown(td, fp->f_vnode, uap->uid, uap->gid);
VFS_UNLOCK_GIANT(vfslocked);
@ -2880,7 +2880,7 @@ setutimes(td, vp, ts, numtimes, nullflag)
#endif
if (error == 0)
error = VOP_SETATTR(vp, &vattr, td->td_ucred, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
return (error);
}
@ -3012,7 +3012,7 @@ kern_futimes(struct thread *td, int fd, struct timeval *tptr,
#ifdef AUDIT
vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY);
AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1);
VOP_UNLOCK(fp->f_vnode, 0, td);
VOP_UNLOCK(fp->f_vnode, 0);
#endif
error = setutimes(td, fp->f_vnode, ts, 2, tptr == NULL);
VFS_UNLOCK_GIANT(vfslocked);
@ -3174,7 +3174,7 @@ fsync(td, uap)
}
error = VOP_FSYNC(vp, MNT_WAIT, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
drop:
VFS_UNLOCK_GIANT(vfslocked);
@ -3229,9 +3229,9 @@ kern_rename(struct thread *td, char *from, char *to, enum uio_seg pathseg)
#ifdef MAC
error = mac_vnode_check_rename_from(td->td_ucred, fromnd.ni_dvp,
fromnd.ni_vp, &fromnd.ni_cnd);
VOP_UNLOCK(fromnd.ni_dvp, 0, td);
VOP_UNLOCK(fromnd.ni_dvp, 0);
if (fromnd.ni_dvp != fromnd.ni_vp)
VOP_UNLOCK(fromnd.ni_vp, 0, td);
VOP_UNLOCK(fromnd.ni_vp, 0);
#endif
fvp = fromnd.ni_vp;
if (error == 0)
@ -3555,7 +3555,7 @@ ogetdirentries(td, uap)
#ifdef MAC
error = mac_vnode_check_readdir(td->td_ucred, vp);
if (error) {
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
fdrop(fp, td);
return (error);
@ -3613,7 +3613,7 @@ ogetdirentries(td, uap)
FREE(dirbuf, M_TEMP);
}
if (error) {
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
fdrop(fp, td);
return (error);
@ -3631,7 +3631,7 @@ ogetdirentries(td, uap)
VFS_UNLOCK_GIANT(vfslocked);
goto unionread;
}
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
error = copyout(&loff, uap->basep, sizeof(long));
fdrop(fp, td);
@ -3704,7 +3704,7 @@ getdirentries(td, uap)
NULL);
fp->f_offset = auio.uio_offset;
if (error) {
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
goto fail;
}
@ -3721,7 +3721,7 @@ getdirentries(td, uap)
VFS_UNLOCK_GIANT(vfslocked);
goto unionread;
}
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
if (uap->basep != NULL) {
error = copyout(&loff, uap->basep, sizeof(long));
@ -4048,7 +4048,7 @@ fhopen(td, uap)
goto bad;
}
if (fmode & O_TRUNC) {
VOP_UNLOCK(vp, 0, td); /* XXX */
VOP_UNLOCK(vp, 0); /* XXX */
if ((error = vn_start_write(NULL, &mp, V_WAIT | PCATCH)) != 0) {
vrele(vp);
goto out;
@ -4104,7 +4104,7 @@ fhopen(td, uap)
type = F_FLOCK;
if ((fmode & FNONBLOCK) == 0)
type |= F_WAIT;
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if ((error = VOP_ADVLOCK(vp, (caddr_t)fp, F_SETLK, &lf,
type)) != 0) {
/*
@ -4124,7 +4124,7 @@ fhopen(td, uap)
atomic_set_int(&fp->f_flag, FHASLOCK);
}
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
fdrop(fp, td);
vfs_rel(mp);
VFS_UNLOCK_GIANT(vfslocked);

View File

@ -421,7 +421,7 @@ vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, active_cred, file_cred,
if ((ioflg & IO_NODELOCKED) == 0) {
if (rw == UIO_WRITE && vp->v_type != VCHR)
vn_finished_write(mp);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
}
return (error);
}
@ -546,7 +546,7 @@ vn_read(fp, uio, active_cred, flags, td)
mtx_unlock(mtxp);
}
fp->f_nextoff = uio->uio_offset;
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
return (error);
}
@ -600,7 +600,7 @@ vn_write(fp, uio, active_cred, flags, td)
if ((flags & FOF_OFFSET) == 0)
fp->f_offset = uio->uio_offset;
fp->f_nextoff = uio->uio_offset;
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if (vp->v_type != VCHR)
vn_finished_write(mp);
unlock:
@ -649,7 +649,7 @@ vn_truncate(fp, length, active_cred, td)
error = VOP_SETATTR(vp, &vattr, fp->f_cred, td);
}
out:
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
VFS_UNLOCK_GIANT(vfslocked);
return (error);
@ -672,7 +672,7 @@ vn_statfile(fp, sb, active_cred, td)
vfslocked = VFS_LOCK_GIANT(vp->v_mount);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = vn_stat(vp, sb, active_cred, fp->f_cred, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
return (error);
@ -807,7 +807,7 @@ vn_ioctl(fp, com, data, active_cred, td)
if (com == FIONREAD) {
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_GETATTR(vp, &vattr, active_cred, td);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if (!error)
*(int *)data = vattr.va_size - fp->f_offset;
}
@ -844,7 +844,7 @@ vn_poll(fp, events, active_cred, td)
#ifdef MAC
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = mac_vnode_check_poll(active_cred, fp->f_cred, vp);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if (!error)
#endif
@ -881,8 +881,7 @@ _vn_lock(struct vnode *vp, int flags, char *file, int line)
* lockmgr drops interlock before it will return for
* any reason. So force the code above to relock it.
*/
error = VOP_LOCK1(vp, flags | LK_INTERLOCK, curthread, file,
line);
error = VOP_LOCK1(vp, flags | LK_INTERLOCK, file, line);
flags &= ~LK_INTERLOCK;
KASSERT((flags & LK_RETRY) == 0 || error == 0,
("LK_RETRY set with incompatible flags %d\n", flags));
@ -892,7 +891,7 @@ _vn_lock(struct vnode *vp, int flags, char *file, int line)
*/
if (error == 0 && vp->v_iflag & VI_DOOMED &&
(flags & LK_RETRY) == 0) {
VOP_UNLOCK(vp, 0, curthread);
VOP_UNLOCK(vp, 0);
error = ENOENT;
break;
}
@ -1232,7 +1231,7 @@ vn_extattr_get(struct vnode *vp, int ioflg, int attrnamespace,
td);
if ((ioflg & IO_NODELOCKED) == 0)
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
if (error == 0) {
*buflen = *buflen - auio.uio_resid;
@ -1277,7 +1276,7 @@ vn_extattr_set(struct vnode *vp, int ioflg, int attrnamespace,
if ((ioflg & IO_NODELOCKED) == 0) {
vn_finished_write(mp);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
}
return (error);
@ -1306,7 +1305,7 @@ vn_extattr_rm(struct vnode *vp, int ioflg, int attrnamespace,
if ((ioflg & IO_NODELOCKED) == 0) {
vn_finished_write(mp);
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
}
return (error);

View File

@ -368,7 +368,6 @@ vop_reclaim {
vop_lock1 {
IN struct vnode *vp;
IN int flags;
IN struct thread *td;
IN char *file;
IN int line;
};
@ -380,7 +379,6 @@ vop_lock1 {
vop_unlock {
IN struct vnode *vp;
IN int flags;
IN struct thread *td;
};

View File

@ -764,7 +764,7 @@ nfs4_sync(struct mount *mp, int waitfor, struct thread *td)
error = VOP_FSYNC(vp, waitfor, td);
if (error)
allerror = error;
VOP_UNLOCK(vp, 0, td);
VOP_UNLOCK(vp, 0);
vrele(vp);
MNT_ILOCK(mp);

View File

@ -1045,7 +1045,7 @@ nfs4_lookup(struct vop_lookup_args *ap)
}
if (flags & ISDOTDOT) {
VOP_UNLOCK(dvp, 0, td);
VOP_UNLOCK(dvp, 0);
error = nfs_nget(dvp->v_mount, fhp, fhsize, &np, LK_EXCLUSIVE);
vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
@ -1721,7 +1721,7 @@ nfs4_rename(struct vop_rename_args *ap)
* often.
*/
VOP_FSYNC(fvp, MNT_WAIT, fcnp->cn_thread);
VOP_UNLOCK(fvp, 0, fcnp->cn_thread);
VOP_UNLOCK(fvp, 0);
if (tvp)
VOP_FSYNC(tvp, MNT_WAIT, tcnp->cn_thread);

Some files were not shown because too many files have changed in this diff Show More