Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*
*** 342,352 ****
return (error);
/* hold the mutex to prevent race with a lockfs request */
vfs_lock_wait(vp->v_vfsp);
mutex_enter(&ulp->ul_lock);
! atomic_add_long(&ufs_quiesce_pend, 1);
if (ULOCKFS_IS_HLOCK(ulp)) {
error = EIO;
goto out;
}
--- 342,352 ----
return (error);
/* hold the mutex to prevent race with a lockfs request */
vfs_lock_wait(vp->v_vfsp);
mutex_enter(&ulp->ul_lock);
! atomic_inc_ulong(&ufs_quiesce_pend);
if (ULOCKFS_IS_HLOCK(ulp)) {
error = EIO;
goto out;
}
*** 386,396 ****
mutex_exit(&ufsvfsp->vfs_lock);
out:
/*
* we need this broadcast because of the ufs_quiesce call above
*/
! atomic_add_long(&ufs_quiesce_pend, -1);
cv_broadcast(&ulp->ul_cv);
mutex_exit(&ulp->ul_lock);
vfs_unlock(vp->v_vfsp);
return (error);
}
--- 386,396 ----
mutex_exit(&ufsvfsp->vfs_lock);
out:
/*
* we need this broadcast because of the ufs_quiesce call above
*/
! atomic_dec_ulong(&ufs_quiesce_pend);
cv_broadcast(&ulp->ul_cv);
mutex_exit(&ulp->ul_lock);
vfs_unlock(vp->v_vfsp);
return (error);
}
*** 423,433 ****
vfs_lock_wait(vp->v_vfsp);
ufs_thread_suspend(&ufsvfsp->vfs_delete);
/* hold the mutex to prevent race with a lockfs request */
mutex_enter(&ulp->ul_lock);
! atomic_add_long(&ufs_quiesce_pend, 1);
if (ULOCKFS_IS_HLOCK(ulp)) {
error = EIO;
goto out;
}
--- 423,433 ----
vfs_lock_wait(vp->v_vfsp);
ufs_thread_suspend(&ufsvfsp->vfs_delete);
/* hold the mutex to prevent race with a lockfs request */
mutex_enter(&ulp->ul_lock);
! atomic_inc_ulong(&ufs_quiesce_pend);
if (ULOCKFS_IS_HLOCK(ulp)) {
error = EIO;
goto out;
}
*** 484,494 ****
/* synchronously flush dirty data and metadata */
error = ufs_flush(vp->v_vfsp);
out:
! atomic_add_long(&ufs_quiesce_pend, -1);
cv_broadcast(&ulp->ul_cv);
mutex_exit(&ulp->ul_lock);
vfs_unlock(vp->v_vfsp);
/*
--- 484,494 ----
/* synchronously flush dirty data and metadata */
error = ufs_flush(vp->v_vfsp);
out:
! atomic_dec_ulong(&ufs_quiesce_pend);
cv_broadcast(&ulp->ul_cv);
mutex_exit(&ulp->ul_lock);
vfs_unlock(vp->v_vfsp);
/*