summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_descrip.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2013-02-26 18:11:43 +0000
committerattilio <attilio@FreeBSD.org>2013-02-26 18:11:43 +0000
commit134623836d0dcb10f5bc79c883bd239098952cca (patch)
tree53b8f81bf2dd71d981f19cb4460f54d0cd525234 /sys/kern/kern_descrip.c
parentcff31deb1a197b29ab976c135fdd01dfb6951a6a (diff)
parent49f99b72515864c7f48e1d57295de7c122876049 (diff)
downloadFreeBSD-src-134623836d0dcb10f5bc79c883bd239098952cca.zip
FreeBSD-src-134623836d0dcb10f5bc79c883bd239098952cca.tar.gz
MFC
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r--sys/kern/kern_descrip.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 9de55e82..acdea40 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -855,9 +855,7 @@ do_dup(struct thread *td, int flags, int old, int new,
/*
* If the caller specified a file descriptor, make sure the file
* table is large enough to hold it, and grab it. Otherwise, just
- * allocate a new descriptor the usual way. Since the filedesc
- * lock may be temporarily dropped in the process, we have to look
- * out for a race.
+ * allocate a new descriptor the usual way.
*/
if (flags & DUP_FIXED) {
if (new >= fdp->fd_nfiles) {
@@ -1427,8 +1425,7 @@ fdgrowtable(struct filedesc *fdp, int nfd)
FILEDESC_XLOCK_ASSERT(fdp);
- KASSERT(fdp->fd_nfiles > 0,
- ("zero-length file table"));
+ KASSERT(fdp->fd_nfiles > 0, ("zero-length file table"));
/* save old values */
onfiles = fdp->fd_nfiles;
@@ -1449,13 +1446,11 @@ fdgrowtable(struct filedesc *fdp, int nfd)
* it on the freelist. We place the struct freetable in the
* middle so we don't have to worry about padding.
*/
- ntable = malloc(nnfiles * sizeof(*ntable) +
- sizeof(struct freetable) +
- nnfiles * sizeof(*nfileflags),
- M_FILEDESC, M_ZERO | M_WAITOK);
+ ntable = malloc(nnfiles * sizeof(*ntable) + sizeof(struct freetable) +
+ nnfiles * sizeof(*nfileflags), M_FILEDESC, M_ZERO | M_WAITOK);
nfileflags = (char *)&ntable[nnfiles] + sizeof(struct freetable);
- nmap = malloc(NDSLOTS(nnfiles) * NDSLOTSIZE,
- M_FILEDESC, M_ZERO | M_WAITOK);
+ nmap = malloc(NDSLOTS(nnfiles) * NDSLOTSIZE, M_FILEDESC,
+ M_ZERO | M_WAITOK);
/* copy the old data over and point at the new tables */
memcpy(ntable, otable, onfiles * sizeof(*otable));
OpenPOWER on IntegriCloud