Whamcloud - gitweb
LU-17705 ptlrpc: replace synchronize_rcu() with rcu_barrier()
[fs/lustre-release.git] / lustre / obdclass / interval_tree.c
index 1a9d897..6007d37 100644 (file)
@@ -27,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ldlm/interval_tree.c
  *
  *
  * 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);
 }
 
        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))
 #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;
        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
 }
 
 /* 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;
        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;
 
                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) {
  *        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);
  *                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)
  *        }
  *
  *        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);
  *
  *        interval_expand_low(root->in_left, low);
  *        interval_expand_low(root->in_right, low);
  *