summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorYan Zheng2008-07-30 15:26:11 +0200
committerChris Mason2008-09-25 17:04:05 +0200
commitf321e4910398cf7922265d269fb17fd26f312571 (patch)
tree8430f004991351e48a4b3f9441fe0cbbcf70eddb /fs/btrfs/ctree.h
parentBtrfs: async-thread: fix possible memory leak (diff)
downloadkernel-qcow2-linux-f321e4910398cf7922265d269fb17fd26f312571.tar.gz
kernel-qcow2-linux-f321e4910398cf7922265d269fb17fd26f312571.tar.xz
kernel-qcow2-linux-f321e4910398cf7922265d269fb17fd26f312571.zip
Btrfs: Update and fix mount -o nodatacow
To check whether a given file extent is referenced by multiple snapshots, the checker walks down the fs tree through dead root and checks all tree blocks in the path. We can easily detect whether a given tree block is directly referenced by other snapshot. We can also detect any indirect reference from other snapshot by checking reference's generation. The checker can always detect multiple references, but can't reliably detect cases of single reference. So btrfs may do file data cow even there is only one reference. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 5517dfc6f71c..83422088c629 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -617,7 +617,7 @@ struct btrfs_leaf_ref_tree {
* in ram representation of the tree. extent_root is used for all allocations
* and for the extent tree extent_root root.
*/
-struct dirty_root;
+struct btrfs_dirty_root;
struct btrfs_root {
struct extent_buffer *node;
@@ -627,7 +627,7 @@ struct btrfs_root {
struct extent_buffer *commit_root;
struct btrfs_leaf_ref_tree *ref_tree;
struct btrfs_leaf_ref_tree ref_tree_struct;
- struct dirty_root *dirty_root;
+ struct btrfs_dirty_root *dirty_root;
struct btrfs_root_item root_item;
struct btrfs_key root_key;
@@ -1399,9 +1399,8 @@ static inline struct dentry *fdentry(struct file *file) {
}
/* extent-tree.c */
-u32 btrfs_count_snapshots_in_path(struct btrfs_root *root,
- struct btrfs_path *count_path,
- u64 expected_owner, u64 first_extent);
+int btrfs_cross_ref_exists(struct btrfs_root *root,
+ struct btrfs_key *key, u64 bytenr);
int btrfs_extent_post_op(struct btrfs_trans_handle *trans,
struct btrfs_root *root);
int btrfs_copy_pinned(struct btrfs_root *root, struct extent_io_tree *copy);