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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/urw.c
          +++ new/usr/src/uts/common/os/urw.c
↓ open down ↓ 48 lines elided ↑ open up ↑
  49   49  #include <sys/vmsystm.h>
  50   50  #include <sys/prsystm.h>
  51   51  
  52   52  #include <vm/as.h>
  53   53  #include <vm/seg.h>
  54   54  #include <vm/seg_dev.h>
  55   55  #include <vm/seg_vn.h>
  56   56  #include <vm/seg_spt.h>
  57   57  #include <vm/seg_kmem.h>
  58   58  
  59      -extern struct seg_ops segdev_ops;       /* needs a header file */
  60      -extern struct seg_ops segspt_shmops;    /* needs a header file */
       59 +extern const struct seg_ops segdev_ops; /* needs a header file */
       60 +extern const struct seg_ops segspt_shmops;      /* needs a header file */
  61   61  
  62   62  static int
  63   63  page_valid(struct seg *seg, caddr_t addr)
  64   64  {
  65   65          struct segvn_data *svd;
  66   66          vnode_t *vp;
  67   67          vattr_t vattr;
  68   68  
  69   69          /*
  70   70           * Fail if the page doesn't map to a page in the underlying
↓ open down ↓ 256 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX