vm_phys: Change the return type of vm_phys_unfree_page() to bool

This is in keeping with the trend of removing uses of boolean_t, and the
sole caller was implicitly converting it to a "bool".

No functional change intended.

Reviewed by:	dougm, alc, imp, kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D40401
This commit is contained in:
Mark Johnston 2023-06-05 10:40:15 -04:00
parent 6d777389e1
commit 6062d9faf2
3 changed files with 12 additions and 12 deletions

View File

@ -327,7 +327,7 @@ vm_page_blacklist_add(vm_paddr_t pa, bool verbose)
{
struct vm_domain *vmd;
vm_page_t m;
int ret;
bool found;
m = vm_phys_paddr_to_vm_page(pa);
if (m == NULL)
@ -335,15 +335,15 @@ vm_page_blacklist_add(vm_paddr_t pa, bool verbose)
vmd = vm_pagequeue_domain(m);
vm_domain_free_lock(vmd);
ret = vm_phys_unfree_page(m);
found = vm_phys_unfree_page(m);
vm_domain_free_unlock(vmd);
if (ret != 0) {
if (found) {
vm_domain_freecnt_inc(vmd, -1);
TAILQ_INSERT_TAIL(&blacklist_head, m, listq);
if (verbose)
printf("Skipping page with pa 0x%jx\n", (uintmax_t)pa);
}
return (ret);
return (found);
}
/*

View File

@ -1291,12 +1291,12 @@ vm_phys_scan_contig(int domain, u_long npages, vm_paddr_t low, vm_paddr_t high,
/*
* Search for the given physical page "m" in the free lists. If the search
* succeeds, remove "m" from the free lists and return TRUE. Otherwise, return
* FALSE, indicating that "m" is not in the free lists.
* succeeds, remove "m" from the free lists and return true. Otherwise, return
* false, indicating that "m" is not in the free lists.
*
* The free page queues must be locked.
*/
boolean_t
bool
vm_phys_unfree_page(vm_page_t m)
{
struct vm_freelist *fl;
@ -1319,12 +1319,12 @@ vm_phys_unfree_page(vm_page_t m)
if (pa >= seg->start)
m_set = &seg->first_page[atop(pa - seg->start)];
else
return (FALSE);
return (false);
}
if (m_set->order < order)
return (FALSE);
return (false);
if (m_set->order == VM_NFREEORDER)
return (FALSE);
return (false);
KASSERT(m_set->order < VM_NFREEORDER,
("vm_phys_unfree_page: page %p has unexpected order %d",
m_set, m_set->order));
@ -1350,7 +1350,7 @@ vm_phys_unfree_page(vm_page_t m)
vm_freelist_add(fl, m_tmp, order, 0);
}
KASSERT(m_set == m, ("vm_phys_unfree_page: fatal inconsistency"));
return (TRUE);
return (true);
}
/*

View File

@ -79,7 +79,7 @@ void vm_phys_register_domains(int ndomains, struct mem_affinity *affinity,
int *locality);
vm_page_t vm_phys_scan_contig(int domain, u_long npages, vm_paddr_t low,
vm_paddr_t high, u_long alignment, vm_paddr_t boundary, int options);
boolean_t vm_phys_unfree_page(vm_page_t m);
bool vm_phys_unfree_page(vm_page_t m);
int vm_phys_mem_affinity(int f, int t);
void vm_phys_early_add_seg(vm_paddr_t start, vm_paddr_t end);
vm_paddr_t vm_phys_early_alloc(int domain, size_t alloc_size);