aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/lib.h
diff options
context:
space:
mode:
authorKeir Fraser <keir@xen.org>2011-05-09 09:25:23 +0100
committerKeir Fraser <keir@xen.org>2011-05-09 09:25:23 +0100
commit8dc6738dbb3c6117fb7e30617609f6d41e19d3b4 (patch)
treea59eea5fb0832e92f0c51c06807821db76a252a4 /xen/include/xen/lib.h
parent31915b333f5413d3be1f9f90aace5bf8b3cedab0 (diff)
downloadxen-8dc6738dbb3c6117fb7e30617609f6d41e19d3b4.tar.gz
xen-8dc6738dbb3c6117fb7e30617609f6d41e19d3b4.tar.bz2
xen-8dc6738dbb3c6117fb7e30617609f6d41e19d3b4.zip
Update radix-tree.[ch] from upstream Linux to gain RCU awareness.
We still leave behind features we don't need such as tagged nodes. Other changes: - Allow callers to define their own node alloc routines. - Only allocate per-node rcu_head when using the default RCU-safe alloc routines. - Keep our own radix_tree_destroy(). In future it may also be worth getting rid of the complex and pointless special-casing of radix-tree height==0, in which a single data item can be stored directly in radix_tree_root. It introduces a whole lot of special cases and complicates RCU handling. If we get rid of it we can reclaim the 'indirect pointer' tag in bit 0 of every slot entry. Signed-off-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/include/xen/lib.h')
-rw-r--r--xen/include/xen/lib.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 65e4fb8bdc..0102b8ab70 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -48,7 +48,8 @@ do { \
#define SWAP(_a, _b) \
do { typeof(_a) _t = (_a); (_a) = (_b); (_b) = _t; } while ( 0 )
-#define DIV_ROUND(x, y) (((x) + (y) / 2) / (y))
+#define DIV_ROUND(n, d) (((n) + (d) / 2) / (d))
+#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]) + __must_be_array(x))