Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*

*** 932,942 **** /* * There weren't any free client handles which fit, so allocate * a new one and use that. */ #ifdef DEBUG ! atomic_add_64(&nfscl->nfscl_stat.clalloc.value.ui64, 1); #endif mutex_exit(&nfscl->nfscl_chtable4_lock); nfscl->nfscl_stat.cltoomany.value.ui64++; if (newch != NULL) { --- 932,942 ---- /* * There weren't any free client handles which fit, so allocate * a new one and use that. */ #ifdef DEBUG ! atomic_inc_64(&nfscl->nfscl_stat.clalloc.value.ui64); #endif mutex_exit(&nfscl->nfscl_chtable4_lock); nfscl->nfscl_stat.cltoomany.value.ui64++; if (newch != NULL) {
*** 953,963 **** sigunintr(&smask); if (error != 0) { kmem_cache_free(chtab4_cache, cp); #ifdef DEBUG ! atomic_add_64(&nfscl->nfscl_stat.clalloc.value.ui64, -1); #endif /* * Warning is unnecessary if error is EINTR. */ if (error != EINTR) { --- 953,963 ---- sigunintr(&smask); if (error != 0) { kmem_cache_free(chtab4_cache, cp); #ifdef DEBUG ! atomic_dec_64(&nfscl->nfscl_stat.clalloc.value.ui64); #endif /* * Warning is unnecessary if error is EINTR. */ if (error != EINTR) {
*** 975,985 **** error = authget(svp, cp->ch_client, cr); if (error || cp->ch_client->cl_auth == NULL) { CLNT_DESTROY(cp->ch_client); kmem_cache_free(chtab4_cache, cp); #ifdef DEBUG ! atomic_add_64(&nfscl->nfscl_stat.clalloc.value.ui64, -1); #endif return ((error != 0) ? error : EINTR); } ch->ch_timesused++; *newcl = cp->ch_client; --- 975,985 ---- error = authget(svp, cp->ch_client, cr); if (error || cp->ch_client->cl_auth == NULL) { CLNT_DESTROY(cp->ch_client); kmem_cache_free(chtab4_cache, cp); #ifdef DEBUG ! atomic_dec_64(&nfscl->nfscl_stat.clalloc.value.ui64); #endif return ((error != 0) ? error : EINTR); } ch->ch_timesused++; *newcl = cp->ch_client;
*** 2644,2654 **** cv_init(&rc->cv, NULL, CV_DEFAULT, NULL); rc->error = 0; mutex_init(&rdip->lock, NULL, MUTEX_DEFAULT, NULL); rdip->count = 1; #ifdef DEBUG ! atomic_add_64(&clstat4_debug.dirent.value.ui64, 1); #endif } return (rc); } --- 2644,2654 ---- cv_init(&rc->cv, NULL, CV_DEFAULT, NULL); rc->error = 0; mutex_init(&rdip->lock, NULL, MUTEX_DEFAULT, NULL); rdip->count = 1; #ifdef DEBUG ! atomic_inc_64(&clstat4_debug.dirent.value.ui64); #endif } return (rc); }
*** 2701,2711 **** rddir4_cache_free(rddir4_cache_impl *rdip) { rddir4_cache *rc = &rdip->rc; #ifdef DEBUG ! atomic_add_64(&clstat4_debug.dirent.value.ui64, -1); #endif if (rc->entries != NULL) kmem_free(rc->entries, rc->buflen); cv_destroy(&rc->cv); mutex_destroy(&rdip->lock); --- 2701,2711 ---- rddir4_cache_free(rddir4_cache_impl *rdip) { rddir4_cache *rc = &rdip->rc; #ifdef DEBUG ! atomic_dec_64(&clstat4_debug.dirent.value.ui64); #endif if (rc->entries != NULL) kmem_free(rc->entries, rc->buflen); cv_destroy(&rc->cv); mutex_destroy(&rdip->lock);