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.h | |
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.h')
-rw-r--r-- | fs/btrfs/ctree.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 07d321552dbe..34ed23d64eb5 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -592,6 +592,10 @@ struct btrfs_fs_info { | |||
592 | u64 last_alloc; | 592 | u64 last_alloc; |
593 | u64 last_data_alloc; | 593 | u64 last_data_alloc; |
594 | 594 | ||
595 | spinlock_t ref_cache_lock; | ||
596 | u64 total_ref_cache_size; | ||
597 | u64 running_ref_cache_size; | ||
598 | |||
595 | u64 avail_data_alloc_bits; | 599 | u64 avail_data_alloc_bits; |
596 | u64 avail_metadata_alloc_bits; | 600 | u64 avail_metadata_alloc_bits; |
597 | u64 avail_system_alloc_bits; | 601 | u64 avail_system_alloc_bits; |
@@ -613,6 +617,8 @@ struct btrfs_root { | |||
613 | spinlock_t node_lock; | 617 | spinlock_t node_lock; |
614 | 618 | ||
615 | struct extent_buffer *commit_root; | 619 | struct extent_buffer *commit_root; |
620 | struct btrfs_leaf_ref_tree *ref_tree; | ||
621 | |||
616 | struct btrfs_root_item root_item; | 622 | struct btrfs_root_item root_item; |
617 | struct btrfs_key root_key; | 623 | struct btrfs_key root_key; |
618 | struct btrfs_fs_info *fs_info; | 624 | struct btrfs_fs_info *fs_info; |
@@ -1430,7 +1436,7 @@ int btrfs_reserve_extent(struct btrfs_trans_handle *trans, | |||
1430 | u64 search_end, struct btrfs_key *ins, | 1436 | u64 search_end, struct btrfs_key *ins, |
1431 | u64 data); | 1437 | u64 data); |
1432 | int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, | 1438 | int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, |
1433 | struct extent_buffer *buf); | 1439 | struct extent_buffer *buf, int cache_ref); |
1434 | int btrfs_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root | 1440 | int btrfs_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root |
1435 | *root, u64 bytenr, u64 num_bytes, | 1441 | *root, u64 bytenr, u64 num_bytes, |
1436 | u64 root_objectid, u64 ref_generation, | 1442 | u64 root_objectid, u64 ref_generation, |