test_maps.h 570 B

123456789101112131415161718192021222324
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _TEST_MAPS_H
  3. #define _TEST_MAPS_H
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <stdbool.h>
  7. #define CHECK(condition, tag, format...) ({ \
  8. int __ret = !!(condition); \
  9. if (__ret) { \
  10. printf("%s(%d):FAIL:%s ", __func__, __LINE__, tag); \
  11. printf(format); \
  12. exit(-1); \
  13. } \
  14. })
  15. extern int skips;
  16. typedef bool (*retry_for_error_fn)(int err);
  17. int map_update_retriable(int map_fd, const void *key, const void *value, int flags, int attempts,
  18. retry_for_error_fn need_retry);
  19. #endif