diff options
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r-- | sys/kern/kern_descrip.c | 17 |
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)); |