Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Feb 2020 11:22: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: r357908 - head/sys/kern
Message-ID:  <202002141122.01EBMCG1034714@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Fri Feb 14 11:22:12 2020
New Revision: 357908
URL: https://svnweb.freebsd.org/changeset/base/357908

Log:
  fd: annotate finstall with prediction branches

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Fri Feb 14 11:21:28 2020	(r357907)
+++ head/sys/kern/kern_descrip.c	Fri Feb 14 11:22:12 2020	(r357908)
@@ -1978,7 +1978,8 @@ finstall(struct thread *td, struct file *fp, int *fd, 
 	if (!fhold(fp))
 		return (EBADF);
 	FILEDESC_XLOCK(fdp);
-	if ((error = fdalloc(td, 0, fd))) {
+	error = fdalloc(td, 0, fd);
+	if (__predict_false(error != 0)) {
 		FILEDESC_XUNLOCK(fdp);
 		fdrop(fp, td);
 		return (error);



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