summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2008-01-13 14:44:15 +0000
committerattilio <attilio@FreeBSD.org>2008-01-13 14:44:15 +0000
commit71b7824213151e91b40ee4afa9fa7f100c90ed0b (patch)
tree880b0acaab5ef09fe469c4b041d99ff26adca8b8 /sys/compat
parent28827547bbae974e5ca23ee55d1ba558da366885 (diff)
downloadFreeBSD-src-71b7824213151e91b40ee4afa9fa7f100c90ed0b.zip
FreeBSD-src-71b7824213151e91b40ee4afa9fa7f100c90ed0b.tar.gz
VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used in
conjuction with 'thread' argument passing which is always curthread. Remove the unuseful extra-argument and pass explicitly curthread to lower layer functions, when necessary. KPI results broken by this change, which should affect several ports, so version bumping and manpage update will be further committed. Tested by: kris, pho, Diego Sardina <siarodx at gmail dot com>
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_file.c2
-rw-r--r--sys/compat/linux/linux_misc.c4
-rw-r--r--sys/compat/ndis/subr_ndis.c2
-rw-r--r--sys/compat/opensolaris/kern/opensolaris_kobj.c8
-rw-r--r--sys/compat/opensolaris/kern/opensolaris_vfs.c6
-rw-r--r--sys/compat/opensolaris/sys/vnode.h7
-rw-r--r--sys/compat/pecoff/imgact_pecoff.c5
-rw-r--r--sys/compat/svr4/imgact_svr4.c3
-rw-r--r--sys/compat/svr4/svr4_fcntl.c2
-rw-r--r--sys/compat/svr4/svr4_misc.c6
10 files changed, 21 insertions, 24 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c
index 66192a3..2a12a67 100644
--- a/sys/compat/linux/linux_file.c
+++ b/sys/compat/linux/linux_file.c
@@ -598,7 +598,7 @@ out:
if (cookies)
free(cookies, M_TEMP);
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
fdrop(fp, td);
free(buf, M_TEMP);
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index 96adc6d..1adb656 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -377,7 +377,7 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args)
* Lock no longer needed
*/
locked = 0;
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
/*
@@ -458,7 +458,7 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args)
cleanup:
/* Unlock vnode if needed */
if (locked) {
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
}
diff --git a/sys/compat/ndis/subr_ndis.c b/sys/compat/ndis/subr_ndis.c
index e4269b5..8c90d82 100644
--- a/sys/compat/ndis/subr_ndis.c
+++ b/sys/compat/ndis/subr_ndis.c
@@ -2970,7 +2970,7 @@ NdisOpenFile(status, filehandle, filelength, filename, highestaddr)
/* Get the file size. */
VOP_GETATTR(nd.ni_vp, vap, td->td_ucred, td);
- VOP_UNLOCK(nd.ni_vp, 0, td);
+ VOP_UNLOCK(nd.ni_vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
fh->nf_vp = nd.ni_vp;
diff --git a/sys/compat/opensolaris/kern/opensolaris_kobj.c b/sys/compat/opensolaris/kern/opensolaris_kobj.c
index 6014c2e..efb2885 100644
--- a/sys/compat/opensolaris/kern/opensolaris_kobj.c
+++ b/sys/compat/opensolaris/kern/opensolaris_kobj.c
@@ -77,12 +77,12 @@ kobj_open_file_vnode(const char *file)
flags = FREAD;
NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, file, td);
- error = vn_open_cred(&nd, &flags, 0, td->td_ucred, NULL);
+ error = vn_open_cred(&nd, &flags, 0, curthread->td_ucred, NULL);
NDFREE(&nd, NDF_ONLY_PNBUF);
if (error != 0)
return (NULL);
/* We just unlock so we hold a reference. */
- VOP_UNLOCK(nd.ni_vp, 0, td);
+ VOP_UNLOCK(nd.ni_vp, 0);
return (nd.ni_vp);
}
@@ -125,7 +125,7 @@ kobj_get_filesize_vnode(struct _buf *file, uint64_t *size)
vn_lock(vp, LK_SHARED | LK_RETRY);
error = VOP_GETATTR(vp, &va, td->td_ucred, td);
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
if (error == 0)
*size = (uint64_t)va.va_size;
return (error);
@@ -178,7 +178,7 @@ kobj_read_file_vnode(struct _buf *file, char *buf, unsigned size, unsigned off)
vn_lock(vp, LK_SHARED | LK_RETRY);
error = VOP_READ(vp, &auio, IO_UNIT | IO_SYNC, td->td_ucred);
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
return (error != 0 ? -1 : size - auio.uio_resid);
}
diff --git a/sys/compat/opensolaris/kern/opensolaris_vfs.c b/sys/compat/opensolaris/kern/opensolaris_vfs.c
index 93eba51..166eeed 100644
--- a/sys/compat/opensolaris/kern/opensolaris_vfs.c
+++ b/sys/compat/opensolaris/kern/opensolaris_vfs.c
@@ -194,7 +194,7 @@ domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath,
*/
vn_lock(vp, LK_SHARED | LK_RETRY);
mp = vfs_mount_alloc(vp, vfsp, fspath, td);
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
mp->mnt_optnew = NULL;
vfs_setmntopt(mp, "from", fspec, 0);
@@ -260,7 +260,7 @@ domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath,
panic("mount: lost mount");
mountcheckdirs(vp, mvp);
vput(mvp);
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
if ((mp->mnt_flag & MNT_RDONLY) == 0)
error = vfs_allocate_syncvnode(mp);
vfs_unbusy(mp, td);
@@ -272,7 +272,7 @@ domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath,
VI_LOCK(vp);
vp->v_iflag &= ~VI_MOUNT;
VI_UNLOCK(vp);
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
vfs_unbusy(mp, td);
vfs_mount_destroy(mp);
}
diff --git a/sys/compat/opensolaris/sys/vnode.h b/sys/compat/opensolaris/sys/vnode.h
index 171b7fe..a8a261c 100644
--- a/sys/compat/opensolaris/sys/vnode.h
+++ b/sys/compat/opensolaris/sys/vnode.h
@@ -175,7 +175,7 @@ zfs_vn_open(char *pnamep, enum uio_seg seg, int filemode, int createmode,
if (error == 0) {
/* We just unlock so we hold a reference. */
VN_HOLD(nd.ni_vp);
- VOP_UNLOCK(nd.ni_vp, 0, td);
+ VOP_UNLOCK(nd.ni_vp, 0);
*vpp = nd.ni_vp;
}
return (error);
@@ -213,7 +213,6 @@ zfs_vn_rdwr(enum uio_rw rw, vnode_t *vp, caddr_t base, ssize_t len,
static __inline int
zfs_vop_fsync(vnode_t *vp, int flag, cred_t *cr)
{
- struct thread *td = curthread;
struct mount *mp;
int error, vfslocked;
@@ -223,8 +222,8 @@ zfs_vop_fsync(vnode_t *vp, int flag, cred_t *cr)
if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0)
goto drop;
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
- error = VOP_FSYNC(vp, MNT_WAIT, td);
- VOP_UNLOCK(vp, 0, td);
+ error = VOP_FSYNC(vp, MNT_WAIT, curthread);
+ VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
drop:
VFS_UNLOCK_GIANT(vfslocked);
diff --git a/sys/compat/pecoff/imgact_pecoff.c b/sys/compat/pecoff/imgact_pecoff.c
index 54ee1b2..cd2fab3 100644
--- a/sys/compat/pecoff/imgact_pecoff.c
+++ b/sys/compat/pecoff/imgact_pecoff.c
@@ -316,7 +316,7 @@ pecoff_load_file(struct thread * td, const char *file, u_long * addr, u_long * e
* Check permissions, modes, uid, etc on the file, and "open" it.
*/
error = exec_check_permissions(imgp);
- VOP_UNLOCK(nd.ni_vp, 0, td);
+ VOP_UNLOCK(nd.ni_vp, 0);
if (error)
goto fail;
if ((error = pecoff_read_from(td, imgp->vp, 0, (caddr_t) & dh, sizeof(dh))) != 0)
@@ -579,14 +579,13 @@ imgact_pecoff(struct image_params * imgp)
imgp->image_header;
struct coff_filehdr *fp;
int error, peofs;
- struct thread *td = curthread;
error = pecoff_signature(FIRST_THREAD_IN_PROC(imgp->proc),
imgp->vp, dp);
if (error) {
return -1;
}
- VOP_UNLOCK(imgp->vp, 0, td);
+ VOP_UNLOCK(imgp->vp, 0);
peofs = dp->d_peofs + sizeof(signature) - 1;
fp = malloc(PECOFF_HDR_SIZE, M_TEMP, M_WAITOK);
diff --git a/sys/compat/svr4/imgact_svr4.c b/sys/compat/svr4/imgact_svr4.c
index d755368..5d80f10 100644
--- a/sys/compat/svr4/imgact_svr4.c
+++ b/sys/compat/svr4/imgact_svr4.c
@@ -68,7 +68,6 @@ exec_svr4_imgact(imgp)
vm_offset_t buffer;
unsigned long bss_size;
int error;
- struct thread *td = curthread;
if (((a_out->a_magic >> 16) & 0xff) != 0x64)
return -1;
@@ -115,7 +114,7 @@ exec_svr4_imgact(imgp)
}
PROC_UNLOCK(imgp->proc);
- VOP_UNLOCK(imgp->vp, 0, td);
+ VOP_UNLOCK(imgp->vp, 0);
/*
* Destroy old process VM and create a new one (with a new stack)
diff --git a/sys/compat/svr4/svr4_fcntl.c b/sys/compat/svr4/svr4_fcntl.c
index ff52bb1..40ae830 100644
--- a/sys/compat/svr4/svr4_fcntl.c
+++ b/sys/compat/svr4/svr4_fcntl.c
@@ -272,7 +272,7 @@ fd_revoke(td, fd)
#ifdef MAC
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = mac_vnode_check_revoke(td->td_ucred, vp);
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
if (error)
goto out;
#endif
diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c
index cc07c25..9d9011c 100644
--- a/sys/compat/svr4/svr4_misc.c
+++ b/sys/compat/svr4/svr4_misc.c
@@ -396,7 +396,7 @@ again:
eof:
td->td_retval[0] = nbytes - resid;
out:
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
fdrop(fp, td);
if (cookies)
@@ -529,7 +529,7 @@ again:
eof:
*retval = uap->nbytes - resid;
out:
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
fdrop(fp, td);
if (cookiebuf)
@@ -629,7 +629,7 @@ svr4_sys_fchroot(td, uap)
if (error)
goto fail;
#endif
- VOP_UNLOCK(vp, 0, td);
+ VOP_UNLOCK(vp, 0);
error = change_root(vp, td);
vrele(vp);
VFS_UNLOCK_GIANT(vfslocked);
OpenPOWER on IntegriCloud