fs: btrfs: Crossport open_ctree_fs_info() from btrfs-progs
authorQu Wenruo <wqu@suse.com>
Wed, 24 Jun 2020 16:03:01 +0000 (18:03 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 8 Sep 2020 00:57:27 +0000 (20:57 -0400)
commitf06bfcf54d0e91892fcd1379e04aae9cd031fc78
treeaac26e518b93db18f3a3557e78340f9ad5483465
parent57f24f10733ac57754d4eae3666919480718b032
fs: btrfs: Crossport open_ctree_fs_info() from btrfs-progs

open_ctree_fs_info() is the main entry point to open btrfs.

This version is a simplfied version of __open_ctree_fd() of btrfs-progs,
the main differences are:
- Parameters on how to specify a block device
  Instead of @fd and @path, U-Boot uses blk_desc and disk_partition_t.

- Remove open_ctree flags
  There won't be multiple open ctree modes in U-Boot.

Otherwise functions structures are all kept the same.

With open_ctree_fs_info() implemented, also introduce the global
current_fs_info pointer to show the current opened btrfs.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Marek BehĂșn <marek.behun@nic.cz>
fs/btrfs/Makefile
fs/btrfs/btrfs.c
fs/btrfs/btrfs.h
fs/btrfs/compat.h
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/disk-io.h
fs/btrfs/root-tree.c [new file with mode: 0644]