mirror of
https://github.com/opnsense/src.git
synced 2026-04-22 23:02:02 -04:00
fd: switch fget_unlocked to atomic_fcmpset
This commit is contained in:
parent
1b44f31b19
commit
3a2f282532
1 changed files with 2 additions and 2 deletions
|
|
@ -2569,8 +2569,8 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp,
|
|||
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 fd, cap_rights_t *needrightsp,
|
|||
* 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
|
||||
|
|
|
|||
Loading…
Reference in a new issue