diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2008-07-28 15:32:19 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:05 -0400 |
commit | 31153d81284934601d08110ac7698fd9a535e4c0 (patch) | |
tree | 38f873fea3012a58d2a8f4d439a9546443617878 /fs/btrfs/ctree.c | |
parent | 3a115f520f391b4ab14041bdd6eedb370d944fa6 (diff) |
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, | |||
165 | btrfs_clear_header_flag(cow, BTRFS_HEADER_FLAG_WRITTEN); | 165 | btrfs_clear_header_flag(cow, BTRFS_HEADER_FLAG_WRITTEN); |
166 | 166 | ||
167 | WARN_ON(btrfs_header_generation(buf) > trans->transid); | 167 | WARN_ON(btrfs_header_generation(buf) > trans->transid); |
168 | ret = btrfs_inc_ref(trans, new_root, buf); | 168 | ret = btrfs_inc_ref(trans, new_root, buf, 0); |
169 | kfree(new_root); | 169 | kfree(new_root); |
170 | 170 | ||
171 | if (ret) | 171 | if (ret) |
@@ -232,7 +232,7 @@ int __btrfs_cow_block(struct btrfs_trans_handle *trans, | |||
232 | WARN_ON(btrfs_header_generation(buf) > trans->transid); | 232 | WARN_ON(btrfs_header_generation(buf) > trans->transid); |
233 | if (btrfs_header_generation(buf) != trans->transid) { | 233 | if (btrfs_header_generation(buf) != trans->transid) { |
234 | different_trans = 1; | 234 | different_trans = 1; |
235 | ret = btrfs_inc_ref(trans, root, buf); | 235 | ret = btrfs_inc_ref(trans, root, buf, 1); |
236 | if (ret) | 236 | if (ret) |
237 | return ret; | 237 | return ret; |
238 | } else { | 238 | } else { |