Author: mjg
Date: Sun Feb  5 01:40:27 2017
New Revision: 313260
URL: https://svnweb.freebsd.org/changeset/base/313260

Log:
  fd: switch fget_unlocked to atomic_fcmpset

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c        Sun Feb  5 01:20:39 2017        
(r313259)
+++ head/sys/kern/kern_descrip.c        Sun Feb  5 01:40:27 2017        
(r313260)
@@ -2569,8 +2569,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
@@ -2584,7 +2584,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
_______________________________________________
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