btrfs: Factor out tree roots initialization during mount
Nikolay Borisov authored
The code responsible for reading and initializing tree roots is
scattered in open_ctree among 2 labels, emulating a loop. This is rather
confusing to reason about. Instead, factor the code to a new function,
init_tree_roots which implements the same logical flow.

There are a couple of notable differences, namely:

* Instead of using next_backup_root it's using the newly introduced
  read_backup_root.

* If read_backup_root returns an error init_tree_roots propagates the
  error and there is no special handling of that case e.g. the code jumps
  straight to 'fail_tree_roots' label. The old code, however, was
  (erroneously) jumping to 'fail_block_groups' label if next_backup_root
  did fail, this was unnecessary since the tree roots init logic doesn't
  modify the state of block groups.
Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
b8522a1e
Name Last commit Last update
Documentation Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
LICENSES LICENSES: Rename other to deprecated
arch Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
block iocost: check active_list of all the ancestors in iocg_activate()
certs PKCS#7: Refactor verify_pkcs7_signature()
crypto Merge branch 'next-lockdown' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
drivers Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
fs btrfs: Factor out tree roots initialization during mount
include btrfs: add dedicated members for start and length of a block group
init Merge branch 'next-lockdown' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
ipc ipc/sem.c: convert to use built-in RCU list checking
kernel Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
lib lib/xz: fix XZ_DYNALLOC to avoid useless memory reallocations
mm mm/debug.c: PageAnon() is true for PageKsm() pages
net ipmr: Fix skb headroom in ipmr_get_route().
samples samples/bpf: fix build by setting HAVE_ATTR_TEST to zero
scripts Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
security efi/efi_test: Lock down /dev/efi_test and require CAP_SYS_ADMIN
sound ALSA: usb-audio: Fix incorrect size check for processing/extension units
tools Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
usr kbuild: update compile-test header list for v5.4-rc2
virt KVM: Add a comment describing the /dev/kvm no_compat handling
.clang-format clang-format: Update with the latest for_each macro list
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl
.gitattributes .gitattributes: set git diff driver for C source code files
.gitignore Merge tag 'modules-for-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux
.mailmap Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
COPYING COPYING: use the new text with points to the license files
CREDITS MAINTAINERS: Remove Simon as Renesas SoC Co-Maintainer
Kbuild kbuild: do not descend to ./Kbuild when cleaning
Kconfig docs: kbuild: convert docs to ReST and rename to *.rst
MAINTAINERS Merge tag 'iommu-fixes-v5.4-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
Makefile Linux 5.4-rc8
README Drop all 00-INDEX files from Documentation/
Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.