diff options
author | alc <alc@FreeBSD.org> | 2002-03-04 18:55:26 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2002-03-04 18:55:26 +0000 |
commit | 42c47fb8912e145b57c9c68cb6898e7519a956bd (patch) | |
tree | ada7f2371d00f6870621225abb1f45da1fa6d6ff /sys/vm/vm_pageq.c | |
parent | 3f245d8dd193f05b337f1358ec6b33ed212f9cc1 (diff) | |
download | FreeBSD-src-42c47fb8912e145b57c9c68cb6898e7519a956bd.zip FreeBSD-src-42c47fb8912e145b57c9c68cb6898e7519a956bd.tar.gz |
o Create vm_pageq_enqueue() to encapsulate code that is duplicated time
and again in vm_page.c and vm_pageq.c.
o Delete unusused prototypes. (Mainly a result of the earlier renaming
of various functions from vm_page_*() to vm_pageq_*().)
Diffstat (limited to 'sys/vm/vm_pageq.c')
-rw-r--r-- | sys/vm/vm_pageq.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/sys/vm/vm_pageq.c b/sys/vm/vm_pageq.c index 2e47538..c590bcd 100644 --- a/sys/vm/vm_pageq.c +++ b/sys/vm/vm_pageq.c @@ -82,6 +82,22 @@ vm_pageq_requeue(vm_page_t m) } /* + * vm_pageq_enqueue: + * + */ +void +vm_pageq_enqueue(int queue, vm_page_t m) +{ + struct vpgqueues *vpq; + + vpq = &vm_page_queues[queue]; + m->queue = queue; + TAILQ_INSERT_TAIL(&vpq->pl, m, pageq); + ++*vpq->cnt; + ++vpq->lcnt; +} + +/* * vm_add_new_page: * * Add a new page to the freelist for use by the system. @@ -95,14 +111,11 @@ vm_pageq_add_new_page(vm_offset_t pa) GIANT_REQUIRED; ++cnt.v_page_count; - ++cnt.v_free_count; m = PHYS_TO_VM_PAGE(pa); m->phys_addr = pa; m->flags = 0; m->pc = (pa >> PAGE_SHIFT) & PQ_L2_MASK; - m->queue = m->pc + PQ_FREE; - TAILQ_INSERT_TAIL(&vm_page_queues[m->queue].pl, m, pageq); - vm_page_queues[m->queue].lcnt++; + vm_pageq_enqueue(m->pc + PQ_FREE, m); return (m); } |