From nobody Wed Dec 27 10:04:35 2023 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 4T0S0z3j97z55L7N; Wed, 27 Dec 2023 10:04:35 +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 4T0S0z38Sfz4FHX; Wed, 27 Dec 2023 10:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703671475; 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=2i/OVtvjm4hlcYB/YWWFdKoUJu7a0BbFrLlwIsAqFJg=; b=kSztO2pBrNvJh0oftLdlY8z2JxiSR6uX1evSSLe3rPE/LkCmVz/z3tKe57poTiHqXyIFnD 19f3gzfo7mcXMSF4cVO3W6v7ESX2k0kvHMsXMpsSpq659xIk+N+w/X9TNB/AmH1dq3TaxL qLPDatQhotZIpHB0317PY+/J47Tw6MNGhGDD3S0X48Grkzc4ys06gp00IedV8Vaz7kVXLS JRLlhL6bM5ac1irn5uAtWR4kYyHzIiaeewC5c8o2tNEarJVAVRqfhZ7lxSxjiKNCBlfyoB tXhRrhJWOT1QxzC5+nIhaSpk4gJkwrfvinG0ZLp2AIL3XMp9qKmitRu/+lGd6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703671475; a=rsa-sha256; cv=none; b=hF23qNUNPdbIAfJM/b6R94nCS+VoNYV6zsBHTT7v/b1WKVyfAIDg0IU03w8Weit0F9txCr uXxsbwW/P+WY/miWOLCJBZFYO8RUSxBwDgCnoE1W5tGuhzCzr/6sN/FJR8HkPzOLZ2BuBt Gi2aG1ERuk6jcTqDwg6xjrnQmGoxfGNZ4MDAU/J6kO2bj3ARkyE8N2AePMzjo8ja96BCw8 KlslDWHtPNu6Ct194j+4a8IMpdvx9FpGsKzwfQXs/wioqKl6t2ZgO//WZUvdkhf4rgHiOI 2bM1hPICHBOuekGNJw/p3SHauluKO2dCgsbo1XJuqT3NAtgMgJBKvBu9NV858g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703671475; 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=2i/OVtvjm4hlcYB/YWWFdKoUJu7a0BbFrLlwIsAqFJg=; b=IMRMbe1dFBqtqMyIUA/mi3FUlewCrxmvrjJM3IfWL1zUytkoqZBBUNN0G2TIAWWLnov7EI bWIcyx+uFWkKzBuzX3bVc4n31tSLkDQxhpMMecxaf1skXNg4E6euKjgvVa3KiLU6Ed71ao Uh+cqyXLf1omN4IMi/uGKBnRCZoiTrZX6LBdm4TAtt0D7kEiCc2KNgHaWnsEnBKc2NAgZA R/poyCJRtWZDCfZNridWb04bdKagOAYrMimHRRhbW1sEshdjlpuoO+qhAUWNoJup6StZmS psPU0rd5r4qc0mz5pDn9/+Q0O1XuaFXgAfvzDJ2fumoT/FFw/xDZo4Gw31Xz2A== 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 4T0S0z2C53zYth; Wed, 27 Dec 2023 10:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BRA4ZNm028126; Wed, 27 Dec 2023 10:04:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BRA4ZoE028123; Wed, 27 Dec 2023 10:04:35 GMT (envelope-from git) Date: Wed, 27 Dec 2023 10:04:35 GMT Message-Id: <202312271004.3BRA4ZoE028123@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: 3334a537ed38 - main - Convert fsidcmp(9) from macro to inline function 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3334a537ed385e487a47208dab8f36b25643bcdb Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3334a537ed385e487a47208dab8f36b25643bcdb commit 3334a537ed385e487a47208dab8f36b25643bcdb Author: Konstantin Belousov AuthorDate: 2023-12-26 19:39:33 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-27 09:50:16 +0000 Convert fsidcmp(9) from macro to inline function This allows type checking the arguments. Explicit structure members comparisions are done to avoid introducting string.h pollution for userspace. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43205 --- sys/sys/mount.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 6cb7ea810682..dd5eaad184f6 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -50,7 +50,12 @@ typedef struct fsid { int32_t val[2]; } fsid_t; /* filesystem id type */ -#define fsidcmp(a, b) memcmp((a), (b), sizeof(fsid_t)) +/* Returns non-zero if fsids are different. */ +static inline int +fsidcmp(const fsid_t *a, const fsid_t *b) +{ + return (a->val[0] != b->val[0] || a->val[1] != b->val[1]); +} /* * File identifier.