diff options
author | Andrew Morton <akpm@osdl.org> | 2004-06-23 18:50:40 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-06-23 18:50:40 -0700 |
commit | ea0c19290646e6bb7cd3657db83eac3a0d641418 (patch) | |
tree | 78b737a8804f8c771423adcb5f4bbbc53d1a8fcc /mm | |
parent | d2cec97bc421d6f9c2ee0d9bd8e0ce47d0022cac (diff) | |
download | history-ea0c19290646e6bb7cd3657db83eac3a0d641418.tar.gz |
[PATCH] cpumask: bitmap cleanup preparation for cpumask overhaul
From: Paul Jackson <pj@sgi.com>
Document the bitmap bit model and handling of unused bits.
Tighten up bitmap so it does not generate nonzero bits in the unused tail if
it is not given any on input.
Add intersects, subset, xor and andnot operators. Change bitmap_complement to
take two operands.
Add a couple of missing 'const' qualifiers on bitops test_bit and bitmap_equal
args.
Signed-off-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mempolicy.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 4f1fc840550a72..d06eabbf74f0b0 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -93,14 +93,12 @@ static struct mempolicy default_policy = { /* Check if all specified nodes are online */ static int nodes_online(unsigned long *nodes) { - DECLARE_BITMAP(offline, MAX_NUMNODES); - - bitmap_copy(offline, node_online_map, MAX_NUMNODES); - if (bitmap_empty(offline, MAX_NUMNODES)) - set_bit(0, offline); - bitmap_complement(offline, MAX_NUMNODES); - bitmap_and(offline, offline, nodes, MAX_NUMNODES); - if (!bitmap_empty(offline, MAX_NUMNODES)) + DECLARE_BITMAP(online2, MAX_NUMNODES); + + bitmap_copy(online2, node_online_map, MAX_NUMNODES); + if (bitmap_empty(online2, MAX_NUMNODES)) + set_bit(0, online2); + if (!bitmap_subset(nodes, online2, MAX_NUMNODES)) return -EINVAL; return 0; } |