| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: uvm_bio.c,v 1.110 2020/04/23 21:47:09 ad Exp $ */ | | 1 | /* $NetBSD: uvm_bio.c,v 1.111 2020/04/23 21:53:01 ad Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1998 Chuck Silvers. | | 4 | * Copyright (c) 1998 Chuck Silvers. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -24,27 +24,27 @@ | | | @@ -24,27 +24,27 @@ |
24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | | 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
25 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | | 25 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
28 | * SUCH DAMAGE. | | 28 | * SUCH DAMAGE. |
29 | * | | 29 | * |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | /* | | 32 | /* |
33 | * uvm_bio.c: buffered i/o object mapping cache | | 33 | * uvm_bio.c: buffered i/o object mapping cache |
34 | */ | | 34 | */ |
35 | | | 35 | |
36 | #include <sys/cdefs.h> | | 36 | #include <sys/cdefs.h> |
37 | __KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.110 2020/04/23 21:47:09 ad Exp $"); | | 37 | __KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.111 2020/04/23 21:53:01 ad Exp $"); |
38 | | | 38 | |
39 | #include "opt_uvmhist.h" | | 39 | #include "opt_uvmhist.h" |
40 | #include "opt_ubc.h" | | 40 | #include "opt_ubc.h" |
41 | | | 41 | |
42 | #include <sys/param.h> | | 42 | #include <sys/param.h> |
43 | #include <sys/systm.h> | | 43 | #include <sys/systm.h> |
44 | #include <sys/kmem.h> | | 44 | #include <sys/kmem.h> |
45 | #include <sys/kernel.h> | | 45 | #include <sys/kernel.h> |
46 | #include <sys/proc.h> | | 46 | #include <sys/proc.h> |
47 | #include <sys/vnode.h> | | 47 | #include <sys/vnode.h> |
48 | | | 48 | |
49 | #include <uvm/uvm.h> | | 49 | #include <uvm/uvm.h> |
50 | | | 50 | |
| @@ -54,27 +54,27 @@ __KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v | | | @@ -54,27 +54,27 @@ __KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v |
54 | | | 54 | |
55 | /* | | 55 | /* |
56 | * local functions | | 56 | * local functions |
57 | */ | | 57 | */ |
58 | | | 58 | |
59 | static int ubc_fault(struct uvm_faultinfo *, vaddr_t, struct vm_page **, | | 59 | static int ubc_fault(struct uvm_faultinfo *, vaddr_t, struct vm_page **, |
60 | int, int, vm_prot_t, int); | | 60 | int, int, vm_prot_t, int); |
61 | static struct ubc_map *ubc_find_mapping(struct uvm_object *, voff_t); | | 61 | static struct ubc_map *ubc_find_mapping(struct uvm_object *, voff_t); |
62 | #ifdef UBC_USE_PMAP_DIRECT | | 62 | #ifdef UBC_USE_PMAP_DIRECT |
63 | static int __noinline ubc_uiomove_direct(struct uvm_object *, struct uio *, vsize_t, | | 63 | static int __noinline ubc_uiomove_direct(struct uvm_object *, struct uio *, vsize_t, |
64 | int, int); | | 64 | int, int); |
65 | static void __noinline ubc_zerorange_direct(struct uvm_object *, off_t, size_t, int); | | 65 | static void __noinline ubc_zerorange_direct(struct uvm_object *, off_t, size_t, int); |
66 | | | 66 | |
67 | bool ubc_direct = false; /* XXX */ | | 67 | bool ubc_direct = true; |
68 | #endif | | 68 | #endif |
69 | | | 69 | |
70 | /* | | 70 | /* |
71 | * local data structues | | 71 | * local data structues |
72 | */ | | 72 | */ |
73 | | | 73 | |
74 | #define UBC_HASH(uobj, offset) \ | | 74 | #define UBC_HASH(uobj, offset) \ |
75 | (((((u_long)(uobj)) >> 8) + (((u_long)(offset)) >> PAGE_SHIFT)) & \ | | 75 | (((((u_long)(uobj)) >> 8) + (((u_long)(offset)) >> PAGE_SHIFT)) & \ |
76 | ubc_object.hashmask) | | 76 | ubc_object.hashmask) |
77 | | | 77 | |
78 | #define UBC_QUEUE(offset) \ | | 78 | #define UBC_QUEUE(offset) \ |
79 | (&ubc_object.inactive[(((u_long)(offset)) >> ubc_winshift) & \ | | 79 | (&ubc_object.inactive[(((u_long)(offset)) >> ubc_winshift) & \ |
80 | (UBC_NQUEUES - 1)]) | | 80 | (UBC_NQUEUES - 1)]) |