aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-05-08 14:11:56 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:02 -0400
commita68d5933a0e409592860229b35230c8e87155472 (patch)
treef58e963b03034935429b42be735ee59cd06110e1 /fs/btrfs/extent-tree.c
parentbf4ef67924d87b0addb32f084e83a9283496350e (diff)
Btrfs: Update nodatacow mode to support cloned single files and resizing
Before, nodatacow only checked to make sure multiple roots didn't have references on a single extent. This check makes sure that multiple inodes don't have references. nodatacow needed an extra check to see if the block group was currently readonly. This way cows forced by the chunk relocation code are honored. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 8e69b5acfeff..30a5094fffa7 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -721,12 +721,14 @@ out:
721 721
722u32 btrfs_count_snapshots_in_path(struct btrfs_root *root, 722u32 btrfs_count_snapshots_in_path(struct btrfs_root *root,
723 struct btrfs_path *count_path, 723 struct btrfs_path *count_path,
724 u64 expected_owner,
724 u64 first_extent) 725 u64 first_extent)
725{ 726{
726 struct btrfs_root *extent_root = root->fs_info->extent_root; 727 struct btrfs_root *extent_root = root->fs_info->extent_root;
727 struct btrfs_path *path; 728 struct btrfs_path *path;
728 u64 bytenr; 729 u64 bytenr;
729 u64 found_objectid; 730 u64 found_objectid;
731 u64 found_owner;
730 u64 root_objectid = root->root_key.objectid; 732 u64 root_objectid = root->root_key.objectid;
731 u32 total_count = 0; 733 u32 total_count = 0;
732 u32 cur_count; 734 u32 cur_count;
@@ -792,6 +794,13 @@ again:
792 total_count = 2; 794 total_count = 2;
793 goto out; 795 goto out;
794 } 796 }
797 if (level == -1) {
798 found_owner = btrfs_ref_objectid(l, ref_item);
799 if (found_owner != expected_owner) {
800 total_count = 2;
801 goto out;
802 }
803 }
795 total_count = 1; 804 total_count = 1;
796 path->slots[0]++; 805 path->slots[0]++;
797 } 806 }