2023-04-19 21:20:44 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
|
|
|
|
#include "kernel-shared/ctree.h"
|
|
|
|
#include "kernel-shared/locking.h"
|
|
|
|
|
|
|
|
struct extent_buffer *btrfs_read_lock_root_node(struct btrfs_root *root)
|
|
|
|
{
|
2023-08-23 14:27:48 +00:00
|
|
|
root->node->refs++;
|
2023-04-19 21:20:44 +00:00
|
|
|
return root->node;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct extent_buffer *btrfs_try_read_lock_root_node(struct btrfs_root *root)
|
|
|
|
{
|
2023-08-23 14:27:48 +00:00
|
|
|
root->node->refs++;
|
2023-04-19 21:20:44 +00:00
|
|
|
return root->node;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct extent_buffer *btrfs_lock_root_node(struct btrfs_root *root)
|
|
|
|
{
|
2023-08-23 14:27:48 +00:00
|
|
|
root->node->refs++;
|
2023-04-19 21:20:44 +00:00
|
|
|
return root->node;
|
|
|
|
}
|