The code is mostly ported from kernel with minimal change. Since btrfs-progs doesn't support replaying log, there is some code unnecessary for btrfs-progs, but to keep the code the same, that unnecessary code is kept as it. Now "btrfs check --repair" will update backup roots correctly. Signed-off-by: Qu Wenruo <wqu@suse.com>