summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-11 16:47:05 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-11 16:47:05 -0800
commit306950a37ac879d4f51f46130e4dbb0668ffff46 (patch)
tree1e331dc764f9048d6eb4dcb7c91292ca263e1afe /include/linux
parent594315ad7d0a3e87c81ad2c839ae15588db85d54 (diff)
parent1eb0b69c1064c65b32014c8392e6d076c23dc57c (diff)
Merge bk://gkernel.bkbits.net/net-drivers-2.6
into ppc970.osdl.org:/home/torvalds/v2.6/linux
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nodemask.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index 4de843d94147..16475a23efa7 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -38,6 +38,8 @@
*
* int first_node(mask) Number lowest set bit, or MAX_NUMNODES
* int next_node(node, mask) Next node past 'node', or MAX_NUMNODES
+ * int first_unset_node(mask) First node not set in mask, or
+ * MAX_NUMNODES.
*
* nodemask_t nodemask_of_node(node) Return nodemask with bit 'node' set
* NODE_MASK_ALL Initializer - all bits set
@@ -235,6 +237,13 @@ static inline int __next_node(int n, const nodemask_t *srcp, int nbits)
m; \
})
+#define first_unset_node(mask) __first_unset_node(&(mask))
+static inline int __first_unset_node(const nodemask_t *maskp)
+{
+ return min_t(int,MAX_NUMNODES,
+ find_first_zero_bit(maskp->bits, MAX_NUMNODES));
+}
+
#define NODE_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(MAX_NUMNODES)
#if MAX_NUMNODES <= BITS_PER_LONG