Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/4] btrfs-progs: mkfs/rootdir: cleanup and new fiemap based prealloc detection
Date: Mon, 30 Mar 2026 17:39:34 +1030	[thread overview]
Message-ID: <cover.1774854459.git.wqu@suse.com> (raw)

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


             reply	other threads:[~2026-03-30  7:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30  7:09 Qu Wenruo [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1774854459.git.wqu@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox