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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/audit_memory.c
          +++ new/usr/src/uts/common/os/audit_memory.c
↓ open down ↓ 31 lines elided ↑ open up ↑
  32   32  
  33   33  /* process audit data (pad) cache */
  34   34  kmem_cache_t *au_pad_cache;
  35   35  
  36   36  /*
  37   37   * increment audit path reference count
  38   38   */
  39   39  void
  40   40  au_pathhold(struct audit_path *app)
  41   41  {
  42      -        atomic_add_32(&app->audp_ref, 1);
       42 +        atomic_inc_32(&app->audp_ref);
  43   43  }
  44   44  
  45   45  /*
  46   46   * decrement audit path reference count
  47   47   */
  48   48  void
  49   49  au_pathrele(struct audit_path *app)
  50   50  {
  51      -        if (atomic_add_32_nv(&app->audp_ref, -1) > 0)
       51 +        if (atomic_dec_32_nv(&app->audp_ref) > 0)
  52   52                  return;
  53   53          kmem_free(app, app->audp_size);
  54   54  }
  55   55  
  56   56  /*
  57   57   * allocate a new auditpath
  58   58   *      newsect = increment sections count,
  59   59   *      charincr = change in strings storage
  60   60   */
  61   61  
↓ open down ↓ 62 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX