]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: don't set SHAREABLE flag for data reloc tree
authorQu Wenruo <wqu@suse.com>
Fri, 15 May 2020 06:01:42 +0000 (14:01 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 May 2020 09:25:35 +0000 (11:25 +0200)
commit9f7c33d46990225e8c174fffdb9d0fd683f5f7c4
treea762926ebc409a8176ad726727e5f348cc454612
parent57254124b1f533a57fb7ba270c7e4e416ddda0ea
btrfs: don't set SHAREABLE flag for data reloc tree

SHAREABLE flag is set for subvolumes because users can create snapshot
for subvolumes, thus sharing tree blocks of them.

But data reloc tree is not exposed to user space, as it's only an
internal tree for data relocation, thus it doesn't need the full path
replacement handling at all.

This patch will make data reloc tree a non-shareable tree, and add
btrfs_fs_info::data_reloc_root for data reloc tree, so relocation code
can grab it from fs_info directly.

This would slightly improve tree relocation, as now data reloc tree
can go through regular COW routine to get relocated, without bothering
the complex tree reloc tree routine.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/relocation.c