aboutsummaryrefslogtreecommitdiff
path: root/sys/vm
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2022-07-13 13:39:26 +0000
committerMark Johnston <markj@FreeBSD.org>2022-07-13 13:39:26 +0000
commiteee9aab9cb5adfbf39ab5622b441d0021c13efea (patch)
tree8f4fd223f21ec1bea736fed42d673832eebb70d9 /sys/vm
parenteaab493eee8952bb9dbf373e64723ba47dfc1598 (diff)
downloadsrc-eee9aab9cb5adfbf39ab5622b441d0021c13efea.tar.gz
src-eee9aab9cb5adfbf39ab5622b441d0021c13efea.zip
vm_mmap: Remove obsolete code and comments from vm_mmap()
In preparation for removing OBJT_DEFAULT, eliminate some stale/unhelpful comments from vm_mmap(), and remove an unused case. In particular, the remaining callers of vm_mmap() in the tree do not specify OBJT_DEFAULT. It's much more common to use vm_map_find() to map an object into user memory, so rather than adjusting vm_mmap() to handle OBJT_SWAP objects, let's further discourage its use and simply remove OBJT_DEFAULT handling. Reviewed by: dougm, alc, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35778
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_mmap.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c
index 5f27b550b78d..1c02ba35fcfe 100644
--- a/sys/vm/vm_mmap.c
+++ b/sys/vm/vm_mmap.c
@@ -1454,13 +1454,6 @@ vm_mmap_cdev(struct thread *td, vm_size_t objsize, vm_prot_t prot,
return (0);
}
-/*
- * vm_mmap()
- *
- * Internal version of mmap used by exec, sys5 shared memory, and
- * various device drivers. Handle is either a vnode pointer, a
- * character device, or NULL for MAP_ANON.
- */
int
vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot,
vm_prot_t maxprot, int flags,
@@ -1479,9 +1472,6 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot,
object = NULL;
writecounted = FALSE;
- /*
- * Lookup/allocate object.
- */
switch (handle_type) {
case OBJT_DEVICE: {
struct cdevsw *dsw;
@@ -1501,12 +1491,6 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot,
error = vm_mmap_vnode(td, size, prot, &maxprot, &flags,
handle, &foff, &object, &writecounted);
break;
- case OBJT_DEFAULT:
- if (handle == NULL) {
- error = 0;
- break;
- }
- /* FALLTHROUGH */
default:
error = EINVAL;
break;