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/transaction.c | |
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/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 968b84f17a19..e72a013d24bf 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -763,6 +763,8 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, | |||
763 | if (ret) | 763 | if (ret) |
764 | goto fail; | 764 | goto fail; |
765 | 765 | ||
766 | btrfs_record_root_in_trans(root); | ||
767 | btrfs_set_root_last_snapshot(&root->root_item, trans->transid); | ||
766 | memcpy(new_root_item, &root->root_item, sizeof(*new_root_item)); | 768 | memcpy(new_root_item, &root->root_item, sizeof(*new_root_item)); |
767 | 769 | ||
768 | key.objectid = objectid; | 770 | key.objectid = objectid; |