Print this page
5042 stop using deprecated atomic functions

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/fem.c
          +++ new/usr/src/uts/common/fs/fem.c
↓ open down ↓ 2864 lines elided ↑ open up ↑
2865 2865   */
2866 2866  
2867 2867  static struct fem_head *
2868 2868  new_femhead(struct fem_head **hp)
2869 2869  {
2870 2870          struct fem_head *head;
2871 2871  
2872 2872          head = kmem_alloc(sizeof (*head), KM_SLEEP);
2873 2873          mutex_init(&head->femh_lock, NULL, MUTEX_DEFAULT, NULL);
2874 2874          head->femh_list = NULL;
2875      -        if (casptr(hp, NULL, head) != NULL) {
     2875 +        if (atomic_cas_ptr(hp, NULL, head) != NULL) {
2876 2876                  kmem_free(head, sizeof (*head));
2877 2877                  head = *hp;
2878 2878          }
2879 2879          return (head);
2880 2880  }
2881 2881  
2882 2882  /*
2883 2883   * Create a fem_list.  The fem_list that gets returned is in a
2884 2884   * very rudimentary state and MUST NOT be used until it's initialized
2885 2885   * (usually by femlist_construct() or fem_dup_list()).  The refcount
↓ open down ↓ 472 lines elided ↑ open up ↑
3358 3358                  membar_consumer();
3359 3359                  if (v->v_femhead != NULL) {
3360 3360                          struct fem_list *fl;
3361 3361                          if ((fl = fem_lock(v->v_femhead)) != NULL) {
3362 3362                                  fl->feml_nodes[1].fn_op.vnode = newops;
3363 3363                                  fem_unlock(v->v_femhead);
3364 3364                                  return;
3365 3365                          }
3366 3366                          fem_unlock(v->v_femhead);
3367 3367                  }
3368      -        } while (casptr(&v->v_op, r, newops) != r);
     3368 +        } while (atomic_cas_ptr(&v->v_op, r, newops) != r);
3369 3369  }
3370 3370  
3371 3371  vnodeops_t *
3372 3372  fem_getvnops(vnode_t *v)
3373 3373  {
3374 3374          vnodeops_t      *r;
3375 3375  
3376 3376          ASSERT(v != NULL);
3377 3377  
3378 3378          r = v->v_op;
↓ open down ↓ 122 lines elided ↑ open up ↑
3501 3501                  membar_consumer();
3502 3502                  if (v->vfs_femhead != NULL) {
3503 3503                          struct fem_list *fl;
3504 3504                          if ((fl = fem_lock(v->vfs_femhead)) != NULL) {
3505 3505                                  fl->feml_nodes[1].fn_op.vfs = newops;
3506 3506                                  fem_unlock(v->vfs_femhead);
3507 3507                                  return;
3508 3508                          }
3509 3509                          fem_unlock(v->vfs_femhead);
3510 3510                  }
3511      -        } while (casptr(&v->vfs_op, r, newops) != r);
     3511 +        } while (atomic_cas_ptr(&v->vfs_op, r, newops) != r);
3512 3512  }
3513 3513  
3514 3514  vfsops_t *
3515 3515  fsem_getvfsops(vfs_t *v)
3516 3516  {
3517 3517          vfsops_t        *r;
3518 3518  
3519 3519          ASSERT(v != NULL);
3520 3520          ASSERT(v->vfs_implp);
3521 3521  
↓ open down ↓ 74 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX