[Ocfs2-tools-devel] [PATCH 3/3] ocfs2-tools: Add extended attribute support in debugfs.ocfs2.
Tao Ma
tao.ma at oracle.com
Mon Aug 25 23:55:14 PDT 2008
Tiger Yang wrote:
> This patch add new command xattr in debugfs.ocfs2.
> xattr <filespec> could show all extended attributes related to this file.
>
> Signed-off-by: Tiger Yang <tiger.yang at oracle.com>
> ---
> debugfs.ocfs2/commands.c | 43 +++++++++++
> debugfs.ocfs2/dump.c | 170 ++++++++++++++++++++++++++++++++++++++++++
> debugfs.ocfs2/include/dump.h | 3 +
> 3 files changed, 216 insertions(+), 0 deletions(-)
>
> diff --git a/debugfs.ocfs2/commands.c b/debugfs.ocfs2/commands.c
> index 83cb5b6..2708aea 100644
> --- a/debugfs.ocfs2/commands.c
> +++ b/debugfs.ocfs2/commands.c
> @@ -73,6 +73,7 @@ static void do_bmap (char **args);
> static void do_icheck (char **args);
> static void do_dlm_locks (char **args);
> static void do_controld(char **args);
> +static void do_xattr(char **args);
>
> dbgfs_gbls gbls;
>
> @@ -106,6 +107,7 @@ static Command commands[] = {
> { "slotmap", do_slotmap },
> { "stat", do_stat },
> { "stats", do_stats },
> + { "xattr", do_xattr },
I think we need more command here so that we can list some specified
xattr bucket to allow us to detect the EA distribution in the buckets
and it is also easy for us to write scripts.
> { "encode", do_encode_lockres },
> { "decode", do_decode_lockres }
> };
> @@ -852,6 +854,7 @@ static void do_help (char **args)
> printf ("slotmap\t\t\t\t\tShow slot map\n");
> printf ("stat <filespec>\t\t\t\tShow inode\n");
> printf ("stats [-h]\t\t\t\tShow superblock\n");
> + printf ("xattr\t\t\t\t\tShow Extended Attributes\n");
> }
>
> /*
> @@ -1678,3 +1681,43 @@ static void do_icheck(char **args)
>
> return;
> }
> +/*
> + * do_xattr()
> + *
> + */
> +static void do_xattr(char **args)
> +{
> + struct ocfs2_dinode *inode;
> + uint64_t blkno;
> + char *buf = NULL;
> + FILE *out;
> + errcode_t ret = 0;
> +
> + if (process_inode_args(args, &blkno))
> + return ;
> +
> + buf = gbls.blockbuf;
> + ret = ocfs2_read_inode(gbls.fs, blkno, buf);
I suddenly found one thing, where do you swap the EA in the inode? I
don't see it in your previous patch.
Regards,
Tao
More information about the Ocfs2-tools-devel
mailing list