xarray.c 549 B

123456789101112131415161718192021222324252627282930
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * xarray.c: Userspace shim for XArray test-suite
  4. * Copyright (c) 2018 Matthew Wilcox <willy@infradead.org>
  5. */
  6. #include "xarray-shared.h"
  7. #include "test.h"
  8. #undef XA_DEBUG
  9. #include "../../../lib/test_xarray.c"
  10. void xarray_tests(void)
  11. {
  12. xarray_checks();
  13. xarray_exit();
  14. }
  15. int __weak main(void)
  16. {
  17. rcu_register_thread();
  18. radix_tree_init();
  19. xarray_tests();
  20. radix_tree_cpu_dead(1);
  21. rcu_barrier();
  22. if (nr_allocated)
  23. printf("nr_allocated = %d\n", nr_allocated);
  24. rcu_unregister_thread();
  25. return 0;
  26. }