Whamcloud - gitweb
LU-6467 test: skip s-l test_9 for interop with b2_5
[fs/lustre-release.git] / lustre / tests / it_test.c
index 714828a..a31e0b3 100644 (file)
@@ -1,6 +1,4 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
  * GPL HEADER START
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,7 +24,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
@@ -45,7 +43,8 @@
 #include <time.h>
 #include <sys/time.h>
 
-#include <libcfs/libcfs.h>
+#define EXPORT_SYMBOL(s)
+
 #include <../ldlm/interval_tree.c>
 
 #define dprintf(fmt, args...) //printf(fmt, ##args)
 
 static struct it_node {
         struct interval_node node;
-        struct list_head list;
+       struct list_head list;
         int hit, valid;
 } *it_array;
 static int it_count;
-static CFS_LIST_HEAD(header);
+static struct list_head header = LIST_HEAD_INIT(header);
 static unsigned long max_count = ULONG_MAX & ALIGN_MASK;
 static int have_wide_lock = 0;
 
@@ -84,11 +83,9 @@ static enum interval_iter cb(struct interval_node *n, void *args)
         static int count = 1;
 
         if (node->hit == 1) {
-                dprintf("NODE "__S" has ever been accessed\n",
-                        __F(&n->in_extent));
+                error("A duplicate node "__S" access found\n",
+                       __F(&n->in_extent));
                 return INTERVAL_ITER_CONT;
-                error("duplicate node accessing found\n");
-                return INTERVAL_ITER_STOP;
         }
 
         if (node->valid == 0) {
@@ -381,7 +378,7 @@ static int it_test_performance(struct interval_node *root, unsigned long len)
         /* list */
         contended_count = 0;
         gettimeofday(&start, NULL);
-        list_for_each_entry(n, &header, list) {
+       list_for_each_entry(n, &header, list) {
                 if (extent_overlapped(&ext, &n->node.in_extent)) {
                         count = LOOP_COUNT;
                         while (count--);
@@ -426,7 +423,7 @@ static struct interval_node *it_test_helper(struct interval_node *root)
                                 __F(&n->node.in_extent));
                         interval_erase(&n->node, &root);
                         n->valid = 0;
-                        list_del_init(&n->list);
+                       list_del_init(&n->list);
                 } else {
                         __u64 low, high;
                         low = (random() % max_count) & ALIGN_MASK;
@@ -439,7 +436,7 @@ static struct interval_node *it_test_helper(struct interval_node *root)
                         dprintf("Adding a node "__S"\n",
                                 __F(&n->node.in_extent));
                         n->valid = 1;
-                        list_add(&n->list, &header);
+                       list_add(&n->list, &header);
                 }
         }
 
@@ -476,9 +473,9 @@ static struct interval_node *it_test_init(int count)
                 n->hit = 0;
                 n->valid = 1;
                 if (i == 0)
-                        list_add_tail(&n->list, &header);
+                       list_add_tail(&n->list, &header);
                 else
-                        list_add_tail(&n->list, &it_array[rand()%i].list);
+                       list_add_tail(&n->list, &it_array[rand()%i].list);
         }
 
         return root;