diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2008-07-28 23:32:19 +0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 19:04:05 +0400 |
commit | 31153d81284934601d08110ac7698fd9a535e4c0 (patch) | |
tree | 38f873fea3012a58d2a8f4d439a9546443617878 /fs/btrfs/ctree.c | |
parent | 3a115f520f391b4ab14041bdd6eedb370d944fa6 (diff) | |
download | linux-31153d81284934601d08110ac7698fd9a535e4c0.tar.xz |
Btrfs: Add a leaf reference cache
Much of the IO done while dropping snapshots is done looking up
leaves in the filesystem trees to see if they point to any extents and
to drop the references on any extents found.
This creates a cache so that IO isn't required.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r-- | fs/btrfs/ctree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index ab4ac0365c7f..245eb00435dd 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -165,7 +165,7 @@ int btrfs_copy_root(struct btrfs_trans_handle *trans, btrfs_clear_header_flag(cow, BTRFS_HEADER_FLAG_WRITTEN); WARN_ON(btrfs_header_generation(buf) > trans->transid); - ret = btrfs_inc_ref(trans, new_root, buf); + ret = btrfs_inc_ref(trans, new_root, buf, 0); kfree(new_root); if (ret) @@ -232,7 +232,7 @@ int __btrfs_cow_block(struct btrfs_trans_handle *trans, WARN_ON(btrfs_header_generation(buf) > trans->transid); if (btrfs_header_generation(buf) != trans->transid) { different_trans = 1; - ret = btrfs_inc_ref(trans, root, buf); + ret = btrfs_inc_ref(trans, root, buf, 1); if (ret) return ret; } else { |