mm: fixed nodemask args in set_mempolicy()

inside oom0[2|4], ksm0[2|4] cases, they are running under
numa system, and allocte memory in the second numa node,
set nodemask 2, which indicates all memory allocated in
node1, but when a numa system don't have node1, these cases
will failed, such like the box, available nodes: (0,2,4,7)

 [root@hp-magnycours-01 oom]# ./oom02
 oom02       0  TINFO  :  set overcommit_memory to 1
 oom02       0  TINFO  :  process mempolicy.
 oom02       0  TINFO  :  start normal OOM testing.
 oom02       0  TINFO  :  expected victim is 9112.
 oom02       1  TBROK  :  set_mempolicy: errno=EINVAL(22): Invalid argument
 oom02       2  TBROK  :  Remaining cases broken
 oom02       0  TINFO  :  set overcommit_memory to 0
 oom02       1  TFAIL  :  the victim unexpectedly failed: 512
 oom02       0  TINFO  :  start OOM testing for mlocked pages.
 ...

the patch fixed the above issue.

Also inside cpuset01 case, depend on the reproducer, mem hog thread
allocated memory on *all* nodes, but 'nmask += exp2f(i);' can't
do that, and the patch fixed it.

Signed-off-by: Zhouping Liu <zliu@redhat.com>
Reviewed-by: Caspar Zhang <caspar@casparzhang.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Indentation and coding style fixes on /lib/str_to_bytes.c as well as /include/str_to_bytes.h

Fixed broken identation as well as replaced the old K&R
function declarations.

Signed-off-by: Marios Makris <marios.makris@gmail.com>
Acked-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Renamed /lib/str_to_bytes.c and /include str_to bytes.h

The str_to_bytes files have been renamed to bytes_by_prefix in order
to make it easier for anyone to understand the purpose of the file,
the functions of the file have also been ranmed accordingly.

Furthermore any call to the file or its functions by other functions,
manpages etc. have been modified to comply with the new names.

Signed-off-by: Marios Makris <marios.makris@gmail.com>
Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Changed nconv variable from long to int in /lib/bytes_by_prefix.c

According to sscanf man page the return value is int
therefore the holding variable should be int as well.

Also changed the loop variable name of the main method
from ind to i in order to better represent that it is
just a loop variable.

Signed-off-by: Marios Makris <marios.makris@gmail.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
ltp-pan.c: fix error of Total Tests

When execvp() fails, the testcases is counted in Total Tests, but not
added in logfile. In fact the testcases result should be added in logfile.

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Acked-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Acked-by: Garrett Cooper <yanegomi@gmail.com>
Remove bashism in generating Version file

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
Clean up inotify(7) wrappers

As a side-effect this also fixes the return code passed back
by the wrappers as the value should be an integer, not longs
[this fixes compile errors on platforms where
sizeof(int) != sizeof(long)].

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
Merge branch 'master' into inotify-support