Print this page
const-ify make segment ops structures
There is no reason to keep the segment ops structures writable.
patch lower-case-segops

@@ -8366,23 +8366,23 @@
          * segdev is allowed here as it is already locked.  This allows
          * for memory exported by drivers through mmap() (which is already
          * locked) to be allowed for LONGTERM.
          */
         if (flags & DDI_UMEMLOCK_LONGTERM) {
-                extern  struct seg_ops segspt_shmops;
-                extern  struct seg_ops segdev_ops;
+                extern const struct seg_ops segspt_shmops;
+                extern const struct seg_ops segdev_ops;
                 AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
                 for (seg = as_segat(as, addr); ; seg = AS_SEGNEXT(as, seg)) {
                         if (seg == NULL || seg->s_base > addr + len)
                                 break;
                         if (seg->s_ops == &segdev_ops)
                                 continue;
                         if (((seg->s_ops != &segvn_ops) &&
                             (seg->s_ops != &segspt_shmops)) ||
-                            ((SEGOP_GETVP(seg, addr, &vp) == 0 &&
+                            ((segop_getvp(seg, addr, &vp) == 0 &&
                             vp != NULL && vp->v_type == VREG) &&
-                            (SEGOP_GETTYPE(seg, addr) & MAP_SHARED))) {
+                            (segop_gettype(seg, addr) & MAP_SHARED))) {
                                 as_pageunlock(as, p->pparray,
                                     addr, len, p->s_flags);
                                 AS_LOCK_EXIT(as, &as->a_lock);
                                 umem_decr_devlockmem(p);
                                 kmem_free(p, sizeof (struct ddi_umem_cookie));