[Ocfs2-tools-devel] [patch 2/8] adds some output information in command "stats" for slot remove, take 2

Mark Fasheh mark.fasheh at oracle.com
Mon Jun 18 17:02:57 PDT 2007


On Fri, Jun 15, 2007 at 04:15:38PM +0800, tao.ma at oracle.com wrote:
> Index: new.ocfs2-tools/debugfs.ocfs2/utils.c
> ===================================================================
> --- new.ocfs2-tools.orig/debugfs.ocfs2/utils.c	2007-06-14 14:58:50.000000000 -0400
> +++ new.ocfs2-tools/debugfs.ocfs2/utils.c	2007-06-14 15:00:12.000000000 -0400
> @@ -42,10 +42,15 @@ void get_incompat_flag(uint32_t flag, GS
>  	if (flag & OCFS2_FEATURE_INCOMPAT_SPARSE_ALLOC)
>  		g_string_append(str, "Sparse ");
>  
> +	if (flag & OCFS2_FEATURE_INCOMPAT_TUNEFS_INPROG) {
> +		g_string_append(str, "AbortedTunefs");

I think you want a space at the end of that string otherwise the users output
may get garbled.


>  	if (flag & ~(OCFS2_FEATURE_INCOMPAT_HEARTBEAT_DEV |
>  		     OCFS2_FEATURE_INCOMPAT_RESIZE_INPROG |
>  		     OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT |
> -		     OCFS2_FEATURE_INCOMPAT_SPARSE_ALLOC))
> +		     OCFS2_FEATURE_INCOMPAT_SPARSE_ALLOC |
> +		     OCFS2_FEATURE_INCOMPAT_TUNEFS_INPROG))
>  		g_string_append(str, "Unknown ");
>  
>  	if (!str->len)
> @@ -54,6 +59,19 @@ void get_incompat_flag(uint32_t flag, GS
>  	return;
>  }
>  
> +void get_tunefs_flag(uint32_t incompat_flag, uint16_t flag, GString *str)
> +{
> +	if (!(incompat_flag & OCFS2_FEATURE_INCOMPAT_TUNEFS_INPROG)) {
> +		g_string_append(str, "None");
> +		return;
> +	}
> +
> +	if (flag & OCFS2_TUNEFS_INPROG_REMOVE_SLOT)
> +		g_string_append(str, "RemoveSlot");

Also missing a space at end of string which you don't really need until you
fix the next problem:

This function doesn't print "Uknown" like the rest of the get_*compat_flag()
functions do.
	--Mark

--
Mark Fasheh
Senior Software Developer, Oracle
mark.fasheh at oracle.com



More information about the Ocfs2-tools-devel mailing list