diff options
author | jhb <jhb@FreeBSD.org> | 2009-05-20 18:42:04 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2009-05-20 18:42:04 +0000 |
commit | ebdd571432523104dcdd5ff6b619fc12082420f7 (patch) | |
tree | c2ed6773ef88aad3f00a29b5878632f494601277 /sys/kern/kern_descrip.c | |
parent | 6cadac237db9508bc72e88005c2e65fe43974123 (diff) | |
download | FreeBSD-src-ebdd571432523104dcdd5ff6b619fc12082420f7.zip FreeBSD-src-ebdd571432523104dcdd5ff6b619fc12082420f7.tar.gz |
Set the umask in a new file descriptor table earlier in fdcopy() to remove
two lock operations.
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r-- | sys/kern/kern_descrip.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index e0008e6..4553bb4 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -1626,17 +1626,15 @@ fdcopy(struct filedesc *fdp) newfdp->fd_freefile = i; } } + newfdp->fd_cmask = fdp->fd_cmask; FILEDESC_SUNLOCK(fdp); FILEDESC_XLOCK(newfdp); for (i = 0; i <= newfdp->fd_lastfile; ++i) if (newfdp->fd_ofiles[i] != NULL) fdused(newfdp, i); - FILEDESC_XUNLOCK(newfdp); - FILEDESC_SLOCK(fdp); if (newfdp->fd_freefile == -1) newfdp->fd_freefile = i; - newfdp->fd_cmask = fdp->fd_cmask; - FILEDESC_SUNLOCK(fdp); + FILEDESC_XUNLOCK(newfdp); return (newfdp); } |