[Ocfs2-tools-devel] [PATCH 14/18] tunefs.ocfs2: Display progress for the UUID reset operation.

Joel Becker joel.becker at oracle.com
Mon Jan 5 18:33:50 PST 2009


A simple progress display for the reset UUID operation.

Signed-off-by: Joel Becker <joel.becker at oracle.com>
---
 tunefs.ocfs2/op_reset_uuid.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tunefs.ocfs2/op_reset_uuid.c b/tunefs.ocfs2/op_reset_uuid.c
index a1acc3c..25a21fb 100644
--- a/tunefs.ocfs2/op_reset_uuid.c
+++ b/tunefs.ocfs2/op_reset_uuid.c
@@ -32,11 +32,16 @@ static errcode_t update_volume_uuid(ocfs2_filesys *fs)
 {
 	errcode_t err;
 	unsigned char new_uuid[OCFS2_VOL_UUID_LEN];
+	struct tools_progress *prog;
 
 	if (!tools_interact("Reset the volume UUID on device \"%s\"? ",
 			    fs->fs_devname))
 		return 0;
 
+	prog = tools_progress_start("Resetting UUID", "resetuuid", 1);
+	if (!prog)
+		return TUNEFS_ET_NO_MEMORY;
+
 	uuid_generate(new_uuid);
 	memcpy(OCFS2_RAW_SB(fs->fs_super)->s_uuid, new_uuid,
 	       OCFS2_VOL_UUID_LEN);
@@ -45,6 +50,8 @@ static errcode_t update_volume_uuid(ocfs2_filesys *fs)
 	err = ocfs2_write_super(fs);
 	tunefs_unblock_signals();
 
+	tools_progress_step(prog, 1);
+	tools_progress_stop(prog);
 	return err;
 }
 
-- 
1.5.6.5




More information about the Ocfs2-tools-devel mailing list