prune_io_piece_log() also needs to take list into account
authorJens Axboe <jens.axboe@oracle.com>
Thu, 21 Feb 2008 08:52:35 +0000 (09:52 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 21 Feb 2008 08:52:35 +0000 (09:52 +0100)
If we didn't use the rbtree but have remaining entries to prune,
loop over the list as well and free those entries.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
log.c

diff --git a/log.c b/log.c
index e7320ef82086c1d039a9ef1169d8cc744f5fc6ed..8754eb051a1ecfb3ba38290b8d88d5a6bb547c8a 100644 (file)
--- a/log.c
+++ b/log.c
@@ -108,6 +108,12 @@ void prune_io_piece_log(struct thread_data *td)
                rb_erase(n, &td->io_hist_tree);
                free(ipo);
        }
                rb_erase(n, &td->io_hist_tree);
                free(ipo);
        }
+
+       while (!list_empty(&td->io_hist_list)) {
+               ipo = list_entry(td->io_hist_list.next, struct io_piece, list);
+               list_del(&ipo->list);
+               free(ipo);
+       }
 }
 
 /*
 }
 
 /*