Skip to content

btrfs-progs: mkfs fixes and prep work for extent tree v2

Josef Bacik linux-btrfs 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest10 patches 6 repliesIn review
  2. v19 patches 13 repliesSuperseded

Changes in v2 from the cover letter

- Rebase onto devel+block group used patches.
- Dropped MKFS_SUPER_BLOCK as suggested by Qu.
- Make sure to recow the free space root now that we're generating it at make_btrfs() time.
- Rewored the titles to include the target area.
- Dropped "btrfs-progs: allocate blocks from the start of the temp system chunk" as it is no longer needed with the MKFS_SUPER_BLOCK dropping.
- Add a patch to make sure ->ref_cows and ->track_dirty is set properly on roots if we read roots directly.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10btrfs-progs: mkfs: use an associative array for init blocksmkfs/common.c mkfs/common.h+43 -200 replies
2/10btrfs-progs: mkfs: get rid of MKFS_SUPER_BLOCKmkfs/common.c mkfs/common.h+6 -130 replies
3/10btrfs-progs: mkfs: use blocks_nr to determine the super used bytesmkfs/common.c+3 -10 replies
4/10btrfs-progs: mkfs: set nritems based on root items writtenmkfs/common.c+2 -10 replies
5/10btrfs-progs: mkfs: add helper for writing empty tree nodesmkfs/common.c+25 -220 replies
6/10btrfs-progs: make sure track_dirty and ref_cows is set properlykernel-shared/disk-io.c+4 -10 replies
7/10btrfs-progs: mkfs: add the block group item in make_btrfs()mkfs/common.c mkfs/main.c+33 -70 replies
8/10btrfs-progs: add add_block_group_free_space helperkernel-shared/extent-tree.c kernel-shared/free-space-tree.c kernel-shared/free-space-tree.h+30 -00 replies
9/10btrfs-progs: mkfs: generate free space tree at make_btrfs() timemkfs/common.c mkfs/common.h mkfs/main.c+82 -91 reply
10/10btrfs-progs: add the incompat flag for extent tree v2kernel-shared/ctree.h mkfs/main.c+6 -30 replies

Reviews trailers per patch

3 of 10 patches have a Reviewed-by or Acked-by.

PatchQu Wenruo
1/10
2/10
3/10R-b
4/10R-b
5/10R-b
6/10
7/10
8/10
9/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/10] btrfs-progs: mkfs fixes and prep work for extent tree v2

v1->v2:
- Rebase onto devel+block group used patches.
- Dropped MKFS_SUPER_BLOCK as suggested by Qu.
- Make sure to recow the free space root now that we're generating it at make_btrfs() time.
- Rewored the titles to include the target area.
- Dropped "btrfs-progs: allocate blocks from the start of the temp system chunk" as it is no longer needed with the MKFS_SUPER_BLOCK dropping.
- Add a patch to make sure ->ref_cows and ->track_dirty is set properly on roots if we read roots directly.

--- Original email ---
Hello,

In order to reduce the amount of pain the reviewers have to endure I'm going to be sending any prepatory patches separately from the actual feature work.

To that end this is the first batch of preparatory patches. These are to make working with mkfs a lot easier for the changes I'm making. These are all fixes or enhancements that can apply currently. The only thing that is extent tree v2 specific is the last patch, which adds the incompat flag.

I've added the patch for the incompat flag because I will have other preparatory patches that add helpers that essentially do

if (!btrfs_fs_incompat(fs_info, EXTENT_TREE_V2))

	/* Do the old thing. */

and then have patches after that add the extent tree v2 magic. I think this will make it easier to break up the work, but if we're not comfortable reserving the bit then I'm fine with dropping that last patch. It will just mean future prep work will have to come along with the feature enablement patches.

I've tested this with make test to validate I didn't break anything. Thanks,

Josef

Josef Bacik (10):
btrfs-progs: mkfs: use an associative array for init blocks
btrfs-progs: mkfs: get rid of MKFS_SUPER_BLOCK
btrfs-progs: mkfs: use blocks_nr to determine the super used bytes
btrfs-progs: mkfs: set nritems based on root items written
btrfs-progs: mkfs: add helper for writing empty tree nodes
btrfs-progs: make sure track_dirty and ref_cows is set properly
btrfs-progs: mkfs: add the block group item in make_btrfs()
btrfs-progs: add add_block_group_free_space helper
btrfs-progs: mkfs: generate free space tree at make_btrfs() time
btrfs-progs: add the incompat flag for extent tree v2

 kernel-shared/ctree.h           |   1 +
 kernel-shared/disk-io.c         |   5 +-
 kernel-shared/extent-tree.c     |   2 +
 kernel-shared/free-space-tree.c |  26 ++++
 kernel-shared/free-space-tree.h |   2 +
 mkfs/common.c                   | 212 ++++++++++++++++++++++++--------
 mkfs/common.h                   |  19 ++-
 mkfs/main.c                     |  24 ++--
 8 files changed, 224 insertions(+), 67 deletions(-)
Signature · 1 line
2.26.3