summaryrefslogtreecommitdiffstats
path: root/sys/fs/nwfs
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/nwfs
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/nwfs')
-rw-r--r--sys/fs/nwfs/nwfs_io.c6
-rw-r--r--sys/fs/nwfs/nwfs_vnops.c23
2 files changed, 13 insertions, 16 deletions
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;
OpenPOWER on IntegriCloud