Line 0
Link Here
|
|
|
1 |
--- kernel/freebsd/contigmem/contigmem.c.orig 2020-01-03 12:22:51 UTC |
2 |
+++ kernel/freebsd/contigmem/contigmem.c |
3 |
@@ -297,19 +297,22 @@ contigmem_cdev_pager_fault(vm_object_t object, vm_ooff |
4 |
VM_OBJECT_WLOCK(object); |
5 |
vm_page_updatefake(page, paddr, memattr); |
6 |
} else { |
7 |
- vm_page_t mret; |
8 |
/* |
9 |
* Replace the passed in reqpage page with our own fake page and |
10 |
* free up the original page. |
11 |
*/ |
12 |
page = vm_page_getfake(paddr, memattr); |
13 |
VM_OBJECT_WLOCK(object); |
14 |
- mret = vm_page_replace(page, object, (*mres)->pindex); |
15 |
+#if __FreeBSD__ >= 13 |
16 |
+ vm_page_replace(page, object, (*mres)->pindex, *mres); |
17 |
+#else |
18 |
+ vm_page_t mret = vm_page_replace(page, object, (*mres)->pindex); |
19 |
KASSERT(mret == *mres, |
20 |
("invalid page replacement, old=%p, ret=%p", *mres, mret)); |
21 |
vm_page_lock(mret); |
22 |
vm_page_free(mret); |
23 |
vm_page_unlock(mret); |
24 |
+#endif |
25 |
*mres = page; |
26 |
} |
27 |
|