Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Nov 2023 09:27:39 -0800
From:      John Baldwin <jhb@FreeBSD.org>
To:        Emmanuel Vadot <manu@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   Re: git: 2a35f3cdf63d - main - sys/mutex.h: Include sys/lock.h instead of sys/_lock.h
Message-ID:  <79e6e3a1-96a5-4d3e-9c48-a89bcbd6303d@FreeBSD.org>
In-Reply-To: <202311240950.3AO9oSeH089169@gitrepo.freebsd.org>
References:  <202311240950.3AO9oSeH089169@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11/24/23 1:50 AM, Emmanuel Vadot wrote:
> The branch main has been updated by manu:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=2a35f3cdf63d1f9b1ea5ab0174adabb631757210
> 
> commit 2a35f3cdf63d1f9b1ea5ab0174adabb631757210
> Author:     Emmanuel Vadot <manu@FreeBSD.org>
> AuthorDate: 2022-10-27 09:43:19 +0000
> Commit:     Emmanuel Vadot <manu@FreeBSD.org>
> CommitDate: 2023-11-24 09:49:58 +0000
> 
>      sys/mutex.h: Include sys/lock.h instead of sys/_lock.h
>      
>      It uses the LA_ defines when INVARIANTS is set.
>      This unbreak dpaa2 with FDT only kernel (like ALLWINNER or ROCKCHIP) as
>      the driver only include sys/lock.h via header polution for ACPI kernels.
>      
>      Sponsored by:   Beckhoff Automation GmbH & Co. KG
>      Differential Revision:  https://reviews.freebsd.org/D37145
>      Reviewed by:    kib, mjg

Avoiding the nested include here was originally an intentional design decision.
It was supposed to be a compile error if you didn't include lock.h first, and
callers are always supposed to include both (up until now).  However, I'm fine
with changing this, but we should be consistent and change all the other lock
headers at once including sys/rwlock.h, sys/sx.h, and sys/lockmgr.h.

You will also need to patch all of these headers to remove the #error if
LOCK_DEBUG or LOCK_FILE isn't defined (including sys/mutex.h which you missed
in this commit).

You will also need to update all the relevant manpages (mutex.9, sx.9, rwlock.9,
and lockmgr.9) to remove the #include <sys/lock.h>.

For MFC purposes I would suggest to also fix dpaa2 to #include <sys/lock.h>
explicitly as it was supposed to do previously.

-- 
John Baldwin




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?79e6e3a1-96a5-4d3e-9c48-a89bcbd6303d>