diff options
author | truckman <truckman@FreeBSD.org> | 2004-02-26 00:27:04 +0000 |
---|---|---|
committer | truckman <truckman@FreeBSD.org> | 2004-02-26 00:27:04 +0000 |
commit | 1de257deb3229812024de5861eb0aaa41e471448 (patch) | |
tree | d1174aae4c9e291961c623eba11458d6d2058f11 /sys/vm/vm_extern.h | |
parent | 50cda1680380cd332bc897ddc8f54d65ddf9aa9d (diff) | |
download | FreeBSD-src-1de257deb3229812024de5861eb0aaa41e471448.zip FreeBSD-src-1de257deb3229812024de5861eb0aaa41e471448.tar.gz |
Split the mlock() kernel code into two parts, mlock(), which unpacks
the syscall arguments and does the suser() permission check, and
kern_mlock(), which does the resource limit checking and calls
vm_map_wire(). Split munlock() in a similar way.
Enable the RLIMIT_MEMLOCK checking code in kern_mlock().
Replace calls to vslock() and vsunlock() in the sysctl code with
calls to kern_mlock() and kern_munlock() so that the sysctl code
will obey the wired memory limits.
Nuke the vslock() and vsunlock() implementations, which are no
longer used.
Add a member to struct sysctl_req to track the amount of memory
that is wired to handle the request.
Modify sysctl_wire_old_buffer() to return an error if its call to
kern_mlock() fails. Only wire the minimum of the length specified
in the sysctl request and the length specified in its argument list.
It is recommended that sysctl handlers that use sysctl_wire_old_buffer()
should specify reasonable estimates for the amount of data they
want to return so that only the minimum amount of memory is wired
no matter what length has been specified by the request.
Modify the callers of sysctl_wire_old_buffer() to look for the
error return.
Modify sysctl_old_user to obey the wired buffer length and clean up
its implementation.
Reviewed by: bms
Diffstat (limited to 'sys/vm/vm_extern.h')
-rw-r--r-- | sys/vm/vm_extern.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h index 2d8c232..d8581e6 100644 --- a/sys/vm/vm_extern.h +++ b/sys/vm/vm_extern.h @@ -59,6 +59,8 @@ int sstk(struct thread *, void *, int *); int swapon(struct thread *, void *, int *); #endif /* TYPEDEF_FOR_UAP */ +int kern_mlock(struct thread *, vm_offset_t, vm_size_t); +int kern_munlock(struct thread *, vm_offset_t, vm_size_t); int kernacc(void *, int, int); vm_offset_t kmem_alloc(vm_map_t, vm_size_t); vm_offset_t kmem_alloc_nofault(vm_map_t, vm_size_t); @@ -86,8 +88,6 @@ void vmspace_unshare(struct proc *); void vmspace_free(struct vmspace *); void vmspace_exitfree(struct proc *); void vnode_pager_setsize(struct vnode *, vm_ooffset_t); -void vslock(void *, u_int); -void vsunlock(void *, u_int); void vm_object_print(/* db_expr_t */ long, boolean_t, /* db_expr_t */ long, char *); int vm_fault_quick(caddr_t v, int prot); |