From nobody Fri Jul 4 15:23:53 2025 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 4bYcqG5sL6z61Lkd; Fri, 04 Jul 2025 15:23:54 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bYcqF3smpz3Knt; Fri, 04 Jul 2025 15:23:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751642633; 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=QVZ+sfYeY8C05vfxvrBuYZFJ6iaPfiklsDp0rGb6v/g=; b=D+DAVlH/RRAVqWNfBuB79NG5x7AS+0zUKMsjlh5A13VNbaAsj1bySCE4IMJ2bE+GaFs2Jr Dj2FaliumRiuLdQiezE4mnXd8bZyDPnpBJt1O8jekbkOrABxTi/x/cgT9KsCi2FTHivz+3 bA630fAExvqSTyrdJn0dH5MEGKRwk3BREdEyz6THK7imWmpuKfICKBStumZegSWXwkD9b+ CwIgKsZ79Kdugk0vKTc5cV34CYSSn997/U2qzgtxMCiAaBEKIUPfp7Q/cLysio/2piAbZl 7l6rbVs7QYXlYQOgXYVdLDYRxCnnt/8tkOxX6AquZ7TuMKMuX8EQILpeJLfQ/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751642633; 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=QVZ+sfYeY8C05vfxvrBuYZFJ6iaPfiklsDp0rGb6v/g=; b=l470nei1D64nIxlxEbVPnlmfqQ9qJxa1kasgeRaFdxaOCyX+JAmMK8uUvluMuiQr1rkW2O vqIVpb6o3JMsf4FmLOXa2G+JZjL3Y+gXsXxqrz8yBJEePEPMNYLGRX22tF9DylQ2tiuGPS aoRR2iVUyDpjm02Xb9FIWIwxrNCUNyTrOOYe8pg0OnB2I/gkdXECNRe8Fe19y+UM3bvLDC a6NcigolEVPIQdV5CbfRefKhcAD8YHGhIKEkClMRrgCPhPe0rAyO4YUToKJXmaNb15N2dI gP+laNlWv7kCyXg3RLU9j2tTeQUVGmQy/y9CjU7itt9Ma0ZPXY6HcKb+c+r4Wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751642633; a=rsa-sha256; cv=none; b=S8d8bmqIRxRJ4oePCiMIgxMy0CJf1JFhVNOMbuoq1VoHpHTkZBGvUUZzYypsfOYzUO/Fzm yMHXVT7S+FrZujR7vWwW3lePp5859foxhDofjZ5UhmphX8giXZ8oiXGxuzPNhJI9INMpVL Le7CV7zKvmoUoiwy2BrJs8ZVFzPBCP9CzgLc4XisMlI3AKzNhKSEMEX3Jx5ZOT8ly2UJ11 xtcel7A6O650aueDhm8xv3wWFoKGCBDRJKb30hz+G0klmIpt1hrFXKZQEs74nLDU+TPkTg dFsPjao1AhGTfbaUIz87a6FO1AddmG12BcapQmceiWecG4LpcE1fK35xcZOMeg== 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 4bYcqF14NJzwL5; Fri, 04 Jul 2025 15:23:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 564FNrm1030112; Fri, 4 Jul 2025 15:23:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 564FNrWd030109; Fri, 4 Jul 2025 15:23:53 GMT (envelope-from git) Date: Fri, 4 Jul 2025 15:23:53 GMT Message-Id: <202507041523.564FNrWd030109@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 2ffee9aef7c2 - main - vfs_lookup: split NDRESTART 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ffee9aef7c272d631dc072f7cfdd978c01c7dc8 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2ffee9aef7c272d631dc072f7cfdd978c01c7dc8 commit 2ffee9aef7c272d631dc072f7cfdd978c01c7dc8 Author: Konstantin Belousov AuthorDate: 2025-06-15 07:51:48 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-04 15:23:42 +0000 vfs_lookup: split NDRESTART to have a convenient way to clear internal and result flags without marking ndp as restarting. Reviewed by: markj, olce Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50648 --- sys/kern/vfs_lookup.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 86c7bdaa02c0..499325a3a406 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -74,15 +74,21 @@ static void NDVALIDATE_impl(struct nameidata *, int); #define NDVALIDATE(ndp) #endif +/* + * Reset ndp to its original state. + */ +#define NDRESET(ndp) do { \ + NDREINIT_DBG(ndp); \ + ndp->ni_resflags = 0; \ + ndp->ni_cnd.cn_flags &= ~NAMEI_INTERNAL_FLAGS; \ +} while (0) /* * Prepare namei() to restart. Reset components to its original state and set * ISRESTARTED flag which signals the underlying lookup code to change the root * from ABI root to actual root and prevents a further restarts. */ #define NDRESTART(ndp) do { \ - NDREINIT_DBG(ndp); \ - ndp->ni_resflags = 0; \ - ndp->ni_cnd.cn_flags &= ~NAMEI_INTERNAL_FLAGS; \ + NDRESET(ndp); \ ndp->ni_cnd.cn_flags |= ISRESTARTED; \ } while (0)