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/cddl/compat/opensolaris | |
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/cddl/compat/opensolaris')
-rw-r--r-- | sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c | 4 | ||||
-rw-r--r-- | sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c | 4 | ||||
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/vnode.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c b/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c index 248856b..6014c2e 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c @@ -123,7 +123,7 @@ kobj_get_filesize_vnode(struct _buf *file, uint64_t *size) struct vattr va; int error; - vn_lock(vp, LK_SHARED | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY); error = VOP_GETATTR(vp, &va, td->td_ucred, td); VOP_UNLOCK(vp, 0, td); if (error == 0) @@ -176,7 +176,7 @@ kobj_read_file_vnode(struct _buf *file, char *buf, unsigned size, unsigned off) auio.uio_resid = size; auio.uio_td = td; - vn_lock(vp, LK_SHARED | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY); error = VOP_READ(vp, &auio, IO_UNIT | IO_SYNC, td->td_ucred); VOP_UNLOCK(vp, 0, td); return (error != 0 ? -1 : size - auio.uio_resid); diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c b/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c index 659870e..93eba51 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c @@ -192,7 +192,7 @@ domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath, /* * Allocate and initialize the filesystem. */ - vn_lock(vp, LK_SHARED | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY); mp = vfs_mount_alloc(vp, vfsp, fspath, td); VOP_UNLOCK(vp, 0, td); @@ -238,7 +238,7 @@ domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath, * mnt_optnew. */ mp->mnt_optnew = NULL; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); /* * Put the new filesystem on the mount list after root. */ diff --git a/sys/cddl/compat/opensolaris/sys/vnode.h b/sys/cddl/compat/opensolaris/sys/vnode.h index a474461..171b7fe 100644 --- a/sys/cddl/compat/opensolaris/sys/vnode.h +++ b/sys/cddl/compat/opensolaris/sys/vnode.h @@ -222,7 +222,7 @@ zfs_vop_fsync(vnode_t *vp, int flag, cred_t *cr) vfslocked = VFS_LOCK_GIANT(vp->v_mount); if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) goto drop; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); error = VOP_FSYNC(vp, MNT_WAIT, td); VOP_UNLOCK(vp, 0, td); vn_finished_write(mp); |