mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
test_ida: Move ida_check_leaf
Convert to new API and move to kernel space. Take the opportunity to test the situation a little more thoroughly (ie at different offsets). Signed-off-by: Matthew Wilcox <[email protected]>
This commit is contained in:
parent
06b0111366
commit
0a3856392c
2 changed files with 25 additions and 27 deletions
|
|
@ -336,32 +336,6 @@ void ida_check_nomem(void)
|
|||
IDA_BUG_ON(&ida, !ida_is_empty(&ida));
|
||||
}
|
||||
|
||||
/*
|
||||
* Check what happens when we fill a leaf and then delete it. This may
|
||||
* discover mishandling of IDR_FREE.
|
||||
*/
|
||||
void ida_check_leaf(void)
|
||||
{
|
||||
DEFINE_IDA(ida);
|
||||
int id;
|
||||
unsigned long i;
|
||||
|
||||
for (i = 0; i < IDA_BITMAP_BITS; i++) {
|
||||
assert(ida_pre_get(&ida, GFP_KERNEL));
|
||||
assert(!ida_get_new(&ida, &id));
|
||||
assert(id == i);
|
||||
}
|
||||
|
||||
ida_destroy(&ida);
|
||||
assert(ida_is_empty(&ida));
|
||||
|
||||
assert(ida_pre_get(&ida, GFP_KERNEL));
|
||||
assert(!ida_get_new(&ida, &id));
|
||||
assert(id == 0);
|
||||
ida_destroy(&ida);
|
||||
assert(ida_is_empty(&ida));
|
||||
}
|
||||
|
||||
/*
|
||||
* Check handling of conversions between exceptional entries and full bitmaps.
|
||||
*/
|
||||
|
|
@ -560,7 +534,6 @@ void user_ida_checks(void)
|
|||
ida_destroy(&ida);
|
||||
assert(ida_is_empty(&ida));
|
||||
|
||||
ida_check_leaf();
|
||||
ida_check_max();
|
||||
ida_check_conv();
|
||||
ida_check_random();
|
||||
|
|
|
|||
Loading…
Reference in a new issue