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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/fem.c
          +++ new/usr/src/uts/common/fs/fem.c
↓ open down ↓ 359 lines elided ↑ open up ↑
 360  360          mutex_exit(&fp->femh_lock);
 361  361  }
 362  362  
 363  363  /*
 364  364   * Addref can only be called while its head->lock is held.
 365  365   */
 366  366  
 367  367  static void
 368  368  fem_addref(struct fem_list *sp)
 369  369  {
 370      -        atomic_add_32(&sp->feml_refc, 1);
      370 +        atomic_inc_32(&sp->feml_refc);
 371  371  }
 372  372  
 373  373  static uint32_t
 374  374  fem_delref(struct fem_list *sp)
 375  375  {
 376      -        return (atomic_add_32_nv(&sp->feml_refc, -1));
      376 +        return (atomic_dec_32_nv(&sp->feml_refc));
 377  377  }
 378  378  
 379  379  static struct fem_list *
 380  380  fem_get(struct fem_head *fp)
 381  381  {
 382  382          struct fem_list *sp = NULL;
 383  383  
 384  384          if (fp != NULL) {
 385  385                  if ((sp = fem_lock(fp)) != NULL) {
 386  386                          fem_addref(sp);
↓ open down ↓ 3209 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX