Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/4] btrfs-progs: mkfs/rootdir: cleanup and new fiemap based prealloc detection
@ 2026-03-30  7:09 Qu Wenruo
  2026-03-30  7:09 ` [PATCH 1/4] btrfs-progs: mkfs/rootdir: use a helper to read from source fs Qu Wenruo
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Qu Wenruo @ 2026-03-30  7:09 UTC (permalink / raw)
  To: linux-btrfs

The PR can be found here:

  https://github.com/kdave/btrfs-progs/pull/1103

Although previously I added a SEEK_DATA/SEEK_HOLE based hole detection,
it doesn't distinguish holes from preallocated ranges.
Thus if a rootdir contains some preallocated extents and the end user
also expects such preallocated space in the target fs, they will be
replaced by holes.

The 3rd patch adds such detection using fiemap, which can also detect
holes.
For preallocated space we now can create reserved data extent without
data checksum.

The first two patches are mostly cleanups, to disentangle the complex
add_file_item_extent() function, so that compressed fall back is more
straightforward.

The last patch is a simple functional test for the new fiemap feature.

Qu Wenruo (4):
  btrfs-progs: mkfs/rootdir: use a helper to read from source fs
  btrfs-progs: mkfs/rootdir: extract compressed write path
  btrfs-progs: mkfs/rootdir: use fiemap to do prealloc detection
  btrfs-progs: mkfs-tests: add a new test case for fiemap based
    detection

 kernel-shared/file-item.h                     |   3 -
 mkfs/rootdir.c                                | 400 ++++++++++++------
 tests/mkfs-tests/042-fiemap-detection/test.sh |  76 ++++
 3 files changed, 348 insertions(+), 131 deletions(-)
 create mode 100755 tests/mkfs-tests/042-fiemap-detection/test.sh

--
2.53.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-03-30  7:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-30  7:09 [PATCH 0/4] btrfs-progs: mkfs/rootdir: cleanup and new fiemap based prealloc detection Qu Wenruo
2026-03-30  7:09 ` [PATCH 1/4] btrfs-progs: mkfs/rootdir: use a helper to read from source fs Qu Wenruo
2026-03-30  7:09 ` [PATCH 2/4] btrfs-progs: mkfs/rootdir: extract compressed write path Qu Wenruo
2026-03-30  7:09 ` [PATCH 3/4] btrfs-progs: mkfs/rootdir: use fiemap to do prealloc detection Qu Wenruo
2026-03-30  7:09 ` [PATCH 4/4] btrfs-progs: mkfs-tests: add a new test case for fiemap based detection Qu Wenruo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox