Print this page
6147 segop_getpolicy already checks for a NULL op
Reviewed by: Garrett D'Amore <garrett@damore.org>
*** 3499,3509 ****
* Get memory allocation policy for this segment
*/
lgrp_mem_policy_info_t *
lgrp_mem_policy_get(struct seg *seg, caddr_t vaddr)
{
- lgrp_mem_policy_info_t *policy_info;
extern struct seg_ops segspt_ops;
extern struct seg_ops segspt_shmops;
/*
* This is for binary compatibility to protect against third party
--- 3499,3508 ----
*** 3512,3526 ****
*/
if (seg->s_ops != &segvn_ops && seg->s_ops != &segspt_ops &&
seg->s_ops != &segspt_shmops)
return (NULL);
! policy_info = NULL;
! if (seg->s_ops->getpolicy != NULL)
! policy_info = segop_getpolicy(seg, vaddr);
!
! return (policy_info);
}
/*
* Set policy for allocating private memory given desired policy, policy info,
* size in bytes of memory that policy is being applied.
--- 3511,3521 ----
*/
if (seg->s_ops != &segvn_ops && seg->s_ops != &segspt_ops &&
seg->s_ops != &segspt_shmops)
return (NULL);
! return (segop_getpolicy(seg, vaddr));
}
/*
* Set policy for allocating private memory given desired policy, policy info,
* size in bytes of memory that policy is being applied.