Home
last modified time | relevance | path

Searched hist:"0 b530bc5" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/fs/btrfs/
H A Drelocation.c0b530bc5 Fri Jan 24 08:32:38 CST 2020 Josef Bacik <josef@toxicpanda.com> btrfs: hold a ref on the root in build_backref_tree

This is trickier than the previous conversions. We have backref_node's
that need to hold onto their root for their lifetime. Do the read of
the root and grab the ref. If at any point we don't use the root we
discard it, however if we use it in our backref node we don't free it
until we free the backref node. Any time we switch the root's for the
backref node we need to drop our ref on the old root and grab the ref on
the new root, and if we dupe a node we need to get a ref on the root
there as well.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
0b530bc5 Fri Jan 24 08:32:38 CST 2020 Josef Bacik <josef@toxicpanda.com> btrfs: hold a ref on the root in build_backref_tree

This is trickier than the previous conversions. We have backref_node's
that need to hold onto their root for their lifetime. Do the read of
the root and grab the ref. If at any point we don't use the root we
discard it, however if we use it in our backref node we don't free it
until we free the backref node. Any time we switch the root's for the
backref node we need to drop our ref on the old root and grab the ref on
the new root, and if we dupe a node we need to get a ref on the root
there as well.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>