[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a9bacf04c1b0b77a95ffed4e6fe0b2f6e72cb14b.1740159866.git.jan.kiszka@siemens.com>
Date: Fri, 21 Feb 2025 18:44:25 +0100
From: Jan Kiszka <jan.kiszka@...mens.com>
To: "Luis Claudio R . Goncalves" <lgoncalv@...hat.com>,
stable-rt@...r.kernel.org,
Pavel Machek <pavel@...x.de>
Cc: linux-kernel@...r.kernel.org,
linux-rt-users <linux-rt-users@...r.kernel.org>,
Clark Williams <williams@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>,
Joseph Salisbury <joseph.salisbury@...cle.com>,
Florian Bezdeka <florian.bezdeka@...mens.com>,
Felix Moessbauer <felix.moessbauer@...mens.com>,
Andreas Ziegler <ziegler.andreas@...mens.com>
Subject: [5.10-rt][PATCH 1/2] u64_stats: Introduce u64_stats_set()
From: Ahmed S. Darwish <a.darwish@...utronix.de>
[ Upstream commit f2efdb17928924c9c935c136dea764a081032006 ]
Allow to directly set a u64_stats_t value which is used to provide an init
function which sets it directly to zero intead of memset() the value.
Add u64_stats_set() to the u64_stats API.
[bigeasy: commit message. ]
Signed-off-by: Ahmed S. Darwish <a.darwish@...utronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Signed-off-by: David S. Miller <davem@...emloft.net>
Signed-off-by: Jan Kiszka <jan.kiszka@...mens.com>
---
include/linux/u64_stats_sync.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h
index f23192d555285..af6fc08d2fcac 100644
--- a/include/linux/u64_stats_sync.h
+++ b/include/linux/u64_stats_sync.h
@@ -83,6 +83,11 @@ static inline u64 u64_stats_read(const u64_stats_t *p)
return local64_read(&p->v);
}
+static inline void u64_stats_set(u64_stats_t *p, u64 val)
+{
+ local64_set(&p->v, val);
+}
+
static inline void u64_stats_add(u64_stats_t *p, unsigned long val)
{
local64_add(val, &p->v);
@@ -104,6 +109,11 @@ static inline u64 u64_stats_read(const u64_stats_t *p)
return p->v;
}
+static inline void u64_stats_set(u64_stats_t *p, u64 val)
+{
+ p->v = val;
+}
+
static inline void u64_stats_add(u64_stats_t *p, unsigned long val)
{
p->v += val;
--
2.43.0
Powered by blists - more mailing lists