summaryrefslogtreecommitdiffstats
path: root/sys/fs/fdescfs
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/fdescfs
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/fdescfs')
-rw-r--r--sys/fs/fdescfs/fdesc_vnops.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c
index 1fbd41e..5281267 100644
--- a/sys/fs/fdescfs/fdesc_vnops.c
+++ b/sys/fs/fdescfs/fdesc_vnops.c
@@ -379,11 +379,11 @@ fdesc_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;
struct vattr *vap = ap->a_vap;
+ struct thread *td = curthread;
struct file *fp;
struct stat stb;
u_int fd;
@@ -414,12 +414,12 @@ fdesc_getattr(ap)
case Fdesc:
fd = VTOFDESC(vp)->fd_fd;
- if ((error = fget(ap->a_td, fd, &fp)) != 0)
+ if ((error = fget(td, fd, &fp)) != 0)
return (error);
bzero(&stb, sizeof(stb));
- error = fo_stat(fp, &stb, ap->a_td->td_ucred, ap->a_td);
- fdrop(fp, ap->a_td);
+ error = fo_stat(fp, &stb, td->td_ucred, td);
+ fdrop(fp, td);
if (error == 0) {
VATTR_NULL(vap);
vap->va_type = IFTOVT(stb.st_mode);
@@ -475,13 +475,13 @@ fdesc_setattr(ap)
struct vnode *a_vp;
struct vattr *a_vap;
struct ucred *a_cred;
- struct thread *a_td;
} */ *ap;
{
struct vattr *vap = ap->a_vap;
struct vnode *vp;
struct mount *mp;
struct file *fp;
+ struct thread *td = curthread;
unsigned fd;
int error;
@@ -496,7 +496,7 @@ fdesc_setattr(ap)
/*
* Allow setattr where there is an underlying vnode.
*/
- error = getvnode(ap->a_td->td_proc->p_fd, fd, &fp);
+ error = getvnode(td->td_proc->p_fd, fd, &fp);
if (error) {
/*
* getvnode() returns EINVAL if the file descriptor is not
@@ -514,11 +514,11 @@ fdesc_setattr(ap)
vp = fp->f_vnode;
if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) == 0) {
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
- error = VOP_SETATTR(vp, ap->a_vap, ap->a_cred, ap->a_td);
+ error = VOP_SETATTR(vp, ap->a_vap, ap->a_cred);
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
}
- fdrop(fp, ap->a_td);
+ fdrop(fp, td);
return (error);
}
OpenPOWER on IntegriCloud