Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*
*** 1797,1807 ****
if (qlt->fw_code01) {
kmem_free(qlt->fw_code01, (qlt->fw_length01 +
qlt->fw_length02) << 2);
qlt->fw_code01 = NULL;
} else {
! atomic_add_32(&qlt_loaded_counter, 1);
}
qlt->fw_length01 = intp[3];
qlt->fw_code01 = (uint32_t *)kmem_alloc(iocd->stmf_ibuf_size,
KM_SLEEP);
bcopy(intp, qlt->fw_code01, iocd->stmf_ibuf_size);
--- 1797,1807 ----
if (qlt->fw_code01) {
kmem_free(qlt->fw_code01, (qlt->fw_length01 +
qlt->fw_length02) << 2);
qlt->fw_code01 = NULL;
} else {
! atomic_inc_32(&qlt_loaded_counter);
}
qlt->fw_length01 = intp[3];
qlt->fw_code01 = (uint32_t *)kmem_alloc(iocd->stmf_ibuf_size,
KM_SLEEP);
bcopy(intp, qlt->fw_code01, iocd->stmf_ibuf_size);
*** 1814,1824 ****
case QLT_IOCTL_CLEAR_FW:
if (qlt->fw_code01) {
kmem_free(qlt->fw_code01, (qlt->fw_length01 +
qlt->fw_length02) << 2);
qlt->fw_code01 = NULL;
! atomic_add_32(&qlt_loaded_counter, -1);
}
break;
case QLT_IOCTL_GET_FW_INFO:
if (iocd->stmf_obuf_size != sizeof (qlt_fw_info_t)) {
--- 1814,1824 ----
case QLT_IOCTL_CLEAR_FW:
if (qlt->fw_code01) {
kmem_free(qlt->fw_code01, (qlt->fw_length01 +
qlt->fw_length02) << 2);
qlt->fw_code01 = NULL;
! atomic_dec_32(&qlt_loaded_counter);
}
break;
case QLT_IOCTL_GET_FW_INFO:
if (iocd->stmf_obuf_size != sizeof (qlt_fw_info_t)) {
*** 4669,4679 ****
return (FCT_NOT_FOUND);
}
#ifdef DEBUG
if (qlt_drop_abort_counter > 0) {
! if (atomic_add_32_nv(&qlt_drop_abort_counter, -1) == 1)
return (FCT_SUCCESS);
}
#endif
if (cmd->cmd_type == FCT_CMD_FCP_XCHG) {
--- 4669,4679 ----
return (FCT_NOT_FOUND);
}
#ifdef DEBUG
if (qlt_drop_abort_counter > 0) {
! if (atomic_dec_32_nv(&qlt_drop_abort_counter) == 1)
return (FCT_SUCCESS);
}
#endif
if (cmd->cmd_type == FCT_CMD_FCP_XCHG) {