diff options
author | attilio <attilio@FreeBSD.org> | 2008-08-28 15:23:18 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2008-08-28 15:23:18 +0000 |
commit | dbf35e279f37ad4a573bf93923d141cb4a454c7d (patch) | |
tree | 61fe2ab5660fec327061e18eda0ed8c65276f262 /sys/cddl | |
parent | fb7f3b6363b61cead7eb5e94ac7f816358fc19ab (diff) | |
download | FreeBSD-src-dbf35e279f37ad4a573bf93923d141cb4a454c7d.zip FreeBSD-src-dbf35e279f37ad4a573bf93923d141cb4a454c7d.tar.gz |
Decontextualize the couplet VOP_GETATTR / VOP_SETATTR as the passed thread
was always curthread and totally unuseful.
Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
Diffstat (limited to 'sys/cddl')
5 files changed, 8 insertions, 13 deletions
diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c b/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c index efb2885..bf47fb8 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c @@ -119,12 +119,11 @@ static int kobj_get_filesize_vnode(struct _buf *file, uint64_t *size) { struct vnode *vp = file->ptr; - struct thread *td = curthread; struct vattr va; int error; vn_lock(vp, LK_SHARED | LK_RETRY); - error = VOP_GETATTR(vp, &va, td->td_ucred, td); + error = VOP_GETATTR(vp, &va, curthread->td_ucred); VOP_UNLOCK(vp, 0); if (error == 0) *size = (uint64_t)va.va_size; diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c index b8e79f8..ab2d34c 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c @@ -85,7 +85,7 @@ vdev_file_open(vdev_t *vd, uint64_t *psize, uint64_t *ashift) * Determine the physical size of the file. */ vattr.va_mask = AT_SIZE; - error = VOP_GETATTR(vp, &vattr, 0, kcred); + error = VOP_GETATTR(vp, &vattr, 0); if (error) { vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; return (error); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c index 0c2fb02..2b299d7 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c @@ -358,7 +358,6 @@ zfsctl_root_getattr(ap) struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -799,7 +798,6 @@ zfsctl_snapdir_getattr(ap) struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; @@ -924,10 +922,11 @@ zfsctl_snapshot_inactive(ap) } static int -zfsctl_traverse_begin(vnode_t **vpp, int lktype, kthread_t *td) +zfsctl_traverse_begin(vnode_t **vpp, int lktype) { VN_HOLD(*vpp); + /* Snapshot should be already mounted, but just in case. */ if (vn_mountedvfs(*vpp) == NULL) return (ENOENT); @@ -950,15 +949,14 @@ zfsctl_snapshot_getattr(ap) struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { vnode_t *vp = ap->a_vp; int err; - err = zfsctl_traverse_begin(&vp, LK_SHARED | LK_RETRY, ap->a_td); + err = zfsctl_traverse_begin(&vp, LK_SHARED | LK_RETRY); if (err == 0) - err = VOP_GETATTR(vp, ap->a_vap, ap->a_cred, ap->a_td); + err = VOP_GETATTR(vp, ap->a_vap, ap->a_cred); zfsctl_traverse_end(vp, err); return (err); } @@ -973,7 +971,7 @@ zfsctl_snapshot_fid(ap) vnode_t *vp = ap->a_vp; int err; - err = zfsctl_traverse_begin(&vp, LK_SHARED | LK_RETRY, curthread); + err = zfsctl_traverse_begin(&vp, LK_SHARED | LK_RETRY); if (err == 0) err = VOP_VPTOFH(vp, (void *)ap->a_fid); zfsctl_traverse_end(vp, err); 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 2be3093..eb3215d 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 @@ -361,7 +361,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); + error = VOP_SETATTR(vp, &va, kcred); VOP_UNLOCK(vp, 0); VN_RELE(vp); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c index a8fcb80..b721a7a 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -3336,7 +3336,6 @@ zfs_freebsd_getattr(ap) struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { @@ -3349,7 +3348,6 @@ zfs_freebsd_setattr(ap) struct vnode *a_vp; struct vattr *a_vap; struct ucred *a_cred; - struct thread *a_td; } */ *ap; { vattr_t *vap = ap->a_vap; |