summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2007-03-15 21:19:21 +0000
committerjhb <jhb@FreeBSD.org>2007-03-15 21:19:21 +0000
commitcbfbccd2212ab1f4583b0b44881cb991088c238b (patch)
tree3885a3c207a58763bc21d85c1ed50c0c9caef45a /sys/kern
parent9bb7d4296ba5713ffb3cebb43dd89e77d5f18443 (diff)
downloadFreeBSD-src-cbfbccd2212ab1f4583b0b44881cb991088c238b.zip
FreeBSD-src-cbfbccd2212ab1f4583b0b44881cb991088c238b.tar.gz
Just use 'fdrop()' instead of 'FILE_LOCK(); fdrop_locked()' in
dupfdopen(). While I'm at it, move the second fdrop() out from under the filedesc lock.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_descrip.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index f37126f..b4e9e4c 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -2296,14 +2296,12 @@ dupfdopen(struct thread *td, struct filedesc *fdp, int indx, int dfd, int mode,
fhold_locked(wfp);
FILE_UNLOCK(wfp);
FILEDESC_UNLOCK(fdp);
- if (fp != NULL) {
+ if (fp != NULL)
/*
* We now own the reference to fp that the ofiles[]
* array used to own. Release it.
*/
- FILE_LOCK(fp);
- fdrop_locked(fp, td);
- }
+ fdrop(fp, td);
return (0);
case ENXIO:
@@ -2318,18 +2316,14 @@ dupfdopen(struct thread *td, struct filedesc *fdp, int indx, int dfd, int mode,
fdunused(fdp, dfd);
if (fp == NULL)
fdused(fdp, indx);
- if (fp != NULL)
- FILE_LOCK(fp);
+ FILEDESC_UNLOCK(fdp);
/*
* We now own the reference to fp that the ofiles[] array
* used to own. Release it.
*/
if (fp != NULL)
- fdrop_locked(fp, td);
-
- FILEDESC_UNLOCK(fdp);
-
+ fdrop(fp, td);
return (0);
default:
OpenPOWER on IntegriCloud