[PATCH] blktrace: remove check_time, we always need to check it
authorJens Axboe <axboe@suse.de>
Thu, 2 Feb 2006 10:16:05 +0000 (11:16 +0100)
committerJens Axboe <axboe@suse.de>
Thu, 2 Feb 2006 10:16:05 +0000 (11:16 +0100)
blkparse.c

index 4a14f3276d6acfd5bc64562b15171bf57b029e12..578353c7fb5325e0a8b27ecd4c196138a2853fa7 100644 (file)
@@ -465,8 +465,7 @@ static struct per_process_info *find_process(__u32 pid, char *name)
        return ppi;
 }
 
-static inline int trace_rb_insert(struct trace *t, struct rb_root *root,
-                                 int check_time)
+static inline int trace_rb_insert(struct trace *t, struct rb_root *root)
 {
        struct rb_node **p = &root->rb_node;
        struct rb_node *parent = NULL;
@@ -477,16 +476,11 @@ static inline int trace_rb_insert(struct trace *t, struct rb_root *root,
 
                __t = rb_entry(parent, struct trace, rb_node);
 
-               if (check_time) {
-                       if (t->bit->time < __t->bit->time) {
-                               p = &(*p)->rb_left;
-                               continue;
-                       } else if (t->bit->time > __t->bit->time) {
-                               p = &(*p)->rb_right;
-                               continue;
-                       }
-               }
-               if (t->bit->device < __t->bit->device)
+               if (t->bit->time < __t->bit->time)
+                       p = &(*p)->rb_left;
+               else if (t->bit->time > __t->bit->time)
+                       p = &(*p)->rb_right;
+               else if (t->bit->device < __t->bit->device)
                        p = &(*p)->rb_left;
                else if (t->bit->device > __t->bit->device)
                        p = &(*p)->rb_right;
@@ -503,7 +497,7 @@ static inline int trace_rb_insert(struct trace *t, struct rb_root *root,
 
 static inline int trace_rb_insert_sort(struct trace *t)
 {
-       if (!trace_rb_insert(t, &rb_sort_root, 1)) {
+       if (!trace_rb_insert(t, &rb_sort_root)) {
                rb_sort_entries++;
                return 0;
        }
@@ -513,7 +507,7 @@ static inline int trace_rb_insert_sort(struct trace *t)
 
 static inline int trace_rb_insert_last(struct per_dev_info *pdi,struct trace *t)
 {
-       if (!trace_rb_insert(t, &pdi->rb_last, 1)) {
+       if (!trace_rb_insert(t, &pdi->rb_last)) {
                pdi->rb_last_entries++;
                return 0;
        }