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/vm/seg_dev.h
          +++ new/usr/src/uts/common/vm/seg_dev.h
↓ open down ↓ 118 lines elided ↑ open up ↑
 119  119  #define SEG_IS_DEVNULL_MAPPING(seg)     \
 120  120          ((seg)->s_ops == &segdev_ops && \
 121  121          ((segop_gettype((seg), (seg)->s_base) & (MAP_SHARED | MAP_PRIVATE)) == 0))
 122  122  
 123  123  extern void segdev_init(void);
 124  124  
 125  125  extern int segdev_create(struct seg *, void *);
 126  126  
 127  127  extern int segdev_copyto(struct seg *, caddr_t, const void *, void *, size_t);
 128  128  extern int segdev_copyfrom(struct seg *, caddr_t, const void *, void *, size_t);
 129      -extern struct seg_ops segdev_ops;
      129 +extern const struct seg_ops segdev_ops;
 130  130  
 131  131  #endif  /* _KERNEL */
 132  132  
 133  133  #ifdef  __cplusplus
 134  134  }
 135  135  #endif
 136  136  
 137  137  #endif  /* _VM_SEG_DEV_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX