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

*** 265,275 **** ent->ent_itl_datap, STMF_ITL_REASON_IT_NEXUS_LOSS); } ilu = (stmf_i_lu_t *) ent->ent_lu->lu_stmf_private; ! atomic_add_32(&ilu->ilu_ref_cnt, -1); kmem_free(sm->lm_plus[n], sizeof (stmf_lun_map_ent_t)); } } kmem_free(sm->lm_plus, --- 265,275 ---- ent->ent_itl_datap, STMF_ITL_REASON_IT_NEXUS_LOSS); } ilu = (stmf_i_lu_t *) ent->ent_lu->lu_stmf_private; ! atomic_dec_32(&ilu->ilu_ref_cnt); kmem_free(sm->lm_plus[n], sizeof (stmf_lun_map_ent_t)); } } kmem_free(sm->lm_plus,
*** 418,428 **** lun_map_ent = (stmf_lun_map_ent_t *) kmem_zalloc(sizeof (stmf_lun_map_ent_t), KM_SLEEP); lun_map_ent->ent_lu = lu; ret = stmf_add_ent_to_map(sm, (void *)lun_map_ent, lu_nbr); ASSERT(ret == STMF_SUCCESS); ! atomic_add_32(&ilu->ilu_ref_cnt, 1); /* * do not set lun inventory flag for standby port * as this would be handled from peer */ if (ilport->ilport_standby == 0) { --- 418,428 ---- lun_map_ent = (stmf_lun_map_ent_t *) kmem_zalloc(sizeof (stmf_lun_map_ent_t), KM_SLEEP); lun_map_ent->ent_lu = lu; ret = stmf_add_ent_to_map(sm, (void *)lun_map_ent, lu_nbr); ASSERT(ret == STMF_SUCCESS); ! atomic_inc_32(&ilu->ilu_ref_cnt); /* * do not set lun inventory flag for standby port * as this would be handled from peer */ if (ilport->ilport_standby == 0) {
*** 455,465 **** ilu = (stmf_i_lu_t *)lu->lu_stmf_private; ret = stmf_remove_ent_from_map(sm, lu_nbr); ASSERT(ret == STMF_SUCCESS); ! atomic_add_32(&ilu->ilu_ref_cnt, -1); iss->iss_flags |= ISS_LUN_INVENTORY_CHANGED; if (lun_map_ent->ent_itl_datap) { stmf_do_itl_dereg(lu, lun_map_ent->ent_itl_datap, STMF_ITL_REASON_USER_REQUEST); } --- 455,465 ---- ilu = (stmf_i_lu_t *)lu->lu_stmf_private; ret = stmf_remove_ent_from_map(sm, lu_nbr); ASSERT(ret == STMF_SUCCESS); ! atomic_dec_32(&ilu->ilu_ref_cnt); iss->iss_flags |= ISS_LUN_INVENTORY_CHANGED; if (lun_map_ent->ent_itl_datap) { stmf_do_itl_dereg(lu, lun_map_ent->ent_itl_datap, STMF_ITL_REASON_USER_REQUEST); }
*** 682,692 **** idlist->idl_head = idlist->idl_tail = id; } else { idlist->idl_tail->id_next = id; idlist->idl_tail = id; } ! atomic_add_32(&idlist->id_count, 1); } void stmf_remove_id(stmf_id_list_t *idlist, stmf_id_data_t *id) { --- 682,692 ---- idlist->idl_head = idlist->idl_tail = id; } else { idlist->idl_tail->id_next = id; idlist->idl_tail = id; } ! atomic_inc_32(&idlist->id_count); } void stmf_remove_id(stmf_id_list_t *idlist, stmf_id_data_t *id) {
*** 699,709 **** if (id->id_prev) { id->id_prev->id_next = id->id_next; } else { idlist->idl_head = id->id_next; } ! atomic_add_32(&idlist->id_count, -1); } /* * The refcnts of objects in a view entry are updated when then entry --- 699,709 ---- if (id->id_prev) { id->id_prev->id_next = id->id_next; } else { idlist->idl_head = id->id_next; } ! atomic_dec_32(&idlist->id_count); } /* * The refcnts of objects in a view entry are updated when then entry