[Ocfs2-tools-devel] [PATCH 1/1] ocfs2-tools: add pwd command support for debugfs.ocfs2

Tao Ma tao.ma at oracle.com
Mon Apr 6 07:52:40 PDT 2009


Hi Jeff,

Jeff Liu wrote:
> This patch add pwd command support for debugfs.ocfs2
> 
> Signed-off-by: Jeff Liu <jeff.liu at oracle.com>
> ---
>  debugfs.ocfs2/commands.c |   21 +++++++++++++++++++++
>  1 files changed, 21 insertions(+), 0 deletions(-)
> 
> diff --git a/debugfs.ocfs2/commands.c b/debugfs.ocfs2/commands.c
> index 0dea23f..f70cdcf 100644
> --- a/debugfs.ocfs2/commands.c
> +++ b/debugfs.ocfs2/commands.c
> @@ -74,6 +74,7 @@ static void do_icheck (char **args);
>  static void do_dlm_locks (char **args);
>  static void do_controld(char **args);
>  static void do_dirblocks(char **args);
> +static void do_pwd(char **args);
>  
>  dbgfs_gbls gbls;
>  
> @@ -110,6 +111,7 @@ static Command commands[] = {
>  	{ "encode",	do_encode_lockres },
>  	{ "decode",	do_decode_lockres },
>  	{ "dirblocks",	do_dirblocks },
> +	{ "pwd",	do_pwd },
>  };
>  
>  /*
> @@ -1769,3 +1771,22 @@ static void do_icheck(char **args)
>  
>  	return;
>  }
> +
> +/*
> + * do_pwd()
> + *
> + */
> +static void do_pwd(char **args)
> +{
> +	uint64_t blkno[1];
why not just "uint64_t blkno"?
> +	int findall = 1;
> +	int count = 1;
> +
> +	if (check_device_open())
> +		return;
> +
> +	blkno[0] = gbls.cwd_blkno;
> +	find_inode_paths(gbls.fs, args, findall, count, blkno, stdout);
you can use:
+	blkno = glbs.cwd_blkno;
+	find_inode_paths(gbls.fs, args, 1, 1, &blkno, stdout);

Regards,
Tao



More information about the Ocfs2-tools-devel mailing list