From: kn Date: Tue, 9 May 2023 10:35:20 +0000 (+0000) Subject: Inline once-used variable to sync all uvm_map_clean() callers X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=64e7c6f9a919a7d3553411daf5ea8c5116200ed0;p=openbsd Inline once-used variable to sync all uvm_map_clean() callers OK mpi --- diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c index 69087134785..caea59be203 100644 --- a/sys/uvm/uvm_mmap.c +++ b/sys/uvm/uvm_mmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_mmap.c,v 1.181 2023/04/11 00:45:09 jsg Exp $ */ +/* $OpenBSD: uvm_mmap.c,v 1.182 2023/05/09 10:35:20 kn Exp $ */ /* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */ /* @@ -449,7 +449,6 @@ sys_msync(struct proc *p, void *v, register_t *retval) } */ *uap = v; vaddr_t addr; vsize_t size, pageoff; - vm_map_t map; int flags, uvmflags; /* extract syscall args from the uap */ @@ -470,9 +469,6 @@ sys_msync(struct proc *p, void *v, register_t *retval) if (addr > SIZE_MAX - size) return EINVAL; /* disallow wrap-around. */ - /* get map */ - map = &p->p_vmspace->vm_map; - /* translate MS_ flags into PGO_ flags */ uvmflags = PGO_CLEANIT; if (flags & MS_INVALIDATE) @@ -482,7 +478,7 @@ sys_msync(struct proc *p, void *v, register_t *retval) else uvmflags |= PGO_SYNCIO; /* XXXCDC: force sync for now! */ - return uvm_map_clean(map, addr, addr+size, uvmflags); + return uvm_map_clean(&p->p_vmspace->vm_map, addr, addr+size, uvmflags); } /*