mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
fsstress: translate flags in fiemap_f
Translate flags in fiemap_f output to human readable strings. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
committed by
Dave Chinner
parent
2d2d853625
commit
4544179a64
+15
-2
@@ -2274,6 +2274,18 @@ fdatasync_f(int opno, long r)
|
|||||||
free_pathname(&f);
|
free_pathname(&f);
|
||||||
close(fd);
|
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
|
void
|
||||||
fiemap_f(int opno, long r)
|
fiemap_f(int opno, long r)
|
||||||
{
|
{
|
||||||
@@ -2336,9 +2348,10 @@ fiemap_f(int opno, long r)
|
|||||||
|
|
||||||
e = ioctl(fd, FS_IOC_FIEMAP, (unsigned long)fiemap);
|
e = ioctl(fd, FS_IOC_FIEMAP, (unsigned long)fiemap);
|
||||||
if (v)
|
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,
|
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(fiemap);
|
||||||
free_pathname(&f);
|
free_pathname(&f);
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|||||||
Reference in New Issue
Block a user