Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Dec 2018 11:57:12 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r341816 - head/sys/kern
Message-ID:  <201812111157.wBBBvCZj027863@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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++;
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812111157.wBBBvCZj027863>