Trim white spaces, adjust style.

MFC after:	2 weeks
This commit is contained in:
Konstantin Belousov 2011-03-28 13:28:23 +00:00
parent 937060a843
commit cce6e354aa

View File

@ -468,24 +468,26 @@ cloneuio(struct uio *uiop)
int int
copyout_map(struct thread *td, vm_offset_t *addr, size_t sz) copyout_map(struct thread *td, vm_offset_t *addr, size_t sz)
{ {
struct vmspace *vms = td->td_proc->p_vmspace; struct vmspace *vms;
int error; int error;
vm_size_t size; vm_size_t size;
/* vms = td->td_proc->p_vmspace;
/*
* Map somewhere after heap in process memory. * Map somewhere after heap in process memory.
*/ */
PROC_LOCK(td->td_proc); PROC_LOCK(td->td_proc);
*addr = round_page((vm_offset_t)vms->vm_daddr + *addr = round_page((vm_offset_t)vms->vm_daddr +
lim_max(td->td_proc, RLIMIT_DATA)); lim_max(td->td_proc, RLIMIT_DATA));
PROC_UNLOCK(td->td_proc); PROC_UNLOCK(td->td_proc);
/* round size up to page boundry */ /* round size up to page boundry */
size = (vm_size_t) round_page(sz); size = (vm_size_t)round_page(sz);
error = vm_mmap(&vms->vm_map, addr, size, PROT_READ | PROT_WRITE, error = vm_mmap(&vms->vm_map, addr, size, PROT_READ | PROT_WRITE,
VM_PROT_ALL, MAP_PRIVATE | MAP_ANON, OBJT_DEFAULT, NULL, 0); VM_PROT_ALL, MAP_PRIVATE | MAP_ANON, OBJT_DEFAULT, NULL, 0);
return (error); return (error);
} }
@ -497,12 +499,12 @@ copyout_unmap(struct thread *td, vm_offset_t addr, size_t sz)
{ {
vm_map_t map; vm_map_t map;
vm_size_t size; vm_size_t size;
if (sz == 0) if (sz == 0)
return (0); return (0);
map = &td->td_proc->p_vmspace->vm_map; map = &td->td_proc->p_vmspace->vm_map;
size = (vm_size_t) round_page(sz); size = (vm_size_t)round_page(sz);
if (!vm_map_remove(map, addr, addr + size)) if (!vm_map_remove(map, addr, addr + size))
return (EINVAL); return (EINVAL);