xfs
[Top] [All Lists]

Re: [PATCH 6/8] fsstress: translate flags in fiemap_f

To: Lukas Czerner <lczerner@xxxxxxxxxx>, linux-ext4@xxxxxxxxxxxxxxx
Subject: Re: [PATCH 6/8] fsstress: translate flags in fiemap_f
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Fri, 28 Feb 2014 11:55:11 -0600
Cc: linux-fsdevel@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1393603865-26198-6-git-send-email-lczerner@xxxxxxxxxx>
References: <1393603865-26198-1-git-send-email-lczerner@xxxxxxxxxx> <1393603865-26198-6-git-send-email-lczerner@xxxxxxxxxx>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
On 2/28/14, 10:11 AM, Lukas Czerner wrote:
> Translate flags in fiemap_f output to human readable strings.

This looks fine, w/ the caveats about translate_flags that I mentioned
on the earlier patch.

Reviewed-by: Eric Sandeen <sandeen@xxxxxxxxxx>

> Signed-off-by: Lukas Czerner <lczerner@xxxxxxxxxx>
> ---
>  ltp/fsstress.c | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/ltp/fsstress.c b/ltp/fsstress.c
> index 24864db..869a8ac 100644
> --- a/ltp/fsstress.c
> +++ b/ltp/fsstress.c
> @@ -2252,6 +2252,18 @@ fdatasync_f(int opno, long r)
>       free_pathname(&f);
>       close(fd);
>  }
> +
> +#ifdef HAVE_LINUX_FIEMAP_H
> +struct print_flags fiemap_flags[] = {
> +     { FIEMAP_FLAG_SYNC, "SYNC"},
> +     { FIEMAP_FLAG_XATTR, "XATTR"},
> +     { -1, NULL}
> +};
> +
> +#define translate_fiemap_flags(mode) \
> +     ({translate_flags(mode, "|", fiemap_flags);})
> +#endif
> +
>  void
>  fiemap_f(int opno, long r)
>  {
> @@ -2314,9 +2326,10 @@ fiemap_f(int opno, long r)
>  
>       e = ioctl(fd, FS_IOC_FIEMAP, (unsigned long)fiemap);
>       if (v)
> -             printf("%d/%d: ioctl(FIEMAP) %s%s %lld %lld %x %d\n",
> +             printf("%d/%d: ioctl(FIEMAP) %s%s %lld %lld (%s) %d\n",
>                      procid, opno, f.path, st, (long long)fiemap->fm_start,
> -                    (long long) fiemap->fm_length, fiemap->fm_flags, e);
> +                    (long long) fiemap->fm_length,
> +                    translate_fiemap_flags(fiemap->fm_flags), e);
>       free(fiemap);
>       free_pathname(&f);
>       close(fd);
> 

<Prev in Thread] Current Thread [Next in Thread>