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.

@@ -64,11 +64,10 @@
 static faultcode_t segnf_nomap(void);
 static int      segnf_setprot(struct seg *seg, caddr_t addr,
                     size_t len, uint_t prot);
 static int      segnf_checkprot(struct seg *seg, caddr_t addr,
                     size_t len, uint_t prot);
-static void     segnf_badop(void);
 static int      segnf_nop(void);
 static int      segnf_getprot(struct seg *seg, caddr_t addr,
                     size_t len, uint_t *protv);
 static u_offset_t segnf_getoffset(struct seg *seg, caddr_t addr);
 static int      segnf_gettype(struct seg *seg, caddr_t addr);

@@ -90,11 +89,10 @@
         .fault          = (faultcode_t (*)(struct hat *, struct seg *, caddr_t,
             size_t, enum fault_type, enum seg_rw))segnf_nomap,
         .faulta         = (faultcode_t (*)(struct seg *, caddr_t)) segnf_nomap,
         .setprot        = segnf_setprot,
         .checkprot      = segnf_checkprot,
-        .kluster        = (int (*)())segnf_badop,
         .sync           = (int (*)(struct seg *, caddr_t, size_t, int, uint_t))
                 segnf_nop,
         .incore         = (size_t (*)(struct seg *, caddr_t, size_t, char *))
                 segnf_nop,
         .lockop         = (int (*)(struct seg *, caddr_t, size_t, int, int,

@@ -399,17 +397,10 @@
 
         sprot = seg->s_as == &kas ?  PROT_READ : PROT_READ|PROT_USER;
         return ((prot & sprot) == prot ? 0 : EACCES);
 }
 
-static void
-segnf_badop(void)
-{
-        panic("segnf_badop");
-        /*NOTREACHED*/
-}
-
 static int
 segnf_nop(void)
 {
         return (0);
 }