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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/io/scsi/adapters/arcmsr/arcmsr.c
          +++ new/usr/src/uts/intel/io/scsi/adapters/arcmsr/arcmsr.c
↓ open down ↓ 1834 lines elided ↑ open up ↑
1835 1835          struct ARCMSR_CDB *arcmsr_cdb;
1836 1836          uint_t pkt_flags = pkt->pkt_flags;
1837 1837  
1838 1838          arcmsr_cdb = &ccb->arcmsr_cdb;
1839 1839  
1840 1840          /* TODO: Use correct offset and size for syncing? */
1841 1841          if (ddi_dma_sync(acb->ccbs_pool_handle, 0, 0, DDI_DMA_SYNC_FORDEV) ==
1842 1842              DDI_FAILURE)
1843 1843                  return (DDI_FAILURE);
1844 1844  
1845      -        atomic_add_32(&acb->ccboutstandingcount, 1);
     1845 +        atomic_inc_32(&acb->ccboutstandingcount);
1846 1846          ccb->ccb_time = (time_t)(ddi_get_time() + pkt->pkt_time);
1847 1847  
1848 1848          ccb->ccb_state = ARCMSR_CCB_START;
1849 1849          switch (acb->adapter_type) {
1850 1850          case ACB_ADAPTER_TYPE_A:
1851 1851          {
1852 1852                  struct HBA_msgUnit *phbamu;
1853 1853  
1854 1854                  phbamu = (struct HBA_msgUnit *)acb->pmu;
1855 1855                  if (arcmsr_cdb->Flags & ARCMSR_CDB_FLAG_SGL_BSIZE) {
↓ open down ↓ 92 lines elided ↑ open up ↑
1948 1948           * and solve the mutex ownership issue correctly.
1949 1949           */
1950 1950          if (mutex_owned(&acb->isr_mutex)) {
1951 1951                  mutex_exit(&acb->isr_mutex);
1952 1952                  scsi_hba_pkt_comp(pkt);
1953 1953                  mutex_enter(&acb->isr_mutex);
1954 1954          } else {
1955 1955                  scsi_hba_pkt_comp(pkt);
1956 1956          }
1957 1957          if (flag == 1) {
1958      -                atomic_add_32(&acb->ccboutstandingcount, -1);
     1958 +                atomic_dec_32(&acb->ccboutstandingcount);
1959 1959          }
1960 1960  }
1961 1961  
1962 1962  static void
1963 1963  arcmsr_report_ccb_state(struct ACB *acb, struct CCB *ccb, boolean_t error)
1964 1964  {
1965 1965          int id, lun;
1966 1966  
1967 1967          ccb->ccb_state |= ARCMSR_CCB_DONE;
1968 1968          id = ccb->pkt->pkt_address.a_target;
↓ open down ↓ 3961 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX