diff options
Diffstat (limited to 'sys/fs/fdescfs')
-rw-r--r-- | sys/fs/fdescfs/fdesc.h | 2 | ||||
-rw-r--r-- | sys/fs/fdescfs/fdesc_vfsops.c | 22 | ||||
-rw-r--r-- | sys/fs/fdescfs/fdesc_vnops.c | 7 |
3 files changed, 16 insertions, 15 deletions
diff --git a/sys/fs/fdescfs/fdesc.h b/sys/fs/fdescfs/fdesc.h index 06f53fb..477193a 100644 --- a/sys/fs/fdescfs/fdesc.h +++ b/sys/fs/fdescfs/fdesc.h @@ -65,5 +65,5 @@ extern struct mtx fdesc_hashmtx; extern vfs_init_t fdesc_init; extern vfs_uninit_t fdesc_uninit; extern int fdesc_allocvp(fdntype, unsigned, int, struct mount *, - struct vnode **, struct thread *); + struct vnode **); #endif /* _KERNEL */ diff --git a/sys/fs/fdescfs/fdesc_vfsops.c b/sys/fs/fdescfs/fdesc_vfsops.c index 9651313..fdbcaba 100644 --- a/sys/fs/fdescfs/fdesc_vfsops.c +++ b/sys/fs/fdescfs/fdesc_vfsops.c @@ -64,7 +64,7 @@ static vfs_root_t fdesc_root; * Compatibility shim for old mount(2) system call. */ int -fdesc_cmount(struct mntarg *ma, void *data, int flags, struct thread *td) +fdesc_cmount(struct mntarg *ma, void *data, int flags) { return kernel_mount(ma, flags); } @@ -73,7 +73,7 @@ fdesc_cmount(struct mntarg *ma, void *data, int flags, struct thread *td) * Mount the per-process file descriptors (/dev/fd) */ static int -fdesc_mount(struct mount *mp, struct thread *td) +fdesc_mount(struct mount *mp) { int error = 0; struct fdescmount *fmp; @@ -94,7 +94,7 @@ fdesc_mount(struct mount *mp, struct thread *td) */ mp->mnt_data = (qaddr_t) fmp; fmp->flags = 0; - error = fdesc_allocvp(Froot, -1, FD_ROOT, mp, &rvp, td); + error = fdesc_allocvp(Froot, -1, FD_ROOT, mp, &rvp); if (error) { free(fmp, M_FDESCMNT); mp->mnt_data = 0; @@ -116,10 +116,9 @@ fdesc_mount(struct mount *mp, struct thread *td) } static int -fdesc_unmount(mp, mntflags, td) +fdesc_unmount(mp, mntflags) struct mount *mp; int mntflags; - struct thread *td; { struct fdescmount *fmp; caddr_t data; @@ -143,7 +142,7 @@ fdesc_unmount(mp, mntflags, td) * There is 1 extra root vnode reference corresponding * to f_root. */ - if ((error = vflush(mp, 1, flags, td)) != 0) + if ((error = vflush(mp, 1, flags, curthread)) != 0) return (error); /* @@ -160,11 +159,10 @@ fdesc_unmount(mp, mntflags, td) } static int -fdesc_root(mp, flags, vpp, td) +fdesc_root(mp, flags, vpp) struct mount *mp; int flags; struct vnode **vpp; - struct thread *td; { struct vnode *vp; @@ -172,23 +170,25 @@ fdesc_root(mp, flags, vpp, td) * Return locked reference to root. */ vp = VFSTOFDESC(mp)->f_root; - vget(vp, LK_EXCLUSIVE | LK_RETRY, td); + vget(vp, LK_EXCLUSIVE | LK_RETRY, curthread); *vpp = vp; return (0); } static int -fdesc_statfs(mp, sbp, td) +fdesc_statfs(mp, sbp) struct mount *mp; struct statfs *sbp; - struct thread *td; { + struct thread *td; struct filedesc *fdp; int lim; int i; int last; int freefd; + td = curthread; + /* * Compute number of free file descriptors. * [ Strange results will ensue if the open file diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index d1788ae..9857d93 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -145,20 +145,21 @@ fdesc_remove_entry(struct fdescnode *fd) } int -fdesc_allocvp(ftype, fd_fd, ix, mp, vpp, td) +fdesc_allocvp(ftype, fd_fd, ix, mp, vpp) fdntype ftype; unsigned fd_fd; int ix; struct mount *mp; struct vnode **vpp; - struct thread *td; { struct fdescmount *fmp; struct fdhashhead *fc; struct fdescnode *fd, *fd2; struct vnode *vp, *vp2; + struct thread *td; int error = 0; + td = curthread; fc = FD_NHASH(ix); loop: mtx_lock(&fdesc_hashmtx); @@ -328,7 +329,7 @@ fdesc_lookup(ap) vhold(dvp); VOP_UNLOCK(dvp, 0); error = fdesc_allocvp(Fdesc, fd, FD_DESC + fd, dvp->v_mount, - &fvp, td); + &fvp); fdrop(fp, td); /* * The root vnode must be locked last to prevent deadlock condition. |