[PATCH] nodemask: add nodes_copy()
From: Yury Norov
Date: Thu Feb 13 2025 - 11:21:08 EST
Nodemasks API misses the plain nodes_copy() which is required in this series.
Signed-off-by: Yury Norov [NVIDIA] <yury.norov@xxxxxxxxx>
---
include/linux/nodemask.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index 9fd7a0ce9c1a..41cf43c4e70f 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -191,6 +191,13 @@ static __always_inline void __nodes_andnot(nodemask_t *dstp, const nodemask_t *s
bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
}
+#define nodes_copy(dst, src) __nodes_copy(&(dst), &(src), MAX_NUMNODES)
+static __always_inline void __nodes_copy(nodemask_t *dstp,
+ const nodemask_t *srcp, unsigned int nbits)
+{
+ bitmap_copy(dstp->bits, srcp->bits, nbits);
+}
+
#define nodes_complement(dst, src) \
__nodes_complement(&(dst), &(src), MAX_NUMNODES)
static __always_inline void __nodes_complement(nodemask_t *dstp,
--
2.43.0