mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-12 14:29:28 +00:00
Modify vm_pageq_requeue() to handle a PQ_NONE page without dereferencing
a NULL pointer; remove some now unused code.
This commit is contained in:
parent
01e5a2aede
commit
2099bdfded
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=116860
@ -46,26 +46,17 @@ vm_pageq_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
static __inline struct vpgqueues *
|
||||
vm_pageq_aquire(int queue)
|
||||
{
|
||||
struct vpgqueues *vpq = NULL;
|
||||
|
||||
if (queue != PQ_NONE) {
|
||||
vpq = &vm_page_queues[queue];
|
||||
}
|
||||
return (vpq);
|
||||
}
|
||||
|
||||
void
|
||||
vm_pageq_requeue(vm_page_t m)
|
||||
{
|
||||
int queue = m->queue;
|
||||
struct vpgqueues *vpq;
|
||||
|
||||
vpq = vm_pageq_aquire(queue);
|
||||
TAILQ_REMOVE(&vpq->pl, m, pageq);
|
||||
TAILQ_INSERT_TAIL(&vpq->pl, m, pageq);
|
||||
if (queue != PQ_NONE) {
|
||||
vpq = &vm_page_queues[queue];
|
||||
TAILQ_REMOVE(&vpq->pl, m, pageq);
|
||||
TAILQ_INSERT_TAIL(&vpq->pl, m, pageq);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user