csjp 7448676f59 Restore fd optimization with a few minor tweaks, to quote tegge:
"fdinit() fails to initialize newfdp->fd_fd.fd_lastfile to -1.  This breaks
fdcopy() which will incorrectly set newfdp->fd_freefile to 1 if no files are
open and the last file descriptor marked as unused for fdp was 0.  This later
causes descriptor 0 to be unavailable in newfdp when the optimization is
enabled.

When the last file descriptor previously marked as used is nonzero and marked
as unused, fdunused() incorrectly sets fdp->fd_lastfile to fd - 1 due to
fd_last_used() returning (size - 1).  This hides the problem that breaks the
optimization."

This allows us to keep the optimization, while un-breaking it.

This is a RELENG_6 candidate.

PR:		kern/87208
MFC after:	1 week
Submitted by:	tegge
2006-03-20 00:13:47 +00:00
..
2006-03-18 20:49:01 +00:00
2006-03-19 11:12:41 +00:00
2006-03-18 01:45:29 +00:00
2006-03-19 12:55:51 +00:00
2006-03-18 20:49:01 +00:00
2006-01-21 10:44:34 +00:00
2006-03-04 15:50:46 +00:00
2006-02-26 17:52:51 +00:00
2006-02-28 21:25:00 +00:00
2006-01-30 16:32:08 +00:00