git: f3895e983ce8 - main - vm_radix: Add iter lookup_le interface
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 09 Nov 2024 19:37:33 UTC
The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=f3895e983ce82474e3ae5825baa295ec1c923203 commit f3895e983ce82474e3ae5825baa295ec1c923203 Author: Doug Moore <dougm@FreeBSD.org> AuthorDate: 2024-11-09 19:32:58 +0000 Commit: Doug Moore <dougm@FreeBSD.org> CommitDate: 2024-11-09 19:32:58 +0000 vm_radix: Add iter lookup_le interface Add a function to the vm_radix interface to lookup the greatest page less than or equal to some given page. Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D47046 --- sys/vm/vm_radix.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/vm/vm_radix.h b/sys/vm/vm_radix.h index e1f7323dd205..561e36f2e164 100644 --- a/sys/vm/vm_radix.h +++ b/sys/vm/vm_radix.h @@ -257,6 +257,19 @@ vm_radix_iter_step(struct pctrie_iter *pages) return (VM_RADIX_PCTRIE_ITER_STEP_GE(pages)); } +/* + * Initialize an iterator pointing to the page with the greatest pindex that is + * less than or equal to the specified pindex, or NULL if there are no such + * pages. Return the page. + * + * Requires that access be externally synchronized by a lock. + */ +static __inline vm_page_t +vm_radix_iter_lookup_le(struct pctrie_iter *pages, vm_pindex_t index) +{ + return (VM_RADIX_PCTRIE_ITER_LOOKUP_LE(pages, index)); +} + /* * Update the iterator to point to the page with the pindex that is one greater * than the current pindex, or NULL if there is no such page. Return the page.