Print this page
patch lower-case-segops

@@ -24,12 +24,10 @@
  */
 
 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
 /*        All Rights Reserved   */
 
-#pragma ident   "%Z%%M% %I%     %E% SMI"
-
 #include <sys/atomic.h>
 #include <sys/errno.h>
 #include <sys/stat.h>
 #include <sys/modctl.h>
 #include <sys/conf.h>

@@ -70,15 +68,15 @@
          * Fail if the page doesn't map to a page in the underlying
          * mapped file, if an underlying mapped file exists.
          */
         vattr.va_mask = AT_SIZE;
         if (seg->s_ops == &segvn_ops &&
-            SEGOP_GETVP(seg, addr, &vp) == 0 &&
+            segop_getvp(seg, addr, &vp) == 0 &&
             vp != NULL && vp->v_type == VREG &&
             VOP_GETATTR(vp, &vattr, 0, CRED(), NULL) == 0) {
                 u_offset_t size = roundup(vattr.va_size, (u_offset_t)PAGESIZE);
-                u_offset_t offset = SEGOP_GETOFFSET(seg, addr);
+                u_offset_t offset = segop_getoffset(seg, addr);
 
                 if (offset >= size)
                         return (0);
         }
 

@@ -94,11 +92,11 @@
          * Fail if the segment is mapped from /dev/null.
          * The key is that the mapping comes from segdev and the
          * type is neither MAP_SHARED nor MAP_PRIVATE.
          */
         if (seg->s_ops == &segdev_ops &&
-            ((SEGOP_GETTYPE(seg, addr) & (MAP_SHARED | MAP_PRIVATE)) == 0))
+            ((segop_gettype(seg, addr) & (MAP_SHARED | MAP_PRIVATE)) == 0))
                 return (0);
 
         /*
          * Fail if the page is a MAP_NORESERVE page that has
          * not actually materialized.

@@ -115,11 +113,11 @@
                  * low-order bit that indicates the page is
                  * actually in memory.  If any bits are set,
                  * then there is backing store for the page.
                  */
                 char incore = 0;
-                (void) SEGOP_INCORE(seg, addr, PAGESIZE, &incore);
+                (void) segop_incore(seg, addr, PAGESIZE, &incore);
                 if (incore == 0)
                         return (0);
         }
         return (1);
 }

@@ -207,16 +205,16 @@
         if ((seg = as_segat(as, page)) == NULL ||
             !page_valid(seg, page)) {
                 AS_LOCK_EXIT(as, &as->a_lock);
                 return (ENXIO);
         }
-        SEGOP_GETPROT(seg, page, 0, &prot);
+        (void) segop_getprot(seg, page, 0, &prot);
 
         protchanged = 0;
         if ((prot & prot_rw) == 0) {
                 protchanged = 1;
-                err = SEGOP_SETPROT(seg, page, PAGESIZE, prot | prot_rw);
+                err = segop_setprot(seg, page, PAGESIZE, prot | prot_rw);
 
                 if (err == IE_RETRY) {
                         protchanged = 0;
                         ASSERT(retrycnt == 0);
                         retrycnt++;

@@ -242,13 +240,13 @@
         else if (seg->s_ops == &segvn_ops)
                 rw = S_READ_NOCOW;
         else
                 rw = S_READ;
 
-        if (SEGOP_FAULT(as->a_hat, seg, page, PAGESIZE, F_SOFTLOCK, rw)) {
+        if (segop_fault(as->a_hat, seg, page, PAGESIZE, F_SOFTLOCK, rw)) {
                 if (protchanged)
-                        (void) SEGOP_SETPROT(seg, page, PAGESIZE, prot);
+                        (void) segop_setprot(seg, page, PAGESIZE, prot);
                 AS_LOCK_EXIT(as, &as->a_lock);
                 return (ENXIO);
         }
         CPU_STATS_ADD_K(vm, softlock, 1);
 

@@ -301,14 +299,14 @@
         mapout(as, addr, vaddr, writing);
 
         if (rw == S_READ_NOCOW)
                 rw = S_READ;
 
-        (void) SEGOP_FAULT(as->a_hat, seg, page, PAGESIZE, F_SOFTUNLOCK, rw);
+        (void) segop_fault(as->a_hat, seg, page, PAGESIZE, F_SOFTUNLOCK, rw);
 
         if (protchanged)
-                (void) SEGOP_SETPROT(seg, page, PAGESIZE, prot);
+                (void) segop_setprot(seg, page, PAGESIZE, prot);
 
         AS_LOCK_EXIT(as, &as->a_lock);
 
         return (error);
 }