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