diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-14 20:25:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-14 20:25:18 -0500 |
commit | a57cb1c1d7974c62a5c80f7869e35b492ace12cd (patch) | |
tree | 5a42ee9a668f171143464bc86013954c1bbe94ad /tools/testing/radix-tree/linux/kernel.h | |
parent | cf1b3341afab9d3ad02a76b3a619ea027dcf4e28 (diff) | |
parent | e1e14ab8411df344a17687821f8f78f0a1e73cbb (diff) |
Merge branch 'akpm' (patches from Andrew)
Merge more updates from Andrew Morton:
- a few misc things
- kexec updates
- DMA-mapping updates to better support networking DMA operations
- IPC updates
- various MM changes to improve DAX fault handling
- lots of radix-tree changes, mainly to the test suite. All leading up
to reimplementing the IDA/IDR code to be a wrapper layer over the
radix-tree. However the final trigger-pulling patch is held off for
4.11.
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (114 commits)
radix tree test suite: delete unused rcupdate.c
radix tree test suite: add new tag check
radix-tree: ensure counts are initialised
radix tree test suite: cache recently freed objects
radix tree test suite: add some more functionality
idr: reduce the number of bits per level from 8 to 6
rxrpc: abstract away knowledge of IDR internals
tpm: use idr_find(), not idr_find_slowpath()
idr: add ida_is_empty
radix tree test suite: check multiorder iteration
radix-tree: fix replacement for multiorder entries
radix-tree: add radix_tree_split_preload()
radix-tree: add radix_tree_split
radix-tree: add radix_tree_join
radix-tree: delete radix_tree_range_tag_if_tagged()
radix-tree: delete radix_tree_locate_item()
radix-tree: improve multiorder iterators
btrfs: fix race in btrfs_free_dummy_fs_info()
radix-tree: improve dump output
radix-tree: make radix_tree_find_next_bit more useful
...
Diffstat (limited to 'tools/testing/radix-tree/linux/kernel.h')
-rw-r--r-- | tools/testing/radix-tree/linux/kernel.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/testing/radix-tree/linux/kernel.h b/tools/testing/radix-tree/linux/kernel.h index be98a47b4e1b..9b43b4975d83 100644 --- a/tools/testing/radix-tree/linux/kernel.h +++ b/tools/testing/radix-tree/linux/kernel.h | |||
@@ -8,9 +8,14 @@ | |||
8 | #include <limits.h> | 8 | #include <limits.h> |
9 | 9 | ||
10 | #include "../../include/linux/compiler.h" | 10 | #include "../../include/linux/compiler.h" |
11 | #include "../../include/linux/err.h" | ||
11 | #include "../../../include/linux/kconfig.h" | 12 | #include "../../../include/linux/kconfig.h" |
12 | 13 | ||
14 | #ifdef BENCHMARK | ||
15 | #define RADIX_TREE_MAP_SHIFT 6 | ||
16 | #else | ||
13 | #define RADIX_TREE_MAP_SHIFT 3 | 17 | #define RADIX_TREE_MAP_SHIFT 3 |
18 | #endif | ||
14 | 19 | ||
15 | #ifndef NULL | 20 | #ifndef NULL |
16 | #define NULL 0 | 21 | #define NULL 0 |
@@ -43,4 +48,17 @@ static inline int in_interrupt(void) | |||
43 | { | 48 | { |
44 | return 0; | 49 | return 0; |
45 | } | 50 | } |
51 | |||
52 | /* | ||
53 | * This looks more complex than it should be. But we need to | ||
54 | * get the type for the ~ right in round_down (it needs to be | ||
55 | * as wide as the result!), and we want to evaluate the macro | ||
56 | * arguments just once each. | ||
57 | */ | ||
58 | #define __round_mask(x, y) ((__typeof__(x))((y)-1)) | ||
59 | #define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) | ||
60 | #define round_down(x, y) ((x) & ~__round_mask(x, y)) | ||
61 | |||
62 | #define xchg(ptr, x) uatomic_xchg(ptr, x) | ||
63 | |||
46 | #endif /* _KERNEL_H */ | 64 | #endif /* _KERNEL_H */ |