From nobody Wed Jul 27 13:52:36 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4LtFb830sTz4Xc3M; Wed, 27 Jul 2022 13:52:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LtFb822LSz3cSP; Wed, 27 Jul 2022 13:52:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658929956; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ok3S0l7vGVSS//qeCYhI+0ulWAEllcvqXFjriJrE/LE=; b=WuJM9rOaEWZRrdUIdBbPuKLM5NC6CKgrgYa1XRMNhxjv3Yp2SUbzCbL3TAhouXQvoW7gYi PDIsEUr7iYnzSRENnQclFi0YQu8FkMbsdldtk8+1fT0ad1y2jd9geiZCYTvCMszMqEk9P/ A6PoWViqU6H62vIhXqvF7wXF5GnKGElh+vOx8lt6+S0c9rtRU0bgUR//J5LKcXDxj6j6TI 3mSKVm7vZBw7DAuQmRN5XOKrF5ObLJToHjg1l+/ljwfvgZC5cVaAjBYEV0vlrzRxShYzZd yAQ+dmlGcSYZDQ3HzMdk4Z+q1HGt6OiVVnoRJC8idqPXYYY3RitQiqHimBwHZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LtFb80wcczJS9; Wed, 27 Jul 2022 13:52:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26RDqa9T024182; Wed, 27 Jul 2022 13:52:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26RDqaEl024181; Wed, 27 Jul 2022 13:52:36 GMT (envelope-from git) Date: Wed, 27 Jul 2022 13:52:36 GMT Message-Id: <202207271352.26RDqaEl024181@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 01d3ddbfcfa5 - stable/13 - vm_mmap: Remove obsolete code and comments from vm_mmap() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 01d3ddbfcfa5bb6b0e809b0c12ba31613bf61056 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658929956; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ok3S0l7vGVSS//qeCYhI+0ulWAEllcvqXFjriJrE/LE=; b=g3uLnk8NF16Wcq6YotKx4Xd6+pXkLMCwR4PC8+oshaWqURkep4l95em99BiPgPZ06eLi+Y WVW/7496TvdZRJrqXAdQhuBjYducISuUZ5GUCBeBHfM5UJzThEniSvDQaBRWvKRSoDI5Mv YkNa4UI6FVS876zG0lmW+3Bxc1F06kk6DCzRlHxbRAd+sIuUze6V8ebx1VYN75+waRZcGI hED8F4Yvs1dDPkKJuEvxr+84dsHrY2oOALw+94szR8Nhjj0uZLJQFaCzCzcfAuiGXb2J4x VzLq69NTaIMOXsPzlmE8WwSsHZ04ZO1TMsa1bV5nc6tiBYOkgRrJ+I9a3V41zg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658929956; a=rsa-sha256; cv=none; b=M1+dOkc5be2aIWYlPWhg75XajeaKcvCLi9pRcLDtmk6STxGS+agc52WPkZ6FK9ug5vf4cT Sb55scxu1JSEMZXJZGQC1DAkqUwscc8vZwFqyrwqHqZ+81phhe+UpXby55ABvSzk8pwlwD KKGYn9TrmXXzFmqickVnxtI94TS/zQ0AQR+2Mz9gbGYW3jSkDD+FBN03ogTx+RXdZHYKNz 6h+RFcFEEMTkAzTiIgCrZaWW79nHP8TytMnBbyu//3HSJhfZb8dLsRxRyE45aSWRektU4x 2eZa3o2qWnMb299z3LK9KndaquYaTv+Y7JxUBWAvRuqf4qT12p6ZIRD+MZOZeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=01d3ddbfcfa5bb6b0e809b0c12ba31613bf61056 commit 01d3ddbfcfa5bb6b0e809b0c12ba31613bf61056 Author: Mark Johnston AuthorDate: 2022-07-13 13:39:26 +0000 Commit: Mark Johnston CommitDate: 2022-07-27 13:50:55 +0000 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 Sponsored by: The FreeBSD Foundation (cherry picked from commit eee9aab9cb5adfbf39ab5622b441d0021c13efea) --- sys/vm/vm_mmap.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 48bf364731a2..0aaa534b8ca4 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -1442,13 +1442,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, @@ -1467,9 +1460,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; @@ -1489,12 +1479,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;