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/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c | |
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/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c index 0b600ef..adf838c 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c @@ -109,7 +109,7 @@ zfs_replay_create(zfsvfs_t *zfsvfs, lr_create_t *lr, boolean_t byteswap) cn.cn_thread = curthread; cn.cn_flags = SAVENAME; - vn_lock(ZTOV(dzp), LK_EXCLUSIVE | LK_RETRY, curthread); + vn_lock(ZTOV(dzp), LK_EXCLUSIVE | LK_RETRY); switch ((int)lr->lr_common.lrc_txtype) { case TX_CREATE: error = VOP_CREATE(ZTOV(dzp), &vp, &cn, &va); @@ -162,7 +162,7 @@ zfs_replay_remove(zfsvfs_t *zfsvfs, lr_remove_t *lr, boolean_t byteswap) cn.cn_lkflags = LK_EXCLUSIVE | LK_RETRY; cn.cn_cred = kcred; cn.cn_thread = curthread; - vn_lock(ZTOV(dzp), LK_EXCLUSIVE | LK_RETRY, curthread); + vn_lock(ZTOV(dzp), LK_EXCLUSIVE | LK_RETRY); error = VOP_LOOKUP(ZTOV(dzp), &vp, &cn); if (error != 0) { VOP_UNLOCK(ZTOV(dzp), 0, curthread); @@ -211,8 +211,8 @@ zfs_replay_link(zfsvfs_t *zfsvfs, lr_link_t *lr, boolean_t byteswap) cn.cn_thread = curthread; cn.cn_flags = SAVENAME; - vn_lock(ZTOV(dzp), LK_EXCLUSIVE | LK_RETRY, curthread); - vn_lock(ZTOV(zp), LK_EXCLUSIVE | LK_RETRY, curthread); + 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); @@ -255,7 +255,7 @@ zfs_replay_rename(zfsvfs_t *zfsvfs, lr_rename_t *lr, boolean_t byteswap) scn.cn_lkflags = LK_EXCLUSIVE | LK_RETRY; scn.cn_cred = kcred; scn.cn_thread = td; - vn_lock(ZTOV(sdzp), LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(ZTOV(sdzp), LK_EXCLUSIVE | LK_RETRY); error = VOP_LOOKUP(ZTOV(sdzp), &svp, &scn); VOP_UNLOCK(ZTOV(sdzp), 0, td); if (error != 0) @@ -270,7 +270,7 @@ zfs_replay_rename(zfsvfs_t *zfsvfs, lr_rename_t *lr, boolean_t byteswap) tcn.cn_lkflags = LK_EXCLUSIVE | LK_RETRY; tcn.cn_cred = kcred; tcn.cn_thread = td; - vn_lock(ZTOV(tdzp), LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(ZTOV(tdzp), LK_EXCLUSIVE | LK_RETRY); error = VOP_LOOKUP(ZTOV(tdzp), &tvp, &tcn); if (error == EJUSTRETURN) tvp = NULL; @@ -360,7 +360,7 @@ zfs_replay_setattr(zfsvfs_t *zfsvfs, lr_setattr_t *lr, boolean_t byteswap) ZFS_TIME_DECODE(&va.va_mtime, lr->lr_mtime); vp = ZTOV(zp); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); error = VOP_SETATTR(vp, &va, kcred, curthread); VOP_UNLOCK(vp, 0, curthread); VN_RELE(vp); |