mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-29 17:02:43 +00:00
btrfs-progs: take a ref in the root locking code
This code in the kernel not only returns the locked root, but also takes a reference on the node. This is important for when we sync ctree.c into btrfs-progs, it expects that references are held on the root node after calling these helpers. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
ce93d20fd5
commit
ba01aadff1
@ -5,15 +5,18 @@
|
||||
|
||||
struct extent_buffer *btrfs_read_lock_root_node(struct btrfs_root *root)
|
||||
{
|
||||
root->node->refs++;
|
||||
return root->node;
|
||||
}
|
||||
|
||||
struct extent_buffer *btrfs_try_read_lock_root_node(struct btrfs_root *root)
|
||||
{
|
||||
root->node->refs++;
|
||||
return root->node;
|
||||
}
|
||||
|
||||
struct extent_buffer *btrfs_lock_root_node(struct btrfs_root *root)
|
||||
{
|
||||
root->node->refs++;
|
||||
return root->node;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user