Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Copyright (C) 2014 Facebook.  All rights reserved.
0004  */
0005 
0006 #ifndef BTRFS_REF_VERIFY_H
0007 #define BTRFS_REF_VERIFY_H
0008 
0009 #ifdef CONFIG_BTRFS_FS_REF_VERIFY
0010 int btrfs_build_ref_tree(struct btrfs_fs_info *fs_info);
0011 void btrfs_free_ref_cache(struct btrfs_fs_info *fs_info);
0012 int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info,
0013                struct btrfs_ref *generic_ref);
0014 void btrfs_free_ref_tree_range(struct btrfs_fs_info *fs_info, u64 start,
0015                    u64 len);
0016 
0017 static inline void btrfs_init_ref_verify(struct btrfs_fs_info *fs_info)
0018 {
0019     spin_lock_init(&fs_info->ref_verify_lock);
0020     fs_info->block_tree = RB_ROOT;
0021 }
0022 #else
0023 static inline int btrfs_build_ref_tree(struct btrfs_fs_info *fs_info)
0024 {
0025     return 0;
0026 }
0027 
0028 static inline void btrfs_free_ref_cache(struct btrfs_fs_info *fs_info)
0029 {
0030 }
0031 
0032 static inline int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info,
0033                struct btrfs_ref *generic_ref)
0034 {
0035     return 0;
0036 }
0037 
0038 static inline void btrfs_free_ref_tree_range(struct btrfs_fs_info *fs_info,
0039                          u64 start, u64 len)
0040 {
0041 }
0042 
0043 static inline void btrfs_init_ref_verify(struct btrfs_fs_info *fs_info)
0044 {
0045 }
0046 
0047 #endif /* CONFIG_BTRFS_FS_REF_VERIFY */
0048 
0049 #endif