[Ocfs2-tools-devel] [PATCH 14/18] tunefs.ocfs2: Display progress for the UUID reset operation.
Mark Fasheh
mfasheh at suse.com
Wed Jan 14 14:54:39 PST 2009
Signed-off-by: Mark Fasheh <mfasheh at suse.com>
On Mon, Jan 05, 2009 at 06:33:50PM -0800, Joel Becker wrote:
> 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
--
Mark Fasheh
More information about the Ocfs2-tools-devel
mailing list