File: locking.c

package info (click to toggle)
btrfs-progs 6.16-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 20,504 kB
  • sloc: ansic: 126,181; sh: 7,642; python: 1,386; makefile: 900; asm: 296
file content (23 lines) | stat: -rw-r--r-- 490 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* SPDX-License-Identifier: GPL-2.0 */

#include "kerncompat.h"
#include "kernel-shared/ctree.h"
#include "kernel-shared/extent_io.h"

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;
}