summaryrefslogtreecommitdiffstats
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)
downloadop-kernel-dev-a68d5933a0e409592860229b35230c8e87155472.zip
op-kernel-dev-a68d5933a0e409592860229b35230c8e87155472.tar.gz
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 8e69b5a..30a5094 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -721,12 +721,14 @@ out:
u32 btrfs_count_snapshots_in_path(struct btrfs_root *root,
struct btrfs_path *count_path,
+ u64 expected_owner,
u64 first_extent)
{
struct btrfs_root *extent_root = root->fs_info->extent_root;
struct btrfs_path *path;
u64 bytenr;
u64 found_objectid;
+ u64 found_owner;
u64 root_objectid = root->root_key.objectid;
u32 total_count = 0;
u32 cur_count;
@@ -792,6 +794,13 @@ again:
total_count = 2;
goto out;
}
+ if (level == -1) {
+ found_owner = btrfs_ref_objectid(l, ref_item);
+ if (found_owner != expected_owner) {
+ total_count = 2;
+ goto out;
+ }
+ }
total_count = 1;
path->slots[0]++;
}
OpenPOWER on IntegriCloud