diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2009-06-27 21:07:35 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-07-02 13:41:17 -0400 |
commit | 2c47e605a91dde6b0514f689645e7ab336c8592a (patch) | |
tree | d541e61440f06f37d17e2d14cbaa78fc0cd41ff2 /fs/btrfs/ctree.h | |
parent | a970b0a16cc416a509d5ae8b1d70978664e6f4fe (diff) |
Btrfs: update backrefs while dropping snapshot
The new backref format has restriction on type of backref item. If a tree
block isn't referenced by its owner tree, full backrefs must be used for the
pointers in it. When a tree block loses its owner tree's reference, backrefs
for the pointers in it should be updated to full backrefs. Current
btrfs_drop_snapshot misses the code that updates backrefs, so it's unsafe for
general use.
This patch adds backrefs update code to btrfs_drop_snapshot. It isn't a
problem in the restricted form btrfs_drop_snapshot is used today, but for
general snapshot deletion this update is required.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 03441a99ea38..a404ecc53eb1 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -2076,8 +2076,7 @@ static inline int btrfs_insert_empty_item(struct btrfs_trans_handle *trans, | |||
2076 | int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path); | 2076 | int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path); |
2077 | int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path); | 2077 | int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path); |
2078 | int btrfs_leaf_free_space(struct btrfs_root *root, struct extent_buffer *leaf); | 2078 | int btrfs_leaf_free_space(struct btrfs_root *root, struct extent_buffer *leaf); |
2079 | int btrfs_drop_snapshot(struct btrfs_trans_handle *trans, struct btrfs_root | 2079 | int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref); |
2080 | *root); | ||
2081 | int btrfs_drop_subtree(struct btrfs_trans_handle *trans, | 2080 | int btrfs_drop_subtree(struct btrfs_trans_handle *trans, |
2082 | struct btrfs_root *root, | 2081 | struct btrfs_root *root, |
2083 | struct extent_buffer *node, | 2082 | struct extent_buffer *node, |