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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/vdev_cache.c
          +++ new/usr/src/uts/common/fs/zfs/vdev_cache.c
↓ open down ↓ 94 lines elided ↑ open up ↑
  95   95          kstat_named_t vdc_stat_hits;
  96   96          kstat_named_t vdc_stat_misses;
  97   97  } vdc_stats_t;
  98   98  
  99   99  static vdc_stats_t vdc_stats = {
 100  100          { "delegations",        KSTAT_DATA_UINT64 },
 101  101          { "hits",               KSTAT_DATA_UINT64 },
 102  102          { "misses",             KSTAT_DATA_UINT64 }
 103  103  };
 104  104  
 105      -#define VDCSTAT_BUMP(stat)      atomic_add_64(&vdc_stats.stat.value.ui64, 1);
      105 +#define VDCSTAT_BUMP(stat)      atomic_inc_64(&vdc_stats.stat.value.ui64);
 106  106  
 107  107  static int
 108  108  vdev_cache_offset_compare(const void *a1, const void *a2)
 109  109  {
 110  110          const vdev_cache_entry_t *ve1 = a1;
 111  111          const vdev_cache_entry_t *ve2 = a2;
 112  112  
 113  113          if (ve1->ve_offset < ve2->ve_offset)
 114  114                  return (-1);
 115  115          if (ve1->ve_offset > ve2->ve_offset)
↓ open down ↓ 311 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX