summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-11 16:43:28 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-11 16:43:28 -0800
commit1eb0b69c1064c65b32014c8392e6d076c23dc57c (patch)
tree1ba174d2f08eb78ed65f569995e62d694e6a3288 /include/linux
parent8904925c10bcd5adc582bd1e4ec3d7f9e13652b2 (diff)
parentbf2efbc58504f0ab67b8f52e820a8287d0015cbc (diff)
Merge bk://gkernel.bkbits.net/libata-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