2023-04-19 21:20:44 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
|
2023-08-28 20:12:13 +00:00
|
|
|
#include "kerncompat.h"
|
2023-04-19 21:20:44 +00:00
|
|
|
#include "kernel-shared/ctree.h"
|
|
|
|
#include "kernel-shared/locking.h"
|
2023-08-28 20:12:13 +00:00
|
|
|
#include "kernel-shared/extent_io.h"
|
2023-04-19 21:20:44 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|