svn commit: r315372 - stable/11/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Thu Mar 16 06:03:28 UTC 2017


Author: mjg
Date: Thu Mar 16 06:03:27 2017
New Revision: 315372
URL: https://svnweb.freebsd.org/changeset/base/315372

Log:
  MFC r313260:
  
  fd: switch fget_unlocked to atomic_fcmpse

Modified:
  stable/11/sys/kern/kern_descrip.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_descrip.c
==============================================================================
--- stable/11/sys/kern/kern_descrip.c	Thu Mar 16 06:00:27 2017	(r315371)
+++ stable/11/sys/kern/kern_descrip.c	Thu Mar 16 06:03:27 2017	(r315372)
@@ -2567,8 +2567,8 @@ fget_unlocked(struct filedesc *fdp, int 
 		if (error != 0)
 			return (error);
 #endif
-	retry:
 		count = fp->f_count;
+	retry:
 		if (count == 0) {
 			/*
 			 * Force a reload. Other thread could reallocate the
@@ -2582,7 +2582,7 @@ fget_unlocked(struct filedesc *fdp, int 
 		 * Use an acquire barrier to force re-reading of fdt so it is
 		 * refreshed for verification.
 		 */
-		if (atomic_cmpset_acq_int(&fp->f_count, count, count + 1) == 0)
+		if (atomic_fcmpset_acq_int(&fp->f_count, &count, count + 1) == 0)
 			goto retry;
 		fdt = fdp->fd_files;
 #ifdef	CAPABILITIES


More information about the svn-src-all mailing list