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++;
 }
 
 /*
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to