X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fobdclass%2Finterval_tree.c;h=6007d37f61b5dbe46533ec06cb9e76e8395c1b5d;hp=1a9d897d0ea7d975792a9ad03cfa8567e6eff188;hb=HEAD;hpb=35679a730bf0b7a8d4ce84cadc3ecc7c289ef491 diff --git a/lustre/obdclass/interval_tree.c b/lustre/obdclass/interval_tree.c index 1a9d897..6007d37f 100644 --- a/lustre/obdclass/interval_tree.c +++ b/lustre/obdclass/interval_tree.c @@ -27,7 +27,6 @@ */ /* * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. * * lustre/ldlm/interval_tree.c * @@ -111,16 +110,6 @@ int node_equal(struct interval_node *n1, struct interval_node *n2) return extent_equal(&n1->in_extent, &n2->in_extent); } -static inline __u64 max_u64(__u64 x, __u64 y) -{ - return x > y ? x : y; -} - -static inline __u64 min_u64(__u64 x, __u64 y) -{ - return x < y ? x : y; -} - #define interval_for_each(node, root) \ for (node = interval_first(root); node != NULL; \ node = interval_next(node)) @@ -251,8 +240,8 @@ static void __rotate_change_maxhigh(struct interval_node *node, rotate->in_max_high = node->in_max_high; left_max = node->in_left ? node->in_left->in_max_high : 0; right_max = node->in_right ? node->in_right->in_max_high : 0; - node->in_max_high = max_u64(interval_high(node), - max_u64(left_max, right_max)); + node->in_max_high = max3(interval_high(node), + left_max, right_max); } /* The left rotation "pivots" around the link from node to node->right, and @@ -520,8 +509,8 @@ static void update_maxhigh(struct interval_node *node, while (node) { left_max = node->in_left ? node->in_left->in_max_high : 0; right_max = node->in_right ? node->in_right->in_max_high : 0; - node->in_max_high = max_u64(interval_high(node), - max_u64(left_max, right_max)); + node->in_max_high = max3(interval_high(node), + left_max, right_max); if (node->in_max_high >= old_maxhigh) break; @@ -720,7 +709,7 @@ EXPORT_SYMBOL(interval_is_overlapped); * if (root == NULL) * return res; * if (root->in_max_high < low) { - * res = max_u64(root->in_max_high + 1, res); + * res = max(root->in_max_high + 1, res); * return res; * } else if (low < interval_low(root)) { * interval_expand_low(root->in_left, low); @@ -728,7 +717,7 @@ EXPORT_SYMBOL(interval_is_overlapped); * } * * if (interval_high(root) < low) - * res = max_u64(interval_high(root) + 1, res); + * res = max(interval_high(root) + 1, res); * interval_expand_low(root->in_left, low); * interval_expand_low(root->in_right, low); *