From nobody Mon Aug 12 23:05:29 2024 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 4WjVVL09MXz5TMvm; Mon, 12 Aug 2024 23:05:30 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WjVVK6ms5z4fgT; Mon, 12 Aug 2024 23:05:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723503930; 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=MgvnBMiwBBenR8nAOulXaHbEJh2sWXO4ocxGRi27hx0=; b=Jz8YP6rJgsIc9Nwwp6jx9WYSSihoelcC8ex0Juh1DrZdbm2Gft8VupppuKYI0hLjOHel/N YLgzNCJ19ldV/79aW2wgxmQLd0bDV/AIVhA6D1O6kVvdbQ4zMynDIg7vAAvrJIUf8kcvNp +EOAQosLRshyt3X4axU5luv5re5mUpe3Bpxo42/7jmISqHhnF6LMCB4wGkAzuIOHqoDFG6 hrr1JrvI/Sh3y8Aaz2eq9aX6Msq/6MTMnbcQ61CxT0aV36kaRKnnirZvmqVl9C+3U4fQpz jOU76ALWiRUJ39WBSxULYVPBhfNk/T7otd0hWRP6Whib5gnEwMy/bSNuXLT2OQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723503929; a=rsa-sha256; cv=none; b=b1Ia/L7lqeSRLv+T7+/ZJB48Y7ffesjae62kCWBqdTNqFkILVJtkaFFt9j74hwWjtN5xhW OZcxLgt6ClcROYtLoHpNetsjm7M4GlyEZ+MCR3lvnOpKdvpYXcTOIri9xIPv3ekuZX3djK WDjBctOSnWk880A7cufW5i2wbfYzU2680G9ETOp2wRKnlG94MeE/OBeh6giM+n7vRwr48N U9oYH4YLGnR4c+pIBOr5GMRqRzmk3IllZgVpExVs5CxZPA/jNR2KIDEPYwpC6v47geW1zj PApHvLQHLzEnpmxRvhTHWHXipgAHDq5+YPNKHsp/TM0C3CWboG9Ou8snyFf0+w== 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=1723503929; 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=MgvnBMiwBBenR8nAOulXaHbEJh2sWXO4ocxGRi27hx0=; b=k43TALnreMptDW+02i9mZSndkReHS/sOmTSemX8Wp5FVLkqHUtaREGlmF8WLFz/su1iY57 n3fdzRdInMRYio2rjYQAaN4ufiFK5VUSrrRtw2a1reTSRbfbofpjQY9iwH+4glWwFt8/u/ Bp0xzEjhqKJC/6CDuiMWiqu10DusbOIeRytdZi7xZj9wO2kM7IP5+5Ibhf6YTkXhvgiknC MH2PvKWdOvnbWPryWTsgq+DI1Ls2UkXhs61R/WD2ObdRb5h0Zw9hMrJiKg0d/6j0o56Az8 i8Kwvb/ootIb9DyXYESGsCy0YjHPm6FDdONXW0/Vg9rb6S2+6ySTFMQ8VShM+w== 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 4WjVVK6G1ZzmT2; Mon, 12 Aug 2024 23:05:29 +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 47CN5TQ7072034; Mon, 12 Aug 2024 23:05:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47CN5T2D072031; Mon, 12 Aug 2024 23:05:29 GMT (envelope-from git) Date: Mon, 12 Aug 2024 23:05:29 GMT Message-Id: <202408122305.47CN5T2D072031@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: 0a8e5aaa97da - main - socket: Add macros to assert that the caller holds a socket I/O lock 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a8e5aaa97dad579b5489b11a4729da354c0bd74 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0a8e5aaa97dad579b5489b11a4729da354c0bd74 commit 0a8e5aaa97dad579b5489b11a4729da354c0bd74 Author: Mark Johnston AuthorDate: 2024-07-22 23:01:53 +0000 Commit: Mark Johnston CommitDate: 2024-08-12 22:53:26 +0000 socket: Add macros to assert that the caller holds a socket I/O lock Remove some unused macros while here. No functional change intended. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Stormshield --- sys/sys/socketvar.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 15d770721361..2d050707606d 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -310,12 +310,14 @@ soeventmtx(struct socket *so, const sb_which which) soiolock((so), &(so)->so_snd_sx, (flags)) #define SOCK_IO_SEND_UNLOCK(so) \ soiounlock(&(so)->so_snd_sx) -#define SOCK_IO_SEND_OWNED(so) sx_xlocked(&(so)->so_snd_sx) +#define SOCK_IO_SEND_ASSERT_LOCKED(so) \ + sx_assert(&(so)->so_snd_sx, SA_LOCKED) #define SOCK_IO_RECV_LOCK(so, flags) \ soiolock((so), &(so)->so_rcv_sx, (flags)) #define SOCK_IO_RECV_UNLOCK(so) \ soiounlock(&(so)->so_rcv_sx) -#define SOCK_IO_RECV_OWNED(so) sx_xlocked(&(so)->so_rcv_sx) +#define SOCK_IO_RECV_ASSERT_LOCKED(so) \ + sx_assert(&(so)->so_rcv_sx, SA_LOCKED) /* do we have to send all at once on a socket? */ #define sosendallatonce(so) \