summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-11-13 11:53:02 +0000
committerphk <phk@FreeBSD.org>2004-11-13 11:53:02 +0000
commit216166ee0de39b10ba8e60f4115d65e1251ff29f (patch)
tree15f70d195895ba0b6c385bc2892b07302db4faaa /sys/kern/kern_fork.c
parent32d92d3a1a6bf10d16cd48469ec464510bd8ff2f (diff)
downloadFreeBSD-src-216166ee0de39b10ba8e60f4115d65e1251ff29f.zip
FreeBSD-src-216166ee0de39b10ba8e60f4115d65e1251ff29f.tar.gz
Introduce an alias for FILEDESC_{UN}LOCK() with the suffix _FAST.
Use this in all the places where sleeping with the lock held is not an issue. The distinction will become significant once we finalize the exact lock-type to use for this kind of case.
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r--sys/kern/kern_fork.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index c6e2f12..9d90b1c 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -234,16 +234,16 @@ fork1(td, flags, pages, procp)
* Unshare file descriptors (from parent).
*/
if (flags & RFFDG) {
- FILEDESC_LOCK(p1->p_fd);
+ FILEDESC_LOCK_FAST(p1->p_fd);
if (p1->p_fd->fd_refcnt > 1) {
struct filedesc *newfd;
- FILEDESC_UNLOCK(p1->p_fd);
+ FILEDESC_UNLOCK_FAST(p1->p_fd);
newfd = fdcopy(p1->p_fd);
fdfree(td);
p1->p_fd = newfd;
} else
- FILEDESC_UNLOCK(p1->p_fd);
+ FILEDESC_UNLOCK_FAST(p1->p_fd);
}
*procp = NULL;
return (0);
@@ -439,9 +439,9 @@ again:
* shared process leaders.
*/
fdtol = p1->p_fdtol;
- FILEDESC_LOCK(p1->p_fd);
+ FILEDESC_LOCK_FAST(p1->p_fd);
fdtol->fdl_refcount++;
- FILEDESC_UNLOCK(p1->p_fd);
+ FILEDESC_UNLOCK_FAST(p1->p_fd);
} else {
/*
* Shared file descriptor table, and
OpenPOWER on IntegriCloud