Print this page
no need for bad-op segment op functions
The segment drivers have a number of bad-op functions that simply panic.
Keeping the function pointer NULL will accomplish the same thing in most
cases.  In other cases, keeping the function pointer NULL will result in
proper error code being returned.

*** 85,127 **** static int segmap_getvp(struct seg *seg, caddr_t addr, struct vnode **vpp); static void segmap_dump(struct seg *seg); static int segmap_pagelock(struct seg *seg, caddr_t addr, size_t len, struct page ***ppp, enum lock_type type, enum seg_rw rw); - static void segmap_badop(void); static int segmap_getmemid(struct seg *seg, caddr_t addr, memid_t *memidp); static lgrp_mem_policy_info_t *segmap_getpolicy(struct seg *seg, caddr_t addr); static int segmap_capable(struct seg *seg, segcapability_t capability); /* segkpm support */ static caddr_t segmap_pagecreate_kpm(struct seg *, vnode_t *, u_offset_t, struct smap *, enum seg_rw); struct smap *get_smap_kpm(caddr_t, page_t **); - #define SEGMAP_BADOP(t) (t(*)())segmap_badop - static struct seg_ops segmap_ops = { - .dup = SEGMAP_BADOP(int), - .unmap = SEGMAP_BADOP(int), .free = segmap_free, .fault = segmap_fault, .faulta = segmap_faulta, - .setprot = SEGMAP_BADOP(int), .checkprot = segmap_checkprot, .kluster = segmap_kluster, - .sync = SEGMAP_BADOP(int), - .incore = SEGMAP_BADOP(size_t), - .lockop = SEGMAP_BADOP(int), .getprot = segmap_getprot, .getoffset = segmap_getoffset, .gettype = segmap_gettype, .getvp = segmap_getvp, - .advise = SEGMAP_BADOP(int), .dump = segmap_dump, .pagelock = segmap_pagelock, - .setpagesize = SEGMAP_BADOP(int), .getmemid = segmap_getmemid, .getpolicy = segmap_getpolicy, .capable = segmap_capable, .inherit = seg_inherit_notsup, }; --- 85,116 ----
*** 906,922 **** segmap_kluster(struct seg *seg, caddr_t addr, ssize_t delta) { return (0); } - static void - segmap_badop() - { - panic("segmap_badop"); - /*NOTREACHED*/ - } - /* * Special private segmap operations */ /* --- 895,904 ----