[Ocfs2-tools-devel] [PATCH 11/18] tunefs.ocfs2: Progress display for cloning a volume.
Joel Becker
joel.becker at oracle.com
Mon Jan 5 18:33:47 PST 2009
The clone-volume operation displays its progress.
Signed-off-by: Joel Becker <joel.becker at oracle.com>
---
tunefs.ocfs2/op_cloned_volume.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/tunefs.ocfs2/op_cloned_volume.c b/tunefs.ocfs2/op_cloned_volume.c
index 09e501f..03a1dd7 100644
--- a/tunefs.ocfs2/op_cloned_volume.c
+++ b/tunefs.ocfs2/op_cloned_volume.c
@@ -95,6 +95,7 @@ static void update_volume_uuid(ocfs2_filesys *fs)
static errcode_t cloned_volume(ocfs2_filesys *fs, const char *new_label)
{
errcode_t err;
+ struct tools_progress *prog;
if (!tools_interact_critical(
"Updating the UUID and label on cloned volume \"%s\".\n"
@@ -106,13 +107,27 @@ static errcode_t cloned_volume(ocfs2_filesys *fs, const char *new_label)
fs->fs_devname))
return 0;
+ prog = tools_progress_start("Cloning volume", "cloning", 3);
+ if (!prog) {
+ err = TUNEFS_ET_NO_MEMORY;
+ tcom_err(err, "while initializing the progress display");
+ goto out;
+ }
+
update_volume_uuid(fs);
+ tools_progress_step(prog, 1);
+
update_volume_label(fs, new_label);
+ tools_progress_step(prog, 1);
tunefs_block_signals();
err = ocfs2_write_super(fs);
tunefs_unblock_signals();
+ tools_progress_step(prog, 1);
+
+ tools_progress_stop(prog);
+out:
return err;
}
--
1.5.6.5
More information about the Ocfs2-tools-devel
mailing list