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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/comstar/port/fcoet/fcoet.h
          +++ new/usr/src/uts/common/io/comstar/port/fcoet/fcoet.h
↓ open down ↓ 215 lines elided ↑ open up ↑
 216  216   * Add the reference to avoid such situation:
 217  217   * 1, Frame received, then abort happen (maybe because local port offline, or
 218  218   * remote port abort the cmd), cmd is aborted and then freed right after we
 219  219   * get the exchange from hash table in fcoet_rx_frame.
 220  220   * 2, Frame sent out, then queued in fcoe for release. then abort happen, cmd
 221  221   * is aborted and then freed before fcoe_watchdog() call up to release the
 222  222   * frame.
 223  223   * These two situation should seldom happen. But just invoke this seems won't
 224  224   * downgrade the performance too much, so we keep it.
 225  225   */
 226      -#define FCOET_BUSY_XCHG(xch)    atomic_add_8(&(xch)->xch_ref, 1)
 227      -#define FCOET_RELE_XCHG(xch)    atomic_add_8(&(xch)->xch_ref, -1)
      226 +#define FCOET_BUSY_XCHG(xch)    atomic_inc_8(&(xch)->xch_ref)
      227 +#define FCOET_RELE_XCHG(xch)    atomic_dec_8(&(xch)->xch_ref)
 228  228  
 229  229  #define XCH_FLAG_NONFCP_REQ_SENT        0x0001
 230  230  #define XCH_FLAG_NONFCP_RESP_SENT       0x0002
 231  231  #define XCH_FLAG_FCP_CMD_RCVD           0x0004
 232  232  #define XCH_FLAG_INI_ASKED_ABORT        0x0008
 233  233  #define XCH_FLAG_FCT_CALLED_ABORT       0x0010
 234  234  #define XCH_FLAG_IN_HASH_TABLE          0x0020
 235  235  
 236  236  /*
 237  237   * IOCTL supporting stuff
↓ open down ↓ 71 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX