aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_descrip.c
diff options
context:
space:
mode:
authorAlfred Perlstein <alfred@FreeBSD.org>2003-01-01 01:01:14 +0000
committerAlfred Perlstein <alfred@FreeBSD.org>2003-01-01 01:01:14 +0000
commitc7f1c11b205a9632c15924b49c25e55dc0f33ed8 (patch)
tree04b5ebad0155684fd0a069e7d13afa8415032941 /sys/kern/kern_descrip.c
parent59c97598d311e3e71f9e5598d532223e5855e3bd (diff)
downloadsrc-c7f1c11b205a9632c15924b49c25e55dc0f33ed8.tar.gz
src-c7f1c11b205a9632c15924b49c25e55dc0f33ed8.zip
Since fdshare() and fdinit() only operate on filedescs, make them
take pointers to filedesc structures instead of threads. This makes it more clear that they do not do any voodoo with the thread/proc or anything other than the filedesc passed in or returned. Remove some XXX KSE's as this resolves the issue.
Notes
Notes: svn path=/head/; revision=108520
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r--sys/kern/kern_descrip.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index dba34c50735c..fbc12e433ffd 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -1202,14 +1202,14 @@ ffree(fp)
}
/*
- * Build a new filedesc structure.
+ * Build a new filedesc structure from another.
+ * Copy the current, root, and jail root vnode references.
*/
struct filedesc *
-fdinit(td)
- struct thread *td;
+fdinit(fdp)
+ struct filedesc *fdp;
{
register struct filedesc0 *newfdp;
- register struct filedesc *fdp = td->td_proc->p_fd;
MALLOC(newfdp, struct filedesc0 *, sizeof(struct filedesc0),
M_FILEDESC, M_WAITOK | M_ZERO);
@@ -1238,13 +1238,13 @@ fdinit(td)
* Share a filedesc structure.
*/
struct filedesc *
-fdshare(p)
- struct proc *p;
+fdshare(fdp)
+ struct filedesc *fdp;
{
- FILEDESC_LOCK(p->p_fd);
- p->p_fd->fd_refcnt++;
- FILEDESC_UNLOCK(p->p_fd);
- return (p->p_fd);
+ FILEDESC_LOCK(fdp);
+ fdp->fd_refcnt++;
+ FILEDESC_UNLOCK(fdp);
+ return (fdp);
}
/*