summaryrefslogtreecommitdiffstats
path: root/sys/fs/unionfs
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2008-08-28 15:23:18 +0000
committerattilio <attilio@FreeBSD.org>2008-08-28 15:23:18 +0000
commitdbf35e279f37ad4a573bf93923d141cb4a454c7d (patch)
tree61fe2ab5660fec327061e18eda0ed8c65276f262 /sys/fs/unionfs
parentfb7f3b6363b61cead7eb5e94ac7f816358fc19ab (diff)
downloadFreeBSD-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/fs/unionfs')
-rw-r--r--sys/fs/unionfs/union_subr.c12
-rw-r--r--sys/fs/unionfs/union_vfsops.c2
-rw-r--r--sys/fs/unionfs/union_vnops.c16
3 files changed, 15 insertions, 15 deletions
diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c
index fb30537..cb9af5a 100644
--- a/sys/fs/unionfs/union_subr.c
+++ b/sys/fs/unionfs/union_subr.c
@@ -523,7 +523,7 @@ unionfs_create_uppervattr(struct unionfs_mount *ump,
int error;
struct vattr lva;
- if ((error = VOP_GETATTR(lvp, &lva, cred, td)))
+ if ((error = VOP_GETATTR(lvp, &lva, cred)))
return (error);
unionfs_create_uppervattr_core(ump, &lva, uva, td);
@@ -802,7 +802,7 @@ unionfs_mkshadowdir(struct unionfs_mount *ump, struct vnode *udvp,
memset(&cn, 0, sizeof(cn));
- if ((error = VOP_GETATTR(lvp, &lva, cnp->cn_cred, td)))
+ if ((error = VOP_GETATTR(lvp, &lva, cnp->cn_cred)))
goto unionfs_mkshadowdir_abort;
if ((error = unionfs_relookup(udvp, &uvp, cnp, &cn, td, cnp->cn_nameptr, cnp->cn_namelen, CREATE)))
@@ -835,7 +835,7 @@ unionfs_mkshadowdir(struct unionfs_mount *ump, struct vnode *udvp,
* Ignore errors.
*/
va.va_type = VNON;
- VOP_SETATTR(uvp, &va, cn.cn_cred, td);
+ VOP_SETATTR(uvp, &va, cn.cn_cred);
}
vn_finished_write(mp);
@@ -931,7 +931,7 @@ unionfs_vn_create_on_upper(struct vnode **vpp, struct vnode *udvp,
fmode = FFLAGS(O_WRONLY | O_CREAT | O_TRUNC | O_EXCL);
error = 0;
- if ((error = VOP_GETATTR(lvp, &lva, cred, td)) != 0)
+ if ((error = VOP_GETATTR(lvp, &lva, cred)) != 0)
return (error);
unionfs_create_uppervattr_core(ump, &lva, uvap, td);
@@ -1119,7 +1119,7 @@ unionfs_copyfile(struct unionfs_node *unp, int docopy, struct ucred *cred,
if (error == 0) {
/* Reset the attributes. Ignore errors. */
uva.va_type = VNON;
- VOP_SETATTR(uvp, &uva, cred, td);
+ VOP_SETATTR(uvp, &uva, cred);
}
unionfs_node_update(unp, uvp, td);
@@ -1160,7 +1160,7 @@ unionfs_check_rmdir(struct vnode *vp, struct ucred *cred, struct thread *td)
lvp = UNIONFSVPTOLOWERVP(vp);
/* check opaque */
- if ((error = VOP_GETATTR(uvp, &va, cred, td)) != 0)
+ if ((error = VOP_GETATTR(uvp, &va, cred)) != 0)
return (error);
if (va.va_flags & OPAQUE)
return (0);
diff --git a/sys/fs/unionfs/union_vfsops.c b/sys/fs/unionfs/union_vfsops.c
index a192381..2e873fe 100644
--- a/sys/fs/unionfs/union_vfsops.c
+++ b/sys/fs/unionfs/union_vfsops.c
@@ -192,7 +192,7 @@ unionfs_domount(struct mount *mp, struct thread *td)
ufile = udir;
vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY);
- error = VOP_GETATTR(mp->mnt_vnodecovered, &va, mp->mnt_cred, td);
+ error = VOP_GETATTR(mp->mnt_vnodecovered, &va, mp->mnt_cred);
if (!error) {
if (udir == 0)
udir = va.va_mode;
diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c
index 27d56f1..e06735f 100644
--- a/sys/fs/unionfs/union_vnops.c
+++ b/sys/fs/unionfs/union_vnops.c
@@ -206,7 +206,7 @@ unionfs_lookup(struct vop_cachedlookup_args *ap)
if (cnp->cn_flags & ISWHITEOUT)
iswhiteout = 1; /* don't lookup lower */
if (iswhiteout == 0 && ldvp != NULLVP)
- if (VOP_GETATTR(udvp, &va, cnp->cn_cred, td) == 0 &&
+ if (!VOP_GETATTR(udvp, &va, cnp->cn_cred) &&
(va.va_flags & OPAQUE))
iswhiteout = 1; /* don't lookup lower */
#if 0
@@ -731,10 +731,10 @@ unionfs_getattr(struct vop_getattr_args *ap)
ump = MOUNTTOUNIONFSMOUNT(ap->a_vp->v_mount);
uvp = unp->un_uppervp;
lvp = unp->un_lowervp;
- td = ap->a_td;
+ td = curthread;
if (uvp != NULLVP) {
- if ((error = VOP_GETATTR(uvp, ap->a_vap, ap->a_cred, td)) == 0)
+ if ((error = VOP_GETATTR(uvp, ap->a_vap, ap->a_cred)) == 0)
ap->a_vap->va_fsid = ap->a_vp->v_mount->mnt_stat.f_fsid.val[0];
UNIONFS_INTERNAL_DEBUG("unionfs_getattr: leave mode=%o, uid=%d, gid=%d (%d)\n",
@@ -744,7 +744,7 @@ unionfs_getattr(struct vop_getattr_args *ap)
return (error);
}
- error = VOP_GETATTR(lvp, ap->a_vap, ap->a_cred, td);
+ error = VOP_GETATTR(lvp, ap->a_vap, ap->a_cred);
if (error == 0 && !(ump->um_uppervp->v_mount->mnt_flag & MNT_RDONLY)) {
/* correct the attr toward shadow file/dir. */
@@ -781,7 +781,7 @@ unionfs_setattr(struct vop_setattr_args *ap)
unp = VTOUNIONFS(ap->a_vp);
uvp = unp->un_uppervp;
lvp = unp->un_lowervp;
- td = ap->a_td;
+ td = curthread;
vap = ap->a_vap;
if ((ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) &&
@@ -799,7 +799,7 @@ unionfs_setattr(struct vop_setattr_args *ap)
}
if (uvp != NULLVP)
- error = VOP_SETATTR(uvp, vap, ap->a_cred, td);
+ error = VOP_SETATTR(uvp, vap, ap->a_cred);
UNIONFS_INTERNAL_DEBUG("unionfs_setattr: leave (%d)\n", error);
@@ -1264,7 +1264,7 @@ unionfs_mkdir(struct vop_mkdir_args *ap)
if (udvp != NULLVP) {
/* check opaque */
if (!(cnp->cn_flags & ISWHITEOUT)) {
- error = VOP_GETATTR(udvp, &va, cnp->cn_cred, td);
+ error = VOP_GETATTR(udvp, &va, cnp->cn_cred);
if (error != 0)
return (error);
if (va.va_flags & OPAQUE)
@@ -1412,7 +1412,7 @@ unionfs_readdir(struct vop_readdir_args *ap)
/* check opaque */
if (uvp != NULLVP && lvp != NULLVP) {
- if ((error = VOP_GETATTR(uvp, &va, ap->a_cred, td)) != 0)
+ if ((error = VOP_GETATTR(uvp, &va, ap->a_cred)) != 0)
goto unionfs_readdir_exit;
if (va.va_flags & OPAQUE)
lvp = NULLVP;
OpenPOWER on IntegriCloud