Print this page
5042 stop using deprecated atomic functions

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/vnode.c
          +++ new/usr/src/uts/common/fs/vnode.c
↓ open down ↓ 2829 lines elided ↑ open up ↑
2830 2830  vn_setops(vnode_t *vp, vnodeops_t *vnodeops)
2831 2831  {
2832 2832          vnodeops_t      *op;
2833 2833  
2834 2834          ASSERT(vp != NULL);
2835 2835          ASSERT(vnodeops != NULL);
2836 2836  
2837 2837          op = vp->v_op;
2838 2838          membar_consumer();
2839 2839          /*
2840      -         * If vp->v_femhead == NULL, then we'll call casptr() to do the
2841      -         * compare-and-swap on vp->v_op.  If either fails, then FEM is
     2840 +         * If vp->v_femhead == NULL, then we'll call atomic_cas_ptr() to do
     2841 +         * the compare-and-swap on vp->v_op.  If either fails, then FEM is
2842 2842           * in effect on the vnode and we need to have FEM deal with it.
2843 2843           */
2844      -        if (vp->v_femhead != NULL || casptr(&vp->v_op, op, vnodeops) != op) {
     2844 +        if (vp->v_femhead != NULL || atomic_cas_ptr(&vp->v_op, op, vnodeops) !=
     2845 +            op) {
2845 2846                  fem_setvnops(vp, vnodeops);
2846 2847          }
2847 2848  }
2848 2849  
2849 2850  /*
2850 2851   * Retrieve the operations vector for a vnode
2851 2852   * As with vn_setops(above); make sure we aren't racing with FEM.
2852 2853   * FEM sets the v_op to a special, internal, vnodeops that wouldn't
2853 2854   * make sense to the callers of this routine.
2854 2855   */
↓ open down ↓ 1692 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX