btrfs-progs/Documentation
Qu Wenruo 68a04bc710 btrfs-progs: tune: add new option to convert back to extent tree
With previous btrfstune support to convert to block-group-tree, it has
implemented most of the infrastructure for bi-directional conversion.

This patch will implement the remaining conversion support to go back to
extent tree.

The modification includes:

- New convert_to_extent_tree() function in btrfstune.c
  It's almost the same as convert_to_bg_tree(), but with small changes:
  * No need to set extra features like NO_HOLES/FST.
  * Need to delete the block group tree when everything finished.

- Update btrfs_delete_and_free_root() to handle non-global roots
  Currently the function can only accepts global roots (extent/csum/free
  space trees)

  If we pass a non-global root into the function, we will screw up
  global_roots_tree and crash.

  Since we're going to use btrfs_delete_and_free_root() to free block
  group tree which is not a global tree, this is needed.

- New handling for half converted fs in get_last_converted_bg()
  There are two cases need to be handled:

  * The bg tree is already empty
    We need to grab the first bg in extent tree.
    Or at conversion function we will fail at grabbing the first bg.

  * The bg tree is not empty
    Then we need to grab the last bg in extent tree.

- Extra root switching in involved functions. This involves:

  * read_converting_block_groups()
  * insert_block_group_item()
  * update_block_group_item()

  We just need to update our target root according to the current
  compat_ro and super flags.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-19 01:10:24 +02:00
..
_static btrfs-progs: docs: update template, more about subvolumes 2022-01-11 15:46:33 +01:00
_templates btrfs-progs: docs: update template, more about subvolumes 2022-01-11 15:46:33 +01:00
dev btrfs-progs: docs: add On disk format 2023-04-05 01:39:42 +02:00
Administration.rst btrfs-progs: docs: add cross reference for manualpages 2022-10-11 09:08:08 +02:00
Auto-repair.rst btrfs-progs: docs: updates, clarifications 2022-12-14 02:56:16 +01:00
Balance.rst btrfs-progs: docs: add more chapters (part 3) 2021-12-17 15:35:10 +01:00
btrfs-balance.rst btrfs-progs: docs: don't use wiki links in manual pages and package 2023-03-16 22:38:21 +01:00
btrfs-check.rst btrfs-progs: docs: don't use wiki links in manual pages and package 2023-03-16 22:38:21 +01:00
btrfs-convert.rst btrfs-progs: docs: remove some asciidoc formatting artifacts 2022-10-11 09:08:08 +02:00
btrfs-device.rst btrfs-progs: docs: don't use wiki links in manual pages and package 2023-03-16 22:38:21 +01:00
btrfs-filesystem.rst btrfs-progs: docs: don't use wiki links in manual pages and package 2023-03-16 22:38:21 +01:00
btrfs-find-root.rst btrfs-progs: docs: add cross reference for manualpages 2022-10-11 09:08:08 +02:00
btrfs-image.rst btrfs-progs: docs: fix typos 2022-12-07 21:00:25 +01:00
btrfs-inspect-internal.rst btrfs-progs: docs: don't use wiki links in manual pages and package 2023-03-16 22:38:21 +01:00
btrfs-ioctl.rst btrfs-progs: docs: convert btrfs-ioctl to more compact format 2023-03-22 20:07:50 +01:00
btrfs-man5.rst btrfs-progs: move block-group-tree out of experimental features 2023-04-17 19:28:05 +02:00
btrfs-map-logical.rst btrfs-progs: docs: add cross reference for manualpages 2022-10-11 09:08:08 +02:00
btrfs-property.rst btrfs-progs: docs: don't use wiki links in manual pages and package 2023-03-16 22:38:21 +01:00
btrfs-qgroup.rst btrfs-progs: docs: don't use wiki links in manual pages and package 2023-03-16 22:38:21 +01:00
btrfs-quota.rst btrfs-progs: docs: don't use wiki links in manual pages and package 2023-03-16 22:38:21 +01:00
btrfs-receive.rst btrfs-progs: docs: don't use wiki links in manual pages and package 2023-03-16 22:38:21 +01:00
btrfs-replace.rst btrfs-progs: docs: don't use wiki links in manual pages and package 2023-03-16 22:38:21 +01:00
btrfs-rescue.rst btrfs-progs: docs: don't use wiki links in manual pages and package 2023-03-16 22:38:21 +01:00
btrfs-restore.rst btrfs-progs: docs: don't use wiki links in manual pages and package 2023-03-16 22:38:21 +01:00
btrfs-scrub.rst btrfs-progs: docs: don't use wiki links in manual pages and package 2023-03-16 22:38:21 +01:00
btrfs-select-super.rst btrfs-progs: docs: fix typos 2022-12-07 21:00:25 +01:00
btrfs-send.rst btrfs-progs: docs: don't use wiki links in manual pages and package 2023-03-16 22:38:21 +01:00
btrfs-subvolume.rst btrfs-progs: docs: don't use wiki links in manual pages and package 2023-03-16 22:38:21 +01:00
btrfs.rst btrfs-progs: docs: don't use wiki links in manual pages and package 2023-03-16 22:38:21 +01:00
btrfsck.8 btrfs-progs: docs: use manual page link instead of symlink 2018-10-23 14:48:39 +02:00
btrfstune.rst btrfs-progs: tune: add new option to convert back to extent tree 2023-04-19 01:10:24 +02:00
ch-balance-filters.rst btrfs-progs: docs: fix typos 2022-12-07 21:00:25 +01:00
ch-balance-intro.rst btrfs-progs: docs: fix typos 2022-12-07 21:00:25 +01:00
ch-bootloaders.rst btrfs-progs: docs: updates, clarifications 2022-12-14 02:56:16 +01:00
ch-checksumming.rst btrfs-progs: docs: typo fixups and formatting updates 2022-12-22 18:44:47 +01:00
ch-compression.rst btrfs-progs: docs: typo fixups and formatting updates 2022-12-22 18:44:47 +01:00
ch-convert-intro.rst btrfs-progs: docs: fix typos 2022-12-07 21:00:25 +01:00
ch-file-attributes.rst btrfs-progs: docs: add cross reference for manualpages 2022-10-11 09:08:08 +02:00
ch-flexibility.rst btrfs-progs: docs: move flexibility to Administration 2022-05-17 21:12:19 +02:00
ch-fs-limits.rst btrfs-progs: docs: typo fixups and formatting updates 2022-12-22 18:44:47 +01:00
ch-hardware-considerations.rst btrfs-progs: docs: typo fixups and formatting updates 2022-12-22 18:44:47 +01:00
ch-mount-options.rst btrfs-progs: docs: add heading to ch-mount-options.rst 2023-01-25 16:20:33 +01:00
ch-quota-intro.rst btrfs-progs: docs: fix typos 2022-12-07 21:00:25 +01:00
ch-scrub-intro.rst btrfs-progs: docs: add more chapters (part 2) 2021-12-17 11:53:44 +01:00
ch-seeding-device.rst btrfs-progs: docs: fix typos 2022-12-07 21:00:25 +01:00
ch-subvolume-intro.rst btrfs-progs: docs: fix name of "mountinfo" file in subvolume intro 2023-03-17 18:14:18 +01:00
ch-swapfile.rst btrfs-progs: docs: update swapfile Added size to mkswapfile example 2023-03-16 23:15:15 +01:00
ch-sysfs.rst btrfs-progs: docs: discard tunables and metrics in sysfs 2023-03-16 15:48:48 +01:00
ch-volume-management-intro.rst btrfs-progs: docs: typo fixups and formatting updates 2022-12-22 18:44:47 +01:00
ch-zoned-intro.rst btrfs-progs: docs: typo fixups and formatting updates 2022-12-22 18:44:47 +01:00
CHANGES.rst btrfs-progs: docs: distinguish Changes title 2022-08-16 15:18:10 +02:00
Checksumming.rst btrfs-progs: docs: add more chapters 2021-12-17 11:53:44 +01:00
CmdLineConventions btrfs-progs: docs: fix typos 2022-12-07 21:00:25 +01:00
CodingConventions btrfs-progs: docs: document conventions 2017-07-03 13:35:10 +02:00
Common-features.rst btrfs-progs: docs: update file attributes 2022-03-08 18:11:40 +01:00
Compression.rst btrfs-progs: docs: add more chapters 2021-12-17 11:53:44 +01:00
conf.py btrfs-progs: docs: drop copyright year from manual pages 2023-01-25 16:19:51 +01:00
Contributors.rst btrfs-progs: docs: add 6.2 development statistics 2023-02-28 20:11:24 +01:00
Convert.rst btrfs-progs: docs: add more chapters (part 2) 2021-12-17 11:53:44 +01:00
Custom-ioctls.rst btrfs-progs: docs: updates, clarifications 2022-12-14 02:56:16 +01:00
Deduplication.rst btrfs-progs: docs: typo fixups and formatting updates 2022-12-22 18:44:47 +01:00
Defragmentation.rst btrfs-progs: docs: fix typos 2022-12-07 21:00:25 +01:00
DocConventions.rst btrfs-progs: docs: fix typos 2022-12-07 21:00:25 +01:00
Feature-by-version.rst btrfs-progs: docs: typo fixups and formatting updates 2022-12-22 18:44:47 +01:00
fsck.btrfs.rst btrfs-progs: docs: fix typos 2022-12-07 21:00:25 +01:00
Glossary.rst btrfs-progs: docs: typo fixups and formatting updates 2022-12-22 18:44:47 +01:00
Hardware.rst btrfs-progs: docs: separate chapter for hardware considerations 2022-05-17 21:12:19 +02:00
index.rst btrfs-progs: docs: add On disk format 2023-04-05 01:39:42 +02:00
Inline-files.rst btrfs-progs: docs: fix typos 2022-12-07 21:00:25 +01:00
INSTALL.rst btrfs-progs: docs: link INSTALL to docs 2022-05-12 13:56:03 +02:00
Interoperability.rst btrfs-progs: docs: add more chapters 2021-12-17 11:53:44 +01:00
Introduction.rst btrfs-progs: docs: fix superscript formatting 2022-05-20 23:52:20 +02:00
Kernel-by-version.rst btrfs-progs: docs: reformat kernel-by-version 2023-04-12 01:31:34 +02:00
Makefile.in btrfs-progs: docs: convert btrfs-ioctl.asciidoc to RST 2022-05-18 13:28:35 +02:00
man-index.rst btrfs-progs: docs: drop indices from pages 2021-11-26 00:48:24 +01:00
mkfs.btrfs.rst btrfs-progs: move block-group-tree out of experimental features 2023-04-17 19:28:05 +02:00
Qgroups.rst btrfs-progs: docs: add more chapters (part 2) 2021-12-17 11:53:44 +01:00
Quick-start.rst btrfs-progs: docs: add more of the new doc structure 2021-11-30 16:00:48 +01:00
Reflink.rst btrfs-progs: docs: update reflink cross-mount constraint 2022-10-11 09:08:07 +02:00
ReleaseChecklist btrfs-progs: Update README and other docs 2016-11-23 11:07:05 +01:00
Resize.rst btrfs-progs: docs: add more chapters (part 3) 2021-12-17 15:35:10 +01:00
Scrub.rst btrfs-progs: docs: add more chapters (part 2) 2021-12-17 11:53:44 +01:00
Seeding-device.rst btrfs-progs: docs: add more chapters 2021-12-17 11:53:44 +01:00
Send-receive.rst btrfs-progs: docs: fix typos 2022-12-07 21:00:25 +01:00
Source-repositories.rst btrfs-progs: docs: typo fixups and formatting updates 2022-12-22 18:44:47 +01:00
Status.rst btrfs-progs: docs: add Status page from wiki 2023-03-22 14:39:13 +01:00
Subpage.rst btrfs-progs: docs: fix typos 2022-12-07 21:00:25 +01:00
Subvolumes.rst btrfs-progs: docs: add more chapters (part 3) 2021-12-17 15:35:10 +01:00
Swapfile.rst btrfs-progs: docs: swapfile and hibernation 2022-12-06 23:19:12 +01:00
Tree-checker.rst btrfs-progs: docs: fix typos 2022-12-07 21:00:25 +01:00
Trim.rst btrfs-progs: docs: add cross reference for manualpages 2022-10-11 09:08:08 +02:00
trouble-index.rst btrfs-progs: docs: fix typos 2022-12-07 21:00:25 +01:00
Volume-management.rst btrfs-progs: docs: add more chapters (part 3) 2021-12-17 15:35:10 +01:00
Zoned-mode.rst btrfs-progs: docs: add more chapters (part 3) 2021-12-17 15:35:10 +01:00