Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*
@@ -342,11 +342,11 @@
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);
+ atomic_inc_ulong(&ufs_quiesce_pend);
if (ULOCKFS_IS_HLOCK(ulp)) {
error = EIO;
goto out;
}
@@ -386,11 +386,11 @@
mutex_exit(&ufsvfsp->vfs_lock);
out:
/*
* we need this broadcast because of the ufs_quiesce call above
*/
- atomic_add_long(&ufs_quiesce_pend, -1);
+ atomic_dec_ulong(&ufs_quiesce_pend);
cv_broadcast(&ulp->ul_cv);
mutex_exit(&ulp->ul_lock);
vfs_unlock(vp->v_vfsp);
return (error);
}
@@ -423,11 +423,11 @@
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);
+ atomic_inc_ulong(&ufs_quiesce_pend);
if (ULOCKFS_IS_HLOCK(ulp)) {
error = EIO;
goto out;
}
@@ -484,11 +484,11 @@
/* synchronously flush dirty data and metadata */
error = ufs_flush(vp->v_vfsp);
out:
- atomic_add_long(&ufs_quiesce_pend, -1);
+ atomic_dec_ulong(&ufs_quiesce_pend);
cv_broadcast(&ulp->ul_cv);
mutex_exit(&ulp->ul_lock);
vfs_unlock(vp->v_vfsp);
/*