diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2008-12-12 10:03:38 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-12-12 10:03:38 -0500 |
commit | 17d217fe970d34720f4f1633dca73a6aa2f3d9d1 (patch) | |
tree | 4e2e716400cc45a6697475629f4c046b96ff76e7 /fs/btrfs/ctree.h | |
parent | e4404d6e8da678d852b7f767f665f8edf76c9e9f (diff) |
Btrfs: fix nodatasum handling in balancing code
Checksums on data can be disabled by mount option, so it's
possible some data extents don't have checksums or have
invalid checksums. This causes trouble for data relocation.
This patch contains following things to make data relocation
work.
1) make nodatasum/nodatacow mount option only affects new
files. Checksums and COW on data are only controlled by the
inode flags.
2) check the existence of checksum in the nodatacow checker.
If checksums exist, force COW the data extent. This ensure that
checksum for a given block is either valid or does not exist.
3) update data relocation code to properly handle the case
of checksum missing.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 8733081d97a3..b89999de4564 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -1702,7 +1702,7 @@ int btrfs_update_pinned_extents(struct btrfs_root *root, | |||
1702 | int btrfs_drop_leaf_ref(struct btrfs_trans_handle *trans, | 1702 | int btrfs_drop_leaf_ref(struct btrfs_trans_handle *trans, |
1703 | struct btrfs_root *root, struct extent_buffer *leaf); | 1703 | struct btrfs_root *root, struct extent_buffer *leaf); |
1704 | int btrfs_cross_ref_exist(struct btrfs_trans_handle *trans, | 1704 | int btrfs_cross_ref_exist(struct btrfs_trans_handle *trans, |
1705 | struct btrfs_root *root, u64 bytenr); | 1705 | struct btrfs_root *root, u64 objectid, u64 bytenr); |
1706 | int btrfs_extent_post_op(struct btrfs_trans_handle *trans, | 1706 | int btrfs_extent_post_op(struct btrfs_trans_handle *trans, |
1707 | struct btrfs_root *root); | 1707 | struct btrfs_root *root); |
1708 | int btrfs_copy_pinned(struct btrfs_root *root, struct extent_io_tree *copy); | 1708 | int btrfs_copy_pinned(struct btrfs_root *root, struct extent_io_tree *copy); |
@@ -1789,6 +1789,7 @@ int btrfs_reloc_tree_cache_ref(struct btrfs_trans_handle *trans, | |||
1789 | struct extent_buffer *buf, u64 orig_start); | 1789 | struct extent_buffer *buf, u64 orig_start); |
1790 | int btrfs_add_dead_reloc_root(struct btrfs_root *root); | 1790 | int btrfs_add_dead_reloc_root(struct btrfs_root *root); |
1791 | int btrfs_cleanup_reloc_trees(struct btrfs_root *root); | 1791 | int btrfs_cleanup_reloc_trees(struct btrfs_root *root); |
1792 | int btrfs_reloc_clone_csums(struct inode *inode, u64 file_pos, u64 len); | ||
1792 | u64 btrfs_reduce_alloc_profile(struct btrfs_root *root, u64 flags); | 1793 | u64 btrfs_reduce_alloc_profile(struct btrfs_root *root, u64 flags); |
1793 | /* ctree.c */ | 1794 | /* ctree.c */ |
1794 | int btrfs_previous_item(struct btrfs_root *root, | 1795 | int btrfs_previous_item(struct btrfs_root *root, |
@@ -1994,6 +1995,8 @@ struct btrfs_csum_item *btrfs_lookup_csum(struct btrfs_trans_handle *trans, | |||
1994 | int btrfs_csum_truncate(struct btrfs_trans_handle *trans, | 1995 | int btrfs_csum_truncate(struct btrfs_trans_handle *trans, |
1995 | struct btrfs_root *root, struct btrfs_path *path, | 1996 | struct btrfs_root *root, struct btrfs_path *path, |
1996 | u64 isize); | 1997 | u64 isize); |
1998 | int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, | ||
1999 | u64 end, struct list_head *list); | ||
1997 | /* inode.c */ | 2000 | /* inode.c */ |
1998 | 2001 | ||
1999 | /* RHEL and EL kernels have a patch that renames PG_checked to FsMisc */ | 2002 | /* RHEL and EL kernels have a patch that renames PG_checked to FsMisc */ |