aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-01-24 16:13:08 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:59 -0400
commitd1310b2e0cd98eb1348553e69b73827b436dca7b (patch)
treef55e9c380df0f3a7e9fb792b2308b52b632b90aa /fs/btrfs/ctree.h
parent5f56406aabdf5444d040c5955effc665b1d0dbaf (diff)
Btrfs: Split the extent_map code into two parts
There is now extent_map for mapping offsets in the file to disk and extent_io for state tracking, IO submission and extent_bufers. The new extent_map code shifts from [start,end] pairs to [start,len], and pushes the locking out into the caller. This allows a few performance optimizations and is easier to use. A number of extent_map usage bugs were fixed, mostly with failing to remove extent_map entries when changing the file. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index b9f2975b55c9..6c65473e0fe3 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -27,6 +27,7 @@
27#include <linux/completion.h> 27#include <linux/completion.h>
28#include <asm/kmap_types.h> 28#include <asm/kmap_types.h>
29#include "bit-radix.h" 29#include "bit-radix.h"
30#include "extent_io.h"
30#include "extent_map.h" 31#include "extent_map.h"
31 32
32struct btrfs_trans_handle; 33struct btrfs_trans_handle;
@@ -314,11 +315,11 @@ struct btrfs_fs_info {
314 struct btrfs_root *tree_root; 315 struct btrfs_root *tree_root;
315 struct radix_tree_root fs_roots_radix; 316 struct radix_tree_root fs_roots_radix;
316 317
317 struct extent_map_tree free_space_cache; 318 struct extent_io_tree free_space_cache;
318 struct extent_map_tree block_group_cache; 319 struct extent_io_tree block_group_cache;
319 struct extent_map_tree pinned_extents; 320 struct extent_io_tree pinned_extents;
320 struct extent_map_tree pending_del; 321 struct extent_io_tree pending_del;
321 struct extent_map_tree extent_ins; 322 struct extent_io_tree extent_ins;
322 323
323 u64 generation; 324 u64 generation;
324 u64 last_trans_committed; 325 u64 last_trans_committed;
@@ -956,7 +957,7 @@ u32 btrfs_count_snapshots_in_path(struct btrfs_root *root,
956 u64 first_extent); 957 u64 first_extent);
957int btrfs_extent_post_op(struct btrfs_trans_handle *trans, 958int btrfs_extent_post_op(struct btrfs_trans_handle *trans,
958 struct btrfs_root *root); 959 struct btrfs_root *root);
959int btrfs_copy_pinned(struct btrfs_root *root, struct extent_map_tree *copy); 960int btrfs_copy_pinned(struct btrfs_root *root, struct extent_io_tree *copy);
960struct btrfs_block_group_cache *btrfs_lookup_block_group(struct 961struct btrfs_block_group_cache *btrfs_lookup_block_group(struct
961 btrfs_fs_info *info, 962 btrfs_fs_info *info,
962 u64 bytenr); 963 u64 bytenr);
@@ -1001,7 +1002,7 @@ int btrfs_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root
1001 u64 owner_objectid, u64 owner_offset, int pin); 1002 u64 owner_objectid, u64 owner_offset, int pin);
1002int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, 1003int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans,
1003 struct btrfs_root *root, 1004 struct btrfs_root *root,
1004 struct extent_map_tree *unpin); 1005 struct extent_io_tree *unpin);
1005int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans, 1006int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
1006 struct btrfs_root *root, 1007 struct btrfs_root *root,
1007 u64 bytenr, u64 num_bytes, 1008 u64 bytenr, u64 num_bytes,