diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2008-10-30 14:20:02 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-10-30 14:20:02 -0400 |
commit | 80ff385665b7fca29fefe358a60ab0d09f9b8e87 (patch) | |
tree | 8a801d3f268d289b62f8dac87df8b757fb3b19d4 /fs/btrfs/ctree.h | |
parent | 6643558db29006825dbb10012b3f8890aca4bcd5 (diff) |
Btrfs: update nodatacow code v2
This patch simplifies the nodatacow checker. If all references
were created after the latest snapshot, then we can avoid COW
safely. This patch also updates run_delalloc_nocow to do more
fine-grained checking.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index ca5547af6090..8bf6a085a730 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -454,6 +454,7 @@ struct btrfs_root_item { | |||
454 | __le64 bytenr; | 454 | __le64 bytenr; |
455 | __le64 byte_limit; | 455 | __le64 byte_limit; |
456 | __le64 bytes_used; | 456 | __le64 bytes_used; |
457 | __le64 last_snapshot; | ||
457 | __le32 flags; | 458 | __le32 flags; |
458 | __le32 refs; | 459 | __le32 refs; |
459 | struct btrfs_disk_key drop_progress; | 460 | struct btrfs_disk_key drop_progress; |
@@ -1413,6 +1414,8 @@ BTRFS_SETGET_STACK_FUNCS(root_refs, struct btrfs_root_item, refs, 32); | |||
1413 | BTRFS_SETGET_STACK_FUNCS(root_flags, struct btrfs_root_item, flags, 32); | 1414 | BTRFS_SETGET_STACK_FUNCS(root_flags, struct btrfs_root_item, flags, 32); |
1414 | BTRFS_SETGET_STACK_FUNCS(root_used, struct btrfs_root_item, bytes_used, 64); | 1415 | BTRFS_SETGET_STACK_FUNCS(root_used, struct btrfs_root_item, bytes_used, 64); |
1415 | BTRFS_SETGET_STACK_FUNCS(root_limit, struct btrfs_root_item, byte_limit, 64); | 1416 | BTRFS_SETGET_STACK_FUNCS(root_limit, struct btrfs_root_item, byte_limit, 64); |
1417 | BTRFS_SETGET_STACK_FUNCS(root_last_snapshot, struct btrfs_root_item, | ||
1418 | last_snapshot, 64); | ||
1416 | 1419 | ||
1417 | /* struct btrfs_super_block */ | 1420 | /* struct btrfs_super_block */ |
1418 | BTRFS_SETGET_STACK_FUNCS(super_bytenr, struct btrfs_super_block, bytenr, 64); | 1421 | BTRFS_SETGET_STACK_FUNCS(super_bytenr, struct btrfs_super_block, bytenr, 64); |
@@ -1564,9 +1567,8 @@ int btrfs_update_pinned_extents(struct btrfs_root *root, | |||
1564 | u64 bytenr, u64 num, int pin); | 1567 | u64 bytenr, u64 num, int pin); |
1565 | int btrfs_drop_leaf_ref(struct btrfs_trans_handle *trans, | 1568 | int btrfs_drop_leaf_ref(struct btrfs_trans_handle *trans, |
1566 | struct btrfs_root *root, struct extent_buffer *leaf); | 1569 | struct btrfs_root *root, struct extent_buffer *leaf); |
1567 | int btrfs_cross_ref_exists(struct btrfs_trans_handle *trans, | 1570 | int btrfs_cross_ref_exist(struct btrfs_trans_handle *trans, |
1568 | struct btrfs_root *root, | 1571 | struct btrfs_root *root, u64 bytenr); |
1569 | struct btrfs_key *key, u64 bytenr); | ||
1570 | int btrfs_extent_post_op(struct btrfs_trans_handle *trans, | 1572 | int btrfs_extent_post_op(struct btrfs_trans_handle *trans, |
1571 | struct btrfs_root *root); | 1573 | struct btrfs_root *root); |
1572 | int btrfs_copy_pinned(struct btrfs_root *root, struct extent_io_tree *copy); | 1574 | int btrfs_copy_pinned(struct btrfs_root *root, struct extent_io_tree *copy); |