1
0
mirror of https://github.com/Zygo/bees.git synced 2025-05-17 21:35:45 +02:00

fiemap: don't force flush so we can see the delalloc shenanigans

Like filefrag, fiemap was defaulting to FIEMAP_FLAG_SYNC, and providing no
option to turn it off.  This prevents observation of delayed allocations,
making fiemap less useful.

Override the default flag setting so fiemap gets the current
(i.e. unflushed) extent map state.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
Zygo Blaxell 2021-06-08 23:07:14 -04:00
parent d9e3c0070b
commit 3d95460eb7

View File

@ -23,6 +23,7 @@ main(int argc, char **argv)
cout << "File: " << filename << endl; cout << "File: " << filename << endl;
Fd fd = open_or_die(filename, O_RDONLY); Fd fd = open_or_die(filename, O_RDONLY);
Fiemap fm; Fiemap fm;
fm.fm_flags &= ~(FIEMAP_FLAG_SYNC);
fm.m_max_count = 100; fm.m_max_count = 100;
if (argc > 2) { fm.fm_start = stoull(argv[2], nullptr, 0); } if (argc > 2) { fm.fm_start = stoull(argv[2], nullptr, 0); }
if (argc > 3) { fm.fm_length = stoull(argv[3], nullptr, 0); } if (argc > 3) { fm.fm_length = stoull(argv[3], nullptr, 0); }