mempolicy.c (c5580a7ecb859c6821dd761c95fa150ec7695ae1) mempolicy.c (a9c930bac163c5e616ca0ba9378e7dc746c93227)
1/*
2 * Simple NUMA memory policy for the Linux kernel.
3 *
4 * Copyright 2003,2004 Andi Kleen, SuSE Labs.
5 * (C) Copyright 2005 Christoph Lameter, Silicon Graphics, Inc.
6 * Subject to the GNU Public License, version 2.
7 *
8 * NUMA policy allows the user to give hints in which node(s) memory should

--- 794 unchanged lines hidden (view full) ---

803 unsigned long k;
804 unsigned long nlongs;
805 unsigned long endmask;
806
807 --maxnode;
808 nodes_clear(*nodes);
809 if (maxnode == 0 || !nmask)
810 return 0;
1/*
2 * Simple NUMA memory policy for the Linux kernel.
3 *
4 * Copyright 2003,2004 Andi Kleen, SuSE Labs.
5 * (C) Copyright 2005 Christoph Lameter, Silicon Graphics, Inc.
6 * Subject to the GNU Public License, version 2.
7 *
8 * NUMA policy allows the user to give hints in which node(s) memory should

--- 794 unchanged lines hidden (view full) ---

803 unsigned long k;
804 unsigned long nlongs;
805 unsigned long endmask;
806
807 --maxnode;
808 nodes_clear(*nodes);
809 if (maxnode == 0 || !nmask)
810 return 0;
811 if (maxnode > PAGE_SIZE)
811 if (maxnode > PAGE_SIZE*BITS_PER_BYTE)
812 return -EINVAL;
813
814 nlongs = BITS_TO_LONGS(maxnode);
815 if ((maxnode % BITS_PER_LONG) == 0)
816 endmask = ~0UL;
817 else
818 endmask = (1UL << (maxnode % BITS_PER_LONG)) - 1;
819

--- 988 unchanged lines hidden ---
812 return -EINVAL;
813
814 nlongs = BITS_TO_LONGS(maxnode);
815 if ((maxnode % BITS_PER_LONG) == 0)
816 endmask = ~0UL;
817 else
818 endmask = (1UL << (maxnode % BITS_PER_LONG)) - 1;
819

--- 988 unchanged lines hidden ---