svn commit: r341816 - head/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Tue Dec 11 11:57:13 UTC 2018


Author: mjg
Date: Tue Dec 11 11:57:12 2018
New Revision: 341816
URL: https://svnweb.freebsd.org/changeset/base/341816

Log:
  fd: stop looking for exact freefile after allocation
  
  If a lower fd is closed later, the lookup goes to waste. Allocation
  always performs the lookup anyway.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Tue Dec 11 11:31:13 2018	(r341815)
+++ head/sys/kern/kern_descrip.c	Tue Dec 11 11:57:12 2018	(r341816)
@@ -262,7 +262,7 @@ fdused(struct filedesc *fdp, int fd)
 	if (fd > fdp->fd_lastfile)
 		fdp->fd_lastfile = fd;
 	if (fd == fdp->fd_freefile)
-		fdp->fd_freefile = fd_first_free(fdp, fd, fdp->fd_nfiles);
+		fdp->fd_freefile++;
 }
 
 /*


More information about the svn-src-all mailing list