From nobody Wed Jul 13 14:04:38 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 0E3311CFC2F8; Wed, 13 Jul 2022 14:04:39 +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 4LjfWV6xfmz49WX; Wed, 13 Jul 2022 14:04:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657721079; 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=8FvzZVOZNV8qlTrayGdAq6GptGTdsXHmAiIDh0Trsro=; b=JNaa71tIhTKU/NHWJ8NHavtfwmuJ29wj8ltBeLiEGg8yIqnalX00TKNTMfH5A4OJjs1/pU nUM3i86mPBRYYiMRTtCrRlw6PuZClffLeEryFb8lbV4VhqNYnwW4bq8ccZm1C2CdIpuS2D xNliT05cA4ppESV8SZByrdXe82aM0q+nbuQH1hXE75QEbcmmD+TrkgOWOgvpalJFgPBaSX W04zXmvoxD7zVx/8IM0HVj2+TrNc76DeNlmQ2pd9kB7XQlYAeVIZkxyqfMxlSHf32y3Ms/ D9liazboUXPPuQHOX0xCWCDqJQ0Aa7JfeeAaW9TC2D9mPZ0TN0o310c+zAWewg== 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 4LjfWV5yfzzQnD; Wed, 13 Jul 2022 14:04:38 +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 26DE4ciq035598; Wed, 13 Jul 2022 14:04:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26DE4c3r035597; Wed, 13 Jul 2022 14:04:38 GMT (envelope-from git) Date: Wed, 13 Jul 2022 14:04:38 GMT Message-Id: <202207131404.26DE4c3r035597@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: eee9aab9cb5a - main - 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/main X-Git-Reftype: branch X-Git-Commit: eee9aab9cb5adfbf39ab5622b441d0021c13efea Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657721079; 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=8FvzZVOZNV8qlTrayGdAq6GptGTdsXHmAiIDh0Trsro=; b=NSJAj2aOS/EIFs0tJZ4rT92U8iPOWyPKafHl4NhTe+Do+B8r7e0Ti364J53OOvyZZiDX64 M0CR9zzRC9cbHz7qBrOx8vF8Tb0IUo40YEVKTYHZDQ68nWJ9+92dS53tAMTHdEsU9Qyd82 OmZUufn6L0SDaZeKSkiEqzUl0xZdiI+YyCP5rEuMswi7wHWUv3beV45rDxNK29I37WMERF e5rP9uhTUCESHtnlfrewsO1V998j5Hz1ZAje7rGOmEPXl89M51SpLfmglE2oiAiZ03vGfy rDVkLfCN4lzG9FmXMl5OUGwAtpPsZ4zs6DRRmzlfH6udWHH/FEZu+tblalQGMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657721079; a=rsa-sha256; cv=none; b=kO/rEfT148s65Zu5D95WIS/Huksve8D9zSlc5NK7CB4PKZp9dHdQc9X4aJE9WgmyRNL+UC BQOaVrIIggAjTbZ62/pDoEX+72zM+5xQR4U6jbZb4Zw6z2HDZJUMy8pp5RPFdaTHv9aBWN VfLAWRj7ABSAUC7GlMRMDpCZJHNaIUiJ8jrj/Ap3G+eyuxp9quewRE08Idt+V1WEBcP8tM R+SwGpIYVVwqSd9lnyyTw9WhqTDUn7HoJY4JUSIf+MqCo/rY+LxvA5gMIBM9oC2Mhs4wFI 7kfiNPm/aaJeloVzwDyC//3tHIANEW2XdqygncRdxSiV/YNgpEMgFrXX7hNKCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=eee9aab9cb5adfbf39ab5622b441d0021c13efea commit eee9aab9cb5adfbf39ab5622b441d0021c13efea Author: Mark Johnston AuthorDate: 2022-07-13 13:39:26 +0000 Commit: Mark Johnston CommitDate: 2022-07-13 13:39:26 +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 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35778 --- 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 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;