summaryrefslogtreecommitdiffstats
path: root/sys/fs
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
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')
-rw-r--r--sys/fs/cd9660/cd9660_vnops.c4
-rw-r--r--sys/fs/coda/coda_venus.c10
-rw-r--r--sys/fs/coda/coda_venus.h4
-rw-r--r--sys/fs/coda/coda_vnops.c8
-rw-r--r--sys/fs/devfs/devfs_vnops.c10
-rw-r--r--sys/fs/fdescfs/fdesc_vnops.c16
-rw-r--r--sys/fs/hpfs/hpfs_vnops.c4
-rw-r--r--sys/fs/msdosfs/msdosfs_vnops.c16
-rw-r--r--sys/fs/nwfs/nwfs_io.c6
-rw-r--r--sys/fs/nwfs/nwfs_vnops.c23
-rw-r--r--sys/fs/portalfs/portal_vnops.c2
-rw-r--r--sys/fs/pseudofs/pseudofs_vnops.c4
-rw-r--r--sys/fs/smbfs/smbfs_io.c6
-rw-r--r--sys/fs/smbfs/smbfs_node.c4
-rw-r--r--sys/fs/smbfs/smbfs_vnops.c42
-rw-r--r--sys/fs/tmpfs/tmpfs_vfsops.c2
-rw-r--r--sys/fs/tmpfs/tmpfs_vnops.c13
-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
20 files changed, 97 insertions, 107 deletions
diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c
index fad364f..5f4bfe8 100644
--- a/sys/fs/cd9660/cd9660_vnops.c
+++ b/sys/fs/cd9660/cd9660_vnops.c
@@ -86,7 +86,6 @@ cd9660_setattr(ap)
struct vnode *a_vp;
struct vattr *a_vap;
struct ucred *a_cred;
- struct thread *a_td;
} */ *ap;
{
struct vnode *vp = ap->a_vp;
@@ -182,7 +181,6 @@ cd9660_getattr(ap)
struct vnode *a_vp;
struct vattr *a_vap;
struct ucred *a_cred;
- struct thread *a_td;
} */ *ap;
{
@@ -217,7 +215,7 @@ cd9660_getattr(ap)
auio.uio_offset = 0;
auio.uio_rw = UIO_READ;
auio.uio_segflg = UIO_SYSSPACE;
- auio.uio_td = ap->a_td;
+ auio.uio_td = curthread;
auio.uio_resid = MAXPATHLEN;
rdlnk.a_uio = &auio;
rdlnk.a_vp = ap->a_vp;
diff --git a/sys/fs/coda/coda_venus.c b/sys/fs/coda/coda_venus.c
index c69741b..1586f36 100644
--- a/sys/fs/coda/coda_venus.c
+++ b/sys/fs/coda/coda_venus.c
@@ -304,15 +304,16 @@ venus_ioctl(void *mdp, CodaFid *fid, int com, int flag, caddr_t data,
}
int
-venus_getattr(void *mdp, CodaFid *fid, struct ucred *cred, struct proc *p,
- /*out*/ struct vattr *vap)
+venus_getattr(void *mdp, CodaFid *fid, struct ucred *cred, struct vattr *vap)
{
+ struct proc *p;
DECL(coda_getattr); /* sets Isize & Osize */
ALLOC(coda_getattr); /* sets inp & outp */
/*
* Send the open to venus.
*/
+ p = curthread->td_proc;
INIT_IN(&inp->ih, CODA_GETATTR, cred, p);
inp->Fid = *fid;
@@ -325,15 +326,16 @@ venus_getattr(void *mdp, CodaFid *fid, struct ucred *cred, struct proc *p,
}
int
-venus_setattr(void *mdp, CodaFid *fid, struct vattr *vap, struct ucred *cred,
- struct proc *p)
+venus_setattr(void *mdp, CodaFid *fid, struct vattr *vap, struct ucred *cred)
{
+ struct proc *p;
DECL_NO_OUT(coda_setattr); /* sets Isize & Osize */
ALLOC_NO_OUT(coda_setattr); /* sets inp & outp */
/*
* Send the open to venus.
*/
+ p = curthread->td_proc;
INIT_IN(&inp->ih, CODA_SETATTR, cred, p);
inp->Fid = *fid;
CNV_V2VV_ATTR(&inp->attr, vap);
diff --git a/sys/fs/coda/coda_venus.h b/sys/fs/coda/coda_venus.h
index 97e7be3..0d4dac0 100644
--- a/sys/fs/coda/coda_venus.h
+++ b/sys/fs/coda/coda_venus.h
@@ -44,9 +44,9 @@ void venus_write(void);
int venus_ioctl(void *mdp, CodaFid *fid, int com, int flag, caddr_t data,
struct ucred *cred, struct proc *p);
int venus_getattr(void *mdp, CodaFid *fid, struct ucred *cred,
- struct proc *p, /*out*/ struct vattr *vap);
+ struct vattr *vap);
int venus_setattr(void *mdp, CodaFid *fid, struct vattr *vap,
- struct ucred *cred, struct proc *p);
+ struct ucred *cred);
int venus_access(void *mdp, CodaFid *fid, int mode, struct ucred *cred,
struct proc *p);
int venus_readlink(void *mdp, CodaFid *fid, struct ucred *cred,
diff --git a/sys/fs/coda/coda_vnops.c b/sys/fs/coda/coda_vnops.c
index a24a9aa..f6165a9 100644
--- a/sys/fs/coda/coda_vnops.c
+++ b/sys/fs/coda/coda_vnops.c
@@ -382,7 +382,7 @@ coda_rdwr(struct vnode *vp, struct uio *uiop, enum uio_rw rw, int ioflag,
*/
{
struct vattr attr;
- if (VOP_GETATTR(cfvp, &attr, cred, td) == 0)
+ if (VOP_GETATTR(cfvp, &attr, cred) == 0)
vnode_pager_setsize(vp, attr.va_size);
}
}
@@ -504,7 +504,6 @@ coda_getattr(struct vop_getattr_args *ap)
struct cnode *cp = VTOC(vp);
struct vattr *vap = ap->a_vap;
struct ucred *cred = ap->a_cred;
- struct thread *td = ap->a_td;
/* locals */
struct vnode *convp;
int error, size;
@@ -533,7 +532,7 @@ coda_getattr(struct vop_getattr_args *ap)
MARK_INT_SAT(CODA_GETATTR_STATS);
return (0);
}
- error = venus_getattr(vtomi(vp), &cp->c_fid, cred, td->td_proc, vap);
+ error = venus_getattr(vtomi(vp), &cp->c_fid, cred, vap);
if (!error) {
CODADEBUG(CODA_GETATTR, myprintf(("getattr miss %s: result "
"%d\n", coda_f2s(&cp->c_fid), error)););
@@ -568,7 +567,6 @@ coda_setattr(struct vop_setattr_args *ap)
struct cnode *cp = VTOC(vp);
struct vattr *vap = ap->a_vap;
struct ucred *cred = ap->a_cred;
- struct thread *td = ap->a_td;
/* locals */
struct vnode *convp;
int error, size;
@@ -584,7 +582,7 @@ coda_setattr(struct vop_setattr_args *ap)
}
if (codadebug & CODADBGMSK(CODA_SETATTR))
coda_print_vattr(vap);
- error = venus_setattr(vtomi(vp), &cp->c_fid, vap, cred, td->td_proc);
+ error = venus_setattr(vtomi(vp), &cp->c_fid, vap, cred);
if (!error)
cp->c_flags &= ~(C_VATTR | C_ACCCACHE);
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
index 63ab7d4..d56e99b 100644
--- a/sys/fs/devfs/devfs_vnops.c
+++ b/sys/fs/devfs/devfs_vnops.c
@@ -1227,12 +1227,14 @@ devfs_setattr(struct vop_setattr_args *ap)
struct devfs_dirent *de;
struct vattr *vap;
struct vnode *vp;
+ struct thread *td;
int c, error;
uid_t uid;
gid_t gid;
vap = ap->a_vap;
vp = ap->a_vp;
+ td = curthread;
if ((vap->va_type != VNON) ||
(vap->va_nlink != VNOVAL) ||
(vap->va_fsid != VNOVAL) ||
@@ -1261,7 +1263,7 @@ devfs_setattr(struct vop_setattr_args *ap)
if (uid != de->de_uid || gid != de->de_gid) {
if ((ap->a_cred->cr_uid != de->de_uid) || uid != de->de_uid ||
(gid != de->de_gid && !groupmember(gid, ap->a_cred))) {
- error = priv_check(ap->a_td, PRIV_VFS_CHOWN);
+ error = priv_check(td, PRIV_VFS_CHOWN);
if (error)
return (error);
}
@@ -1272,7 +1274,7 @@ devfs_setattr(struct vop_setattr_args *ap)
if (vap->va_mode != (mode_t)VNOVAL) {
if (ap->a_cred->cr_uid != de->de_uid) {
- error = priv_check(ap->a_td, PRIV_VFS_ADMIN);
+ error = priv_check(td, PRIV_VFS_ADMIN);
if (error)
return (error);
}
@@ -1282,9 +1284,9 @@ devfs_setattr(struct vop_setattr_args *ap)
if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) {
/* See the comment in ufs_vnops::ufs_setattr(). */
- if ((error = VOP_ACCESS(vp, VADMIN, ap->a_cred, ap->a_td)) &&
+ if ((error = VOP_ACCESS(vp, VADMIN, ap->a_cred, td)) &&
((vap->va_vaflags & VA_UTIMES_NULL) == 0 ||
- (error = VOP_ACCESS(vp, VWRITE, ap->a_cred, ap->a_td))))
+ (error = VOP_ACCESS(vp, VWRITE, ap->a_cred, td))))
return (error);
if (vap->va_atime.tv_sec != VNOVAL) {
if (vp->v_type == VCHR)
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);
}
diff --git a/sys/fs/hpfs/hpfs_vnops.c b/sys/fs/hpfs/hpfs_vnops.c
index 9d22afa..a81681e 100644
--- a/sys/fs/hpfs/hpfs_vnops.c
+++ b/sys/fs/hpfs/hpfs_vnops.c
@@ -409,7 +409,6 @@ hpfs_getattr(ap)
struct vnode *a_vp;
struct vattr *a_vap;
struct ucred *a_cred;
- struct thread *a_td;
} */ *ap;
{
register struct vnode *vp = ap->a_vp;
@@ -457,14 +456,13 @@ hpfs_setattr(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 hpfsnode *hp = VTOHP(vp);
struct vattr *vap = ap->a_vap;
struct ucred *cred = ap->a_cred;
- struct thread *td = ap->a_td;
+ struct thread *td = curthread;
int error;
dprintf(("hpfs_setattr(0x%x):\n", hp->h_no));
diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c
index fe673e0..9e575fe 100644
--- a/sys/fs/msdosfs/msdosfs_vnops.c
+++ b/sys/fs/msdosfs/msdosfs_vnops.c
@@ -289,7 +289,6 @@ msdosfs_getattr(ap)
struct vnode *a_vp;
struct vattr *a_vap;
struct ucred *a_cred;
- struct thread *a_td;
} */ *ap;
{
struct denode *dep = VTODE(ap->a_vp);
@@ -366,7 +365,6 @@ msdosfs_setattr(ap)
struct vnode *a_vp;
struct vattr *a_vap;
struct ucred *a_cred;
- struct thread *a_td;
} */ *ap;
{
struct vnode *vp = ap->a_vp;
@@ -374,11 +372,12 @@ msdosfs_setattr(ap)
struct msdosfsmount *pmp = dep->de_pmp;
struct vattr *vap = ap->a_vap;
struct ucred *cred = ap->a_cred;
+ struct thread *td = curthread;
int error = 0;
#ifdef MSDOSFS_DEBUG
- printf("msdosfs_setattr(): vp %p, vap %p, cred %p, p %p\n",
- ap->a_vp, vap, cred, ap->a_td);
+ printf("msdosfs_setattr(): vp %p, vap %p, cred %p\n",
+ ap->a_vp, vap, cred);
#endif
/*
@@ -480,7 +479,7 @@ msdosfs_setattr(ap)
*/
break;
}
- error = detrunc(dep, vap->va_size, 0, cred, ap->a_td);
+ error = detrunc(dep, vap->va_size, 0, cred, td);
if (error)
return error;
}
@@ -488,12 +487,11 @@ msdosfs_setattr(ap)
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return (EROFS);
if (vap->va_vaflags & VA_UTIMES_NULL) {
- error = VOP_ACCESS(vp, VADMIN, cred, ap->a_td);
+ error = VOP_ACCESS(vp, VADMIN, cred, td);
if (error)
- error = VOP_ACCESS(vp, VWRITE, cred,
- ap->a_td);
+ error = VOP_ACCESS(vp, VWRITE, cred, td);
} else
- error = VOP_ACCESS(vp, VADMIN, cred, ap->a_td);
+ error = VOP_ACCESS(vp, VADMIN, cred, td);
if (vp->v_type != VDIR) {
if ((pmp->pm_flags & MSDOSFSMNT_NOWIN95) == 0 &&
vap->va_atime.tv_sec != VNOVAL) {
diff --git a/sys/fs/nwfs/nwfs_io.c b/sys/fs/nwfs/nwfs_io.c
index c7c4473..3ded52d 100644
--- a/sys/fs/nwfs/nwfs_io.c
+++ b/sys/fs/nwfs/nwfs_io.c
@@ -178,11 +178,11 @@ nwfs_readvnode(struct vnode *vp, struct uio *uiop, struct ucred *cred) {
biosize = NWFSTOCONN(nmp)->buffer_size;
if (np->n_flag & NMODIFIED) {
nwfs_attr_cacheremove(vp);
- error = VOP_GETATTR(vp, &vattr, cred, td);
+ error = VOP_GETATTR(vp, &vattr, cred);
if (error) return (error);
np->n_mtime = vattr.va_mtime.tv_sec;
} else {
- error = VOP_GETATTR(vp, &vattr, cred, td);
+ error = VOP_GETATTR(vp, &vattr, cred);
if (error) return (error);
if (np->n_mtime != vattr.va_mtime.tv_sec) {
error = nwfs_vinvalbuf(vp, td);
@@ -228,7 +228,7 @@ nwfs_writevnode(vp, uiop, cred, ioflag)
* the correct size. */
#ifdef notyet
nwfs_attr_cacheremove(vp);
- error = VOP_GETATTR(vp, &vattr, cred, td);
+ error = VOP_GETATTR(vp, &vattr, cred);
if (error) return (error);
#endif
uiop->uio_offset = np->n_size;
diff --git a/sys/fs/nwfs/nwfs_vnops.c b/sys/fs/nwfs/nwfs_vnops.c
index 8235604..a4ac871 100644
--- a/sys/fs/nwfs/nwfs_vnops.c
+++ b/sys/fs/nwfs/nwfs_vnops.c
@@ -175,11 +175,11 @@ nwfs_open(ap)
if ((error = nwfs_vinvalbuf(vp, ap->a_td)) == EINTR)
return (error);
np->n_atime = 0;
- error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td);
+ error = VOP_GETATTR(vp, &vattr, ap->a_cred);
if (error) return (error);
np->n_mtime = vattr.va_mtime.tv_sec;
} else {
- error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td);
+ error = VOP_GETATTR(vp, &vattr, ap->a_cred);
if (error) return (error);
if (np->n_mtime != vattr.va_mtime.tv_sec) {
if ((error = nwfs_vinvalbuf(vp, ap->a_td)) == EINTR)
@@ -262,13 +262,13 @@ nwfs_getattr(ap)
struct vnode *a_vp;
struct vattr *a_vap;
struct ucred *a_cred;
- struct thread *td;
} */ *ap;
{
struct vnode *vp = ap->a_vp;
struct nwnode *np = VTONW(vp);
struct vattr *va=ap->a_vap;
struct nwmount *nmp = VTONWFS(vp);
+ struct thread *td = curthread;
struct nw_entry_info fattr;
int error;
u_int32_t oldsize;
@@ -280,10 +280,10 @@ nwfs_getattr(ap)
oldsize = np->n_size;
if (np->n_flag & NVOLUME) {
error = ncp_obtain_info(nmp, np->n_fid.f_id, 0, NULL, &fattr,
- ap->a_td, ap->a_cred);
+ td, ap->a_cred);
} else {
error = ncp_obtain_info(nmp, np->n_fid.f_parent, np->n_nmlen,
- np->n_name, &fattr, ap->a_td, ap->a_cred);
+ np->n_name, &fattr, td, ap->a_cred);
}
if (error) {
NCPVNDEBUG("error %d\n", error);
@@ -304,7 +304,6 @@ nwfs_setattr(ap)
struct vnode *a_vp;
struct vattr *a_vap;
struct ucred *a_cred;
- struct thread *td;
} */ *ap;
{
struct vnode *vp = ap->a_vp;
@@ -342,13 +341,13 @@ nwfs_setattr(ap)
return EINVAL;
};
}
- error = ncp_setattr(vp, vap, ap->a_cred, ap->a_td);
+ error = ncp_setattr(vp, vap, ap->a_cred, curthread);
if (error && vap->va_size != VNOVAL) {
np->n_size = tsize;
vnode_pager_setsize(vp, (u_long)tsize);
}
np->n_atime = 0; /* invalidate cache */
- VOP_GETATTR(vp, vap, ap->a_cred, ap->a_td);
+ VOP_GETATTR(vp, vap, ap->a_cred);
np->n_mtime = vap->va_mtime.tv_sec;
return (0);
}
@@ -428,9 +427,8 @@ nwfs_create(ap)
*vpp = NULL;
if (vap->va_type == VSOCK)
return (EOPNOTSUPP);
- if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_thread))) {
+ if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)))
return (error);
- }
fmode = AR_READ | AR_WRITE;
/* if (vap->va_vaflags & VA_EXCLUSIVE)
fmode |= AR_DENY_READ | AR_DENY_WRITE;*/
@@ -636,9 +634,8 @@ nwfs_mkdir(ap)
struct vattr vattr;
char *name=cnp->cn_nameptr;
- if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_thread))) {
+ if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)))
return (error);
- }
if ((name[0] == '.') && ((len == 1) || ((len == 2) && (name[1] == '.')))) {
return EEXIST;
}
@@ -875,7 +872,7 @@ printf("dvp %d:%d:%d\n", (int)mp, (int)dvp->v_vflag & VV_ROOT, (int)flags & ISDO
struct vattr vattr;
vp = *vpp;
- if (VOP_GETATTR(vp, &vattr, cnp->cn_cred, td) == 0 &&
+ if (!VOP_GETATTR(vp, &vattr, cnp->cn_cred) &&
vattr.va_ctime.tv_sec == VTONW(vp)->n_ctime) {
if (nameiop != LOOKUP && islastcn)
cnp->cn_flags |= SAVENAME;
diff --git a/sys/fs/portalfs/portal_vnops.c b/sys/fs/portalfs/portal_vnops.c
index 5d086c9..871a40d 100644
--- a/sys/fs/portalfs/portal_vnops.c
+++ b/sys/fs/portalfs/portal_vnops.c
@@ -447,7 +447,6 @@ portal_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;
@@ -492,7 +491,6 @@ portal_setattr(ap)
struct vnode *a_vp;
struct vattr *a_vap;
struct ucred *a_cred;
- struct thread *a_td;
} */ *ap;
{
diff --git a/sys/fs/pseudofs/pseudofs_vnops.c b/sys/fs/pseudofs/pseudofs_vnops.c
index 2933784..48c45c9 100644
--- a/sys/fs/pseudofs/pseudofs_vnops.c
+++ b/sys/fs/pseudofs/pseudofs_vnops.c
@@ -128,7 +128,7 @@ pfs_access(struct vop_access_args *va)
PFS_TRACE(("%s", pvd->pvd_pn->pn_name));
(void)pvd;
- error = VOP_GETATTR(vn, &vattr, va->a_cred, va->a_td);
+ error = VOP_GETATTR(vn, &vattr, va->a_cred);
if (error)
PFS_RETURN (error);
error = vaccess(vn->v_type, vattr.va_mode, vattr.va_uid,
@@ -227,7 +227,7 @@ pfs_getattr(struct vop_getattr_args *va)
vap->va_uid = proc->p_ucred->cr_ruid;
vap->va_gid = proc->p_ucred->cr_rgid;
if (pn->pn_attr != NULL)
- error = pn_attr(va->a_td, proc, pn, vap);
+ error = pn_attr(curthread, proc, pn, vap);
PROC_UNLOCK(proc);
} else {
vap->va_uid = 0;
diff --git a/sys/fs/smbfs/smbfs_io.c b/sys/fs/smbfs/smbfs_io.c
index 163e722..5fbbc61 100644
--- a/sys/fs/smbfs/smbfs_io.c
+++ b/sys/fs/smbfs/smbfs_io.c
@@ -215,12 +215,12 @@ smbfs_readvnode(struct vnode *vp, struct uio *uiop, struct ucred *cred)
/* biosize = SSTOCN(smp->sm_share)->sc_txmax;*/
if (np->n_flag & NMODIFIED) {
smbfs_attr_cacheremove(vp);
- error = VOP_GETATTR(vp, &vattr, cred, td);
+ error = VOP_GETATTR(vp, &vattr, cred);
if (error)
return error;
np->n_mtime.tv_sec = vattr.va_mtime.tv_sec;
} else {
- error = VOP_GETATTR(vp, &vattr, cred, td);
+ error = VOP_GETATTR(vp, &vattr, cred);
if (error)
return error;
if (np->n_mtime.tv_sec != vattr.va_mtime.tv_sec) {
@@ -269,7 +269,7 @@ smbfs_writevnode(struct vnode *vp, struct uio *uiop,
* File size can be changed by another client
*/
smbfs_attr_cacheremove(vp);
- error = VOP_GETATTR(vp, &vattr, cred, td);
+ error = VOP_GETATTR(vp, &vattr, cred);
if (error) return (error);
#endif
uiop->uio_offset = np->n_size;
diff --git a/sys/fs/smbfs/smbfs_node.c b/sys/fs/smbfs/smbfs_node.c
index 02624d7..c6b8cff 100644
--- a/sys/fs/smbfs/smbfs_node.c
+++ b/sys/fs/smbfs/smbfs_node.c
@@ -205,7 +205,7 @@ loop:
if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td) != 0)
goto retry;
/* Force cached attributes to be refreshed if stale. */
- (void)VOP_GETATTR(vp, &vattr, td->td_ucred, td);
+ (void)VOP_GETATTR(vp, &vattr, td->td_ucred);
/*
* If the file type on the server is inconsistent with
* what it was when we created the vnode, kill the
@@ -366,7 +366,7 @@ smbfs_inactive(ap)
smb_makescred(&scred, td, cred);
smbfs_vinvalbuf(vp, td);
if (vp->v_type == VREG) {
- VOP_GETATTR(vp, &va, cred, td);
+ VOP_GETATTR(vp, &va, cred);
smbfs_smb_close(np->n_mount->sm_share, np->n_fid,
&np->n_mtime, &scred);
} else if (vp->v_type == VDIR) {
diff --git a/sys/fs/smbfs/smbfs_vnops.c b/sys/fs/smbfs/smbfs_vnops.c
index f7ca806..4504eb7 100644
--- a/sys/fs/smbfs/smbfs_vnops.c
+++ b/sys/fs/smbfs/smbfs_vnops.c
@@ -177,12 +177,12 @@ smbfs_open(ap)
if ((error = smbfs_vinvalbuf(vp, ap->a_td)) == EINTR)
return error;
smbfs_attr_cacheremove(vp);
- error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td);
+ error = VOP_GETATTR(vp, &vattr, ap->a_cred);
if (error)
return error;
np->n_mtime.tv_sec = vattr.va_mtime.tv_sec;
} else {
- error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td);
+ error = VOP_GETATTR(vp, &vattr, ap->a_cred);
if (error)
return error;
if (np->n_mtime.tv_sec != vattr.va_mtime.tv_sec) {
@@ -254,7 +254,6 @@ smbfs_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;
@@ -270,7 +269,7 @@ smbfs_getattr(ap)
if (!error)
return 0;
SMBVDEBUG("not in the cache\n");
- smb_makescred(&scred, ap->a_td, ap->a_cred);
+ smb_makescred(&scred, curthread, ap->a_cred);
oldsize = np->n_size;
error = smbfs_smb_lookup(np, NULL, 0, &fattr, &scred);
if (error) {
@@ -290,7 +289,6 @@ smbfs_setattr(ap)
struct vnode *a_vp;
struct vattr *a_vap;
struct ucred *a_cred;
- struct thread *a_td;
} */ *ap;
{
struct vnode *vp = ap->a_vp;
@@ -300,6 +298,7 @@ smbfs_setattr(ap)
struct smb_cred scred;
struct smb_share *ssp = np->n_mount->sm_share;
struct smb_vc *vcp = SSTOVC(ssp);
+ struct thread *td = curthread;
u_quad_t tsize = 0;
int isreadonly, doclose, error = 0;
int old_n_dosattr;
@@ -315,7 +314,7 @@ smbfs_setattr(ap)
vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL ||
vap->va_mode != (mode_t)VNOVAL) && isreadonly)
return EROFS;
- smb_makescred(&scred, ap->a_td, ap->a_cred);
+ smb_makescred(&scred, td, ap->a_cred);
if (vap->va_size != VNOVAL) {
switch (vp->v_type) {
case VDIR:
@@ -367,12 +366,11 @@ smbfs_setattr(ap)
atime = &vap->va_atime;
if (mtime != atime) {
if (vap->va_vaflags & VA_UTIMES_NULL) {
- error = VOP_ACCESS(vp, VADMIN, ap->a_cred, ap->a_td);
+ error = VOP_ACCESS(vp, VADMIN, ap->a_cred, td);
if (error)
- error = VOP_ACCESS(vp, VWRITE, ap->a_cred,
- ap->a_td);
+ error = VOP_ACCESS(vp, VWRITE, ap->a_cred, td);
} else
- error = VOP_ACCESS(vp, VADMIN, ap->a_cred, ap->a_td);
+ error = VOP_ACCESS(vp, VADMIN, ap->a_cred, td);
#if 0
if (mtime == NULL)
mtime = &np->n_mtime;
@@ -385,13 +383,15 @@ smbfs_setattr(ap)
*/
if ((np->n_flag & NOPEN) == 0) {
if (vcp->vc_flags & SMBV_WIN95) {
- error = VOP_OPEN(vp, FWRITE, ap->a_cred, ap->a_td, NULL);
+ error = VOP_OPEN(vp, FWRITE, ap->a_cred, td,
+ NULL);
if (!error) {
-/* error = smbfs_smb_setfattrNT(np, 0, mtime, atime, &scred);
- VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td);*/
- if (mtime)
- np->n_mtime = *mtime;
- VOP_CLOSE(vp, FWRITE, ap->a_cred, ap->a_td);
+/* error = smbfs_smb_setfattrNT(np, 0,
+ mtime, atime, &scred);
+ VOP_GETATTR(vp, &vattr, ap->a_cred); */
+ if (mtime)
+ np->n_mtime = *mtime;
+ VOP_CLOSE(vp, FWRITE, ap->a_cred, td);
}
} else if ((vcp->vc_sopt.sv_caps & SMB_CAP_NT_SMBS)) {
error = smbfs_smb_setptime2(np, mtime, atime, 0, &scred);
@@ -421,7 +421,7 @@ smbfs_setattr(ap)
* required attributes.
*/
smbfs_attr_cacheremove(vp); /* invalidate cache */
- VOP_GETATTR(vp, vap, ap->a_cred, ap->a_td);
+ VOP_GETATTR(vp, vap, ap->a_cred);
np->n_mtime.tv_sec = vap->va_mtime.tv_sec;
return error;
}
@@ -497,7 +497,7 @@ smbfs_create(ap)
*vpp = NULL;
if (vap->va_type != VREG)
return EOPNOTSUPP;
- if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_thread)))
+ if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)))
return error;
smb_makescred(&scred, cnp->cn_thread, cnp->cn_cred);
@@ -696,7 +696,7 @@ smbfs_mkdir(ap)
int len = cnp->cn_namelen;
int error;
- if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred, cnp->cn_thread))) {
+ if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred))) {
return error;
}
if ((name[0] == '.') && ((len == 1) || ((len == 2) && (name[1] == '.'))))
@@ -906,7 +906,7 @@ smbfs_getextattr(struct vop_getextattr_args *ap)
error = VOP_ACCESS(vp, VREAD, cred, td);
if (error)
return error;
- error = VOP_GETATTR(vp, &vattr, cred, td);
+ error = VOP_GETATTR(vp, &vattr, cred);
if (error)
return error;
if (strcmp(name, "dosattr") == 0) {
@@ -1147,7 +1147,7 @@ smbfs_lookup(ap)
killit = 0;
vp = *vpp;
- error = VOP_GETATTR(vp, &vattr, cnp->cn_cred, td);
+ error = VOP_GETATTR(vp, &vattr, cnp->cn_cred);
/*
* If the file type on the server is inconsistent
* with what it was when we created the vnode,
diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c
index a14558b..db6af72 100644
--- a/sys/fs/tmpfs/tmpfs_vfsops.c
+++ b/sys/fs/tmpfs/tmpfs_vfsops.c
@@ -217,7 +217,7 @@ tmpfs_mount(struct mount *mp, struct thread *td)
"feature in FreeBSD.\n");
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);
VOP_UNLOCK(mp->mnt_vnodecovered, 0);
if (error)
return (error);
diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c
index 719a5de..066f9c9 100644
--- a/sys/fs/tmpfs/tmpfs_vnops.c
+++ b/sys/fs/tmpfs/tmpfs_vnops.c
@@ -390,7 +390,7 @@ tmpfs_setattr(struct vop_setattr_args *v)
struct vnode *vp = v->a_vp;
struct vattr *vap = v->a_vap;
struct ucred *cred = v->a_cred;
- struct thread *l = v->a_td;
+ struct thread *td = curthread;
int error;
@@ -410,17 +410,16 @@ tmpfs_setattr(struct vop_setattr_args *v)
error = EINVAL;
if (error == 0 && (vap->va_flags != VNOVAL))
- error = tmpfs_chflags(vp, vap->va_flags, cred, l);
+ error = tmpfs_chflags(vp, vap->va_flags, cred, td);
if (error == 0 && (vap->va_size != VNOVAL))
- error = tmpfs_chsize(vp, vap->va_size, cred, l);
+ error = tmpfs_chsize(vp, vap->va_size, cred, td);
if (error == 0 && (vap->va_uid != VNOVAL || vap->va_gid != VNOVAL))
- error = tmpfs_chown(vp, vap->va_uid, vap->va_gid, cred,
- l);
+ error = tmpfs_chown(vp, vap->va_uid, vap->va_gid, cred, td);
if (error == 0 && (vap->va_mode != (mode_t)VNOVAL))
- error = tmpfs_chmod(vp, vap->va_mode, cred, l);
+ error = tmpfs_chmod(vp, vap->va_mode, cred, td);
if (error == 0 && ((vap->va_atime.tv_sec != VNOVAL &&
vap->va_atime.tv_nsec != VNOVAL) ||
@@ -429,7 +428,7 @@ tmpfs_setattr(struct vop_setattr_args *v)
(vap->va_birthtime.tv_sec != VNOVAL &&
vap->va_birthtime.tv_nsec != VNOVAL)))
error = tmpfs_chtimes(vp, &vap->va_atime, &vap->va_mtime,
- &vap->va_birthtime, vap->va_vaflags, cred, l);
+ &vap->va_birthtime, vap->va_vaflags, cred, td);
/* Update the node times. We give preference to the error codes
* generated by this function rather than the ones that may arise
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