Re: git: 67e628b7a643 - main - kref: replace hand-rolled atomic ops with refcount API

From: Gleb Smirnoff <glebius_at_freebsd.org>
Date: Wed, 14 Dec 2022 00:37:41 UTC
On Tue, Dec 13, 2022 at 09:25:23AM +0000, Mateusz Guzik wrote:
M> The branch main has been updated by mjg:
M> 
M> URL: https://cgit.FreeBSD.org/src/commit/?id=67e628b7a6432c1ab296b0c936dffc42df357d82
M> 
M> commit 67e628b7a6432c1ab296b0c936dffc42df357d82
M> Author:     Mateusz Guzik <mjg@FreeBSD.org>
M> AuthorDate: 2022-12-05 17:38:45 +0000
M> Commit:     Mateusz Guzik <mjg@FreeBSD.org>
M> CommitDate: 2022-12-13 09:24:57 +0000
M> 
M>     kref: replace hand-rolled atomic ops with refcount API
M>     
M>     Sponsored by:   Rubicon Communications, LLC ("Netgate")
M>     Differential Revision:  https://reviews.freebsd.org/D37608
M> ---
M>  sys/compat/linuxkpi/common/include/linux/kref.h | 22 +++++++++++-----------
M>  1 file changed, 11 insertions(+), 11 deletions(-)
M> 
M> diff --git a/sys/compat/linuxkpi/common/include/linux/kref.h b/sys/compat/linuxkpi/common/include/linux/kref.h
M> index 3b5645bf139b..9a6814175223 100644
M> --- a/sys/compat/linuxkpi/common/include/linux/kref.h
M> +++ b/sys/compat/linuxkpi/common/include/linux/kref.h
M> @@ -44,35 +44,35 @@
M>  
M>  struct kref {
M>  	/* XXX In Linux this is a refcount_t */
M> -	atomic_t refcount;
M> +	volatile u_int32_t refcount;
M>  };

A nitpick: use standard uint32_t instead of BSD u_int32_t in new code.

-- 
Gleb Smirnoff