Print this page
patch lower-case-segops

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/vm/vm_seg.c
          +++ new/usr/src/uts/common/vm/vm_seg.c
↓ open down ↓ 1628 lines elided ↑ open up ↑
1629 1629           * as_addseg() will add the segment at the appropraite point
1630 1630           * in the list. It will return -1 if there is overlap with
1631 1631           * an already existing segment.
1632 1632           */
1633 1633          return (as_addseg(as, seg));
1634 1634  }
1635 1635  
1636 1636  /*
1637 1637   * Unmap a segment and free it from its associated address space.
1638 1638   * This should be called by anybody who's finished with a whole segment's
1639      - * mapping.  Just calls SEGOP_UNMAP() on the whole mapping .  It is the
     1639 + * mapping.  Just calls segop_unmap() on the whole mapping .  It is the
1640 1640   * responsibility of the segment driver to unlink the the segment
1641 1641   * from the address space, and to free public and private data structures
1642 1642   * associated with the segment.  (This is typically done by a call to
1643 1643   * seg_free()).
1644 1644   */
1645 1645  void
1646 1646  seg_unmap(struct seg *seg)
1647 1647  {
1648 1648  #ifdef DEBUG
1649 1649          int ret;
1650 1650  #endif /* DEBUG */
1651 1651  
1652 1652          ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
1653 1653  
1654 1654          /* Shouldn't have called seg_unmap if mapping isn't yet established */
1655 1655          ASSERT(seg->s_data != NULL);
1656 1656  
1657 1657          /* Unmap the whole mapping */
1658 1658  #ifdef DEBUG
1659      -        ret = SEGOP_UNMAP(seg, seg->s_base, seg->s_size);
     1659 +        ret = segop_unmap(seg, seg->s_base, seg->s_size);
1660 1660          ASSERT(ret == 0);
1661 1661  #else
1662      -        SEGOP_UNMAP(seg, seg->s_base, seg->s_size);
     1662 +        segop_unmap(seg, seg->s_base, seg->s_size);
1663 1663  #endif /* DEBUG */
1664 1664  }
1665 1665  
1666 1666  /*
1667 1667   * Free the segment from its associated as. This should only be called
1668 1668   * if a mapping to the segment has not yet been established (e.g., if
1669 1669   * an error occurs in the middle of doing an as_map when the segment
1670 1670   * has already been partially set up) or if it has already been deleted
1671 1671   * (e.g., from a segment driver unmap routine if the unmap applies to the
1672 1672   * entire segment). If the mapping is currently set up then seg_unmap() should
↓ open down ↓ 5 lines elided ↑ open up ↑
1678 1678          register struct as *as = seg->s_as;
1679 1679          struct seg *tseg = as_removeseg(as, seg);
1680 1680  
1681 1681          ASSERT(tseg == seg);
1682 1682  
1683 1683          /*
1684 1684           * If the segment private data field is NULL,
1685 1685           * then segment driver is not attached yet.
1686 1686           */
1687 1687          if (seg->s_data != NULL)
1688      -                SEGOP_FREE(seg);
     1688 +                segop_free(seg);
1689 1689  
1690 1690          mutex_destroy(&seg->s_pmtx);
1691 1691          ASSERT(seg->s_phead.p_lnext == &seg->s_phead);
1692 1692          ASSERT(seg->s_phead.p_lprev == &seg->s_phead);
1693 1693          kmem_cache_free(seg_cache, seg);
1694 1694  }
1695 1695  
1696 1696  /*ARGSUSED*/
1697 1697  static void
1698 1698  seg_p_mem_config_post_add(
↓ open down ↓ 148 lines elided ↑ open up ↑
1847 1847  
1848 1848          if (seg->s_ops == &segvn_ops) {
1849 1849                  svd = (struct segvn_data *)seg->s_data;
1850 1850                  if (svd->type == MAP_PRIVATE && svd->swresv > 0)
1851 1851                          swap = svd->swresv;
1852 1852          }
1853 1853          return (swap);
1854 1854  }
1855 1855  
1856 1856  /*
1857      - * General not supported function for SEGOP_INHERIT
     1857 + * General not supported function for segop_inherit
1858 1858   */
1859 1859  /* ARGSUSED */
1860 1860  int
1861 1861  seg_inherit_notsup(struct seg *seg, caddr_t addr, size_t len, uint_t op)
1862 1862  {
1863 1863          return (ENOTSUP);
1864 1864  }
1865 1865  
1866 1866  /*
1867 1867   * segop wrappers
↓ open down ↓ 189 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX