Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / fs / btrfs / ref-verify.h
blob3bf02ce0e1e27f02a4b98affc5ebd923ef143d71
1 /*
2 * Copyright (C) 2014 Facebook. All rights reserved.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License v2 as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public
14 * License along with this program; if not, write to the
15 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 * Boston, MA 021110-1307, USA.
18 #ifndef __REF_VERIFY__
19 #define __REF_VERIFY__
21 #ifdef CONFIG_BTRFS_FS_REF_VERIFY
22 int btrfs_build_ref_tree(struct btrfs_fs_info *fs_info);
23 void btrfs_free_ref_cache(struct btrfs_fs_info *fs_info);
24 int btrfs_ref_tree_mod(struct btrfs_root *root, u64 bytenr, u64 num_bytes,
25 u64 parent, u64 ref_root, u64 owner, u64 offset,
26 int action);
27 void btrfs_free_ref_tree_range(struct btrfs_fs_info *fs_info, u64 start,
28 u64 len);
30 static inline void btrfs_init_ref_verify(struct btrfs_fs_info *fs_info)
32 spin_lock_init(&fs_info->ref_verify_lock);
33 fs_info->block_tree = RB_ROOT;
35 #else
36 static inline int btrfs_build_ref_tree(struct btrfs_fs_info *fs_info)
38 return 0;
41 static inline void btrfs_free_ref_cache(struct btrfs_fs_info *fs_info)
45 static inline int btrfs_ref_tree_mod(struct btrfs_root *root, u64 bytenr,
46 u64 num_bytes, u64 parent, u64 ref_root,
47 u64 owner, u64 offset, int action)
49 return 0;
52 static inline void btrfs_free_ref_tree_range(struct btrfs_fs_info *fs_info,
53 u64 start, u64 len)
57 static inline void btrfs_init_ref_verify(struct btrfs_fs_info *fs_info)
61 #endif /* CONFIG_BTRFS_FS_REF_VERIFY */
62 #endif /* _REF_VERIFY__ */