summaryrefslogtreecommitdiffstats
path: root/sys/vm
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/vm
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/vm')
-rw-r--r--sys/vm/swap_pager.c2
-rw-r--r--sys/vm/vm_mmap.c9
-rw-r--r--sys/vm/vnode_pager.c2
3 files changed, 7 insertions, 6 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index b00c67b..74138c7 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -1965,7 +1965,7 @@ swapon(struct thread *td, struct swapon_args *uap)
error = swapongeom(td, vp);
} else if (vp->v_type == VREG &&
(vp->v_mount->mnt_vfc->vfc_flags & VFCF_NETWORK) != 0 &&
- (error = VOP_GETATTR(vp, &attr, td->td_ucred, td)) == 0) {
+ (error = VOP_GETATTR(vp, &attr, td->td_ucred)) == 0) {
/*
* Allow direct swapping to NFS regular files in the same
* way that nfs_mountroot() sets up diskless swapping.
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c
index 02192b9..7e6b04f 100644
--- a/sys/vm/vm_mmap.c
+++ b/sys/vm/vm_mmap.c
@@ -1155,10 +1155,12 @@ vm_mmap_vnode(struct thread *td, vm_size_t objsize,
vm_object_t obj;
struct mount *mp;
struct cdevsw *dsw;
+ struct ucred *cred;
int error, flags, type;
int vfslocked;
mp = vp->v_mount;
+ cred = td->td_ucred;
vfslocked = VFS_LOCK_GIANT(mp);
if ((error = vget(vp, LK_EXCLUSIVE, td)) != 0) {
VFS_UNLOCK_GIANT(vfslocked);
@@ -1218,11 +1220,10 @@ vm_mmap_vnode(struct thread *td, vm_size_t objsize,
error = EINVAL;
goto done;
}
- if ((error = VOP_GETATTR(vp, &va, td->td_ucred, td))) {
+ if ((error = VOP_GETATTR(vp, &va, cred)))
goto done;
- }
#ifdef MAC
- error = mac_vnode_check_mmap(td->td_ucred, vp, prot, flags);
+ error = mac_vnode_check_mmap(cred, vp, prot, flags);
if (error != 0)
goto done;
#endif
@@ -1252,7 +1253,7 @@ vm_mmap_vnode(struct thread *td, vm_size_t objsize,
}
*objp = obj;
*flagsp = flags;
- vfs_mark_atime(vp, td);
+ vfs_mark_atime(vp, cred);
done:
vput(vp);
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
index cc13565..4721646 100644
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -122,7 +122,7 @@ vnode_create_vobject(struct vnode *vp, off_t isize, struct thread *td)
if (vn_isdisk(vp, NULL)) {
size = IDX_TO_OFF(INT_MAX);
} else {
- if (VOP_GETATTR(vp, &va, td->td_ucred, td) != 0)
+ if (VOP_GETATTR(vp, &va, td->td_ucred))
return (0);
size = va.va_size;
}
OpenPOWER on IntegriCloud