Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/3] mkfs/rootdir: refactor and enhancements, part 1
@ 2026-05-18 10:20 Qu Wenruo
  2026-05-18 10:20 ` [PATCH 1/3] btrfs-progs: rename logical bytenr parameter for add_file_item_extent() Qu Wenruo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Qu Wenruo @ 2026-05-18 10:20 UTC (permalink / raw)
  To: linux-btrfs

We have "--reflink" option introduced for mkfs for a while, and recently
the new get_csums ioctl is also introduced, making
add_file_item_extent() much larger and harder to maintain.

I have some concerns about the larger and larger
add_file_item_extent(), and will address some of them in the series:

- Minor mismatches on some parameter/variable names
  Use more commonly used names to replace them.

- Duplicated partial block handling
  Which not only makes add_file_item_extent() larger but also harder to
  read/maintain.

  To remove those duplicated partial block handling, the idea is to
  shrink the range to block boundary when possible.
  If we can not shrink the range anymore, disable reflink/get_csums.

  So that we do not need to handle partial blocks for reflink/get_csums.
  All the duplicated code can be removed.

- No test case for --reflink nor the latest get_csums option
  A new test case, to verify all above mentioned cases.

Qu Wenruo (3):
  btrfs-progs: rename logical bytenr parameter for
    add_file_item_extent()
  btrfs: mkfs/rootdir: refactor the last block handling
  btrfs-progs: mkfs-tests: add a new one for '--reflink' option

 kernel-shared/extent_io.c                    |  10 +-
 mkfs/rootdir.c                               | 175 ++++++++-----------
 tests/mkfs-tests/043-rootdir-reflink/test.sh |  57 ++++++
 3 files changed, 135 insertions(+), 107 deletions(-)
 create mode 100755 tests/mkfs-tests/043-rootdir-reflink/test.sh

--
2.54.0


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

end of thread, other threads:[~2026-05-18 10:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-18 10:20 [PATCH 0/3] mkfs/rootdir: refactor and enhancements, part 1 Qu Wenruo
2026-05-18 10:20 ` [PATCH 1/3] btrfs-progs: rename logical bytenr parameter for add_file_item_extent() Qu Wenruo
2026-05-18 10:20 ` [PATCH 2/3] btrfs: mkfs/rootdir: refactor the last block handling Qu Wenruo
2026-05-18 10:20 ` [PATCH 3/3] btrfs-progs: mkfs-tests: add a new one for '--reflink' option Qu Wenruo

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