Anton Blanchard f39cdaebb8 fault-inject: avoid call to random32() if fault injection is disabled
After enabling CONFIG_FAILSLAB I noticed random32 in profiles even if slub
fault injection wasn't enabled at runtime.

should_fail forces a comparison against random32() even if probability is
0:

        if (attr->probability <= random32() % 100)
                return false;

Add a check up front for probability == 0 and avoid all of the more
complicated checks.

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-06-20 14:39:36 -07:00
..
2011-09-21 13:39:59 -07:00
2011-10-29 21:20:22 +02:00
2012-03-23 16:58:38 -07:00
2011-03-31 11:26:23 -03:00
2012-03-23 16:58:38 -07:00
2012-05-07 16:51:19 -07:00
2012-03-28 15:58:21 -07:00
2012-01-31 23:19:47 +02:00
2011-12-08 19:52:43 -05:00