Module Name: src
Committed By: martin
Date: Tue Sep 10 16:00:19 UTC 2019
Modified Files:
src/sys/miscfs/procfs [netbsd-8]: procfs_linux.c
Log Message:
Pull up following revision(s) (requested by chs in ticket #1370):
sys/miscfs/procfs/procfs_linux.c: revision 1.76
have procfs_do_pid_stat() pass the proc's map to get_proc_size_info(),
rather than having the latter look up the map again and not check
for an error.
To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.73.4.1 src/sys/miscfs/procfs/procfs_linux.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/miscfs/procfs/procfs_linux.c
diff -u src/sys/miscfs/procfs/procfs_linux.c:1.73 src/sys/miscfs/procfs/procfs_linux.c:1.73.4.1
--- src/sys/miscfs/procfs/procfs_linux.c:1.73 Thu Apr 13 09:54:18 2017
+++ src/sys/miscfs/procfs/procfs_linux.c Tue Sep 10 16:00:19 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: procfs_linux.c,v 1.73 2017/04/13 09:54:18 hannken Exp $ */
+/* $NetBSD: procfs_linux.c,v 1.73.4.1 2019/09/10 16:00:19 martin Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_linux.c,v 1.73 2017/04/13 09:54:18 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_linux.c,v 1.73.4.1 2019/09/10 16:00:19 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -75,19 +75,15 @@ extern int max_devsw_convs;
#define LBFSZ (8 * 1024)
static void
-get_proc_size_info(struct lwp *l, unsigned long *stext, unsigned long *etext, unsigned long *sstack)
+get_proc_size_info(struct proc *p, struct vm_map *map, unsigned long *stext,
+ unsigned long *etext, unsigned long *sstack)
{
- struct proc *p = l->l_proc;
- struct vmspace *vm;
- struct vm_map *map;
struct vm_map_entry *entry;
*stext = 0;
*etext = 0;
*sstack = 0;
- proc_vmspace_getref(p, &vm);
- map = &vm->vm_map;
vm_map_lock_read(map);
for (entry = map->header.next; entry != &map->header;
@@ -128,7 +124,6 @@ get_proc_size_info(struct lwp *l, unsign
*sstack -= PAGE_SIZE;
vm_map_unlock_read(map);
- uvmspace_free(vm);
}
/*
@@ -435,7 +430,7 @@ procfs_do_pid_stat(struct lwp *curl, str
goto out;
}
- get_proc_size_info(l, &stext, &etext, &sstack);
+ get_proc_size_info(p, &vm->vm_map, &stext, &etext, &sstack);
mutex_enter(proc_lock);
mutex_enter(p->p_lock);