| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: procfs_vnops.c,v 1.209 2020/02/23 22:14:04 ad Exp $ */ | | 1 | /* $NetBSD: procfs_vnops.c,v 1.210 2020/02/24 20:47:41 ad Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Andrew Doran. | | 8 | * by Andrew Doran. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -95,27 +95,27 @@ | | | @@ -95,27 +95,27 @@ |
95 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 95 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
96 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 96 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
97 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 97 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
98 | * SUCH DAMAGE. | | 98 | * SUCH DAMAGE. |
99 | * | | 99 | * |
100 | * @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95 | | 100 | * @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95 |
101 | */ | | 101 | */ |
102 | | | 102 | |
103 | /* | | 103 | /* |
104 | * procfs vnode interface | | 104 | * procfs vnode interface |
105 | */ | | 105 | */ |
106 | | | 106 | |
107 | #include <sys/cdefs.h> | | 107 | #include <sys/cdefs.h> |
108 | __KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.209 2020/02/23 22:14:04 ad Exp $"); | | 108 | __KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.210 2020/02/24 20:47:41 ad Exp $"); |
109 | | | 109 | |
110 | #include <sys/param.h> | | 110 | #include <sys/param.h> |
111 | #include <sys/atomic.h> | | 111 | #include <sys/atomic.h> |
112 | #include <sys/systm.h> | | 112 | #include <sys/systm.h> |
113 | #include <sys/time.h> | | 113 | #include <sys/time.h> |
114 | #include <sys/kernel.h> | | 114 | #include <sys/kernel.h> |
115 | #include <sys/file.h> | | 115 | #include <sys/file.h> |
116 | #include <sys/filedesc.h> | | 116 | #include <sys/filedesc.h> |
117 | #include <sys/proc.h> | | 117 | #include <sys/proc.h> |
118 | #include <sys/vnode.h> | | 118 | #include <sys/vnode.h> |
119 | #include <sys/namei.h> | | 119 | #include <sys/namei.h> |
120 | #include <sys/malloc.h> | | 120 | #include <sys/malloc.h> |
121 | #include <sys/mount.h> | | 121 | #include <sys/mount.h> |
| @@ -1729,27 +1729,27 @@ procfs_getpages(void *v) | | | @@ -1729,27 +1729,27 @@ procfs_getpages(void *v) |
1729 | { | | 1729 | { |
1730 | struct vop_getpages_args /* { | | 1730 | struct vop_getpages_args /* { |
1731 | struct vnode *a_vp; | | 1731 | struct vnode *a_vp; |
1732 | voff_t a_offset; | | 1732 | voff_t a_offset; |
1733 | struct vm_page **a_m; | | 1733 | struct vm_page **a_m; |
1734 | int *a_count; | | 1734 | int *a_count; |
1735 | int a_centeridx; | | 1735 | int a_centeridx; |
1736 | vm_prot_t a_access_type; | | 1736 | vm_prot_t a_access_type; |
1737 | int a_advice; | | 1737 | int a_advice; |
1738 | int a_flags; | | 1738 | int a_flags; |
1739 | } */ *ap = v; | | 1739 | } */ *ap = v; |
1740 | | | 1740 | |
1741 | if ((ap->a_flags & PGO_LOCKED) == 0) | | 1741 | if ((ap->a_flags & PGO_LOCKED) == 0) |
1742 | mutex_exit(ap->a_vp->v_interlock); | | 1742 | rw_exit(ap->a_vp->v_uobj.vmobjlock); |
1743 | | | 1743 | |
1744 | return (EFAULT); | | 1744 | return (EFAULT); |
1745 | } | | 1745 | } |
1746 | | | 1746 | |
1747 | /* | | 1747 | /* |
1748 | * convert decimal ascii to int | | 1748 | * convert decimal ascii to int |
1749 | */ | | 1749 | */ |
1750 | static int | | 1750 | static int |
1751 | atoi(const char *b, size_t len) | | 1751 | atoi(const char *b, size_t len) |
1752 | { | | 1752 | { |
1753 | int p = 0; | | 1753 | int p = 0; |
1754 | | | 1754 | |
1755 | while (len--) { | | 1755 | while (len--) { |