disk-io.h (789d6a3a876e32c23fc9633d5b372d02a5188f0e) disk-io.h (27137fac4c0628fc8320bb7f1ce3bb9f84b76a9b)
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (C) 2007 Oracle. All rights reserved.
4 */
5
6#ifndef BTRFS_DISK_IO_H
7#define BTRFS_DISK_IO_H
8

--- 11 unchanged lines hidden (view full) ---

20static inline u64 btrfs_sb_offset(int mirror)
21{
22 u64 start = SZ_16K;
23 if (mirror)
24 return start << (BTRFS_SUPER_MIRROR_SHIFT * mirror);
25 return BTRFS_SUPER_INFO_OFFSET;
26}
27
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (C) 2007 Oracle. All rights reserved.
4 */
5
6#ifndef BTRFS_DISK_IO_H
7#define BTRFS_DISK_IO_H
8

--- 11 unchanged lines hidden (view full) ---

20static inline u64 btrfs_sb_offset(int mirror)
21{
22 u64 start = SZ_16K;
23 if (mirror)
24 return start << (BTRFS_SUPER_MIRROR_SHIFT * mirror);
25 return BTRFS_SUPER_INFO_OFFSET;
26}
27
28/* All the extra info needed to verify the parentness of a tree block. */
29struct btrfs_tree_parent_check {
30 /*
31 * The owner check against the tree block.
32 *
33 * Can be 0 to skip the owner check.
34 */
35 u64 owner_root;
36
37 /*
38 * Expected transid, can be 0 to skip the check, but such skip
39 * should only be utlized for backref walk related code.
40 */
41 u64 transid;
42
43 /*
44 * The expected first key.
45 *
46 * This check can be skipped if @has_first_key is false, such skip
47 * can happen for case where we don't have the parent node key,
48 * e.g. reading the tree root, doing backref walk.
49 */
50 struct btrfs_key first_key;
51 bool has_first_key;
52
53 /* The expected level. Should always be set. */
54 u8 level;
55};
56
57struct btrfs_device;
58struct btrfs_fs_devices;
28struct btrfs_device;
29struct btrfs_fs_devices;
30struct btrfs_tree_parent_check;
59
60void btrfs_check_leaked_roots(struct btrfs_fs_info *fs_info);
61void btrfs_init_fs_info(struct btrfs_fs_info *fs_info);
62int btrfs_verify_level_key(struct extent_buffer *eb, int level,
63 struct btrfs_key *first_key, u64 parent_transid);
64struct extent_buffer *read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
65 struct btrfs_tree_parent_check *check);
66struct extent_buffer *btrfs_find_create_tree_block(

--- 104 unchanged lines hidden ---
31
32void btrfs_check_leaked_roots(struct btrfs_fs_info *fs_info);
33void btrfs_init_fs_info(struct btrfs_fs_info *fs_info);
34int btrfs_verify_level_key(struct extent_buffer *eb, int level,
35 struct btrfs_key *first_key, u64 parent_transid);
36struct extent_buffer *read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
37 struct btrfs_tree_parent_check *check);
38struct extent_buffer *btrfs_find_create_tree_block(

--- 104 unchanged lines hidden ---