Print this page
lgrp: getpolicy seg op has been around long enough
This special casing has been around for more than 10 years.  It's time for
it to go.  (There are no third party segment drivers anyway.)
segop_getpolicy already checks for a NULL op
patch lower-case-segops

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/lgrp.c
          +++ new/usr/src/uts/common/os/lgrp.c
↓ open down ↓ 3493 lines elided ↑ open up ↑
3494 3494  
3495 3495          return (policy);
3496 3496  }
3497 3497  
3498 3498  /*
3499 3499   * Get memory allocation policy for this segment
3500 3500   */
3501 3501  lgrp_mem_policy_info_t *
3502 3502  lgrp_mem_policy_get(struct seg *seg, caddr_t vaddr)
3503 3503  {
3504      -        lgrp_mem_policy_info_t  *policy_info;
3505      -        extern struct seg_ops   segspt_ops;
3506      -        extern struct seg_ops   segspt_shmops;
3507      -
3508      -        /*
3509      -         * This is for binary compatibility to protect against third party
3510      -         * segment drivers which haven't recompiled to allow for
3511      -         * SEGOP_GETPOLICY()
3512      -         */
3513      -        if (seg->s_ops != &segvn_ops && seg->s_ops != &segspt_ops &&
3514      -            seg->s_ops != &segspt_shmops)
3515      -                return (NULL);
3516      -
3517      -        policy_info = NULL;
3518      -        if (seg->s_ops->getpolicy != NULL)
3519      -                policy_info = SEGOP_GETPOLICY(seg, vaddr);
3520      -
3521      -        return (policy_info);
     3504 +        return (segop_getpolicy(seg, vaddr));
3522 3505  }
3523 3506  
3524 3507  /*
3525 3508   * Set policy for allocating private memory given desired policy, policy info,
3526 3509   * size in bytes of memory that policy is being applied.
3527 3510   * Return 0 if policy wasn't set already and 1 if policy was set already
3528 3511   */
3529 3512  int
3530 3513  lgrp_privm_policy_set(lgrp_mem_policy_t policy,
3531 3514      lgrp_mem_policy_info_t *policy_info, size_t size)
↓ open down ↓ 910 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX