aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2022-08-04 13:39:25 +0000
committerMark Johnston <markj@FreeBSD.org>2022-08-04 13:39:25 +0000
commitd07675a9352efce5e997e987080b3f98bbfdac96 (patch)
tree7ff9758495f484cecb6fe940f4367eba5098938f /sys/kern/kern_fork.c
parent100ddf892240c1ae34522d04f16b6e1998643020 (diff)
downloadsrc-d07675a9352efce5e997e987080b3f98bbfdac96.tar.gz
src-d07675a9352efce5e997e987080b3f98bbfdac96.zip
file: Move code to share fdtol structs into kern_descrip.c
This ensures the filedesc-to-leader code is consistently encapsulated in kern_descrip.c. No functional change intended. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35988
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r--sys/kern/kern_fork.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 60bf8a7093c9..d7f737832824 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -451,10 +451,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread *
* Shared file descriptor table, and shared
* process leaders.
*/
- fdtol = p1->p_fdtol;
- FILEDESC_XLOCK(p1->p_fd);
- fdtol->fdl_refcount++;
- FILEDESC_XUNLOCK(p1->p_fd);
+ fdtol = filedesc_to_leader_share(p1->p_fdtol, p1->p_fd);
} else {
/*
* Shared file descriptor table, and different