From 7633c5d7ae81b2b803ace3a9347f0fe510fa60ff Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Fri, 4 Sep 2015 10:36:39 +0100 Subject: [PATCH] [thin_show_dups] get the progress bar working again --- thin-provisioning/thin_show_duplicates.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/thin-provisioning/thin_show_duplicates.cc b/thin-provisioning/thin_show_duplicates.cc index dafcd34..9fc96c2 100644 --- a/thin-provisioning/thin_show_duplicates.cc +++ b/thin-provisioning/thin_show_duplicates.cc @@ -224,6 +224,7 @@ namespace { block_address block_size = *fs.block_size; block_address nr_blocks = get_nr_blocks(fs.data_dev, *fs.block_size); + block_address dev_size = nr_blocks * *fs.block_size; cerr << "path = " << fs.data_dev << "\n"; cerr << "nr_blocks = " << nr_blocks << "\n"; @@ -239,7 +240,8 @@ namespace { chunk const &c = stream.get(); detector.examine(c); stream.put(c); -// pbar->update_percent((stream.index() * 100) / stream.nr_chunks()); + + pbar->update_percent((c.offset_ * 100) / dev_size); } while (stream.next()); pbar->update_percent(100);