diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-01-24 16:13:08 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:03:59 -0400 |
commit | d1310b2e0cd98eb1348553e69b73827b436dca7b (patch) | |
tree | f55e9c380df0f3a7e9fb792b2308b52b632b90aa /fs/btrfs/transaction.c | |
parent | 5f56406aabdf5444d040c5955effc665b1d0dbaf (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/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 163c01a24498..b4a1bc62a784 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -70,7 +70,7 @@ static int join_transaction(struct btrfs_root *root) | |||
70 | INIT_LIST_HEAD(&cur_trans->pending_snapshots); | 70 | INIT_LIST_HEAD(&cur_trans->pending_snapshots); |
71 | list_add_tail(&cur_trans->list, &root->fs_info->trans_list); | 71 | list_add_tail(&cur_trans->list, &root->fs_info->trans_list); |
72 | btrfs_ordered_inode_tree_init(&cur_trans->ordered_inode_tree); | 72 | btrfs_ordered_inode_tree_init(&cur_trans->ordered_inode_tree); |
73 | extent_map_tree_init(&cur_trans->dirty_pages, | 73 | extent_io_tree_init(&cur_trans->dirty_pages, |
74 | root->fs_info->btree_inode->i_mapping, | 74 | root->fs_info->btree_inode->i_mapping, |
75 | GFP_NOFS); | 75 | GFP_NOFS); |
76 | } else { | 76 | } else { |
@@ -153,7 +153,7 @@ int btrfs_write_and_wait_transaction(struct btrfs_trans_handle *trans, | |||
153 | int ret; | 153 | int ret; |
154 | int err; | 154 | int err; |
155 | int werr = 0; | 155 | int werr = 0; |
156 | struct extent_map_tree *dirty_pages; | 156 | struct extent_io_tree *dirty_pages; |
157 | struct page *page; | 157 | struct page *page; |
158 | struct inode *btree_inode = root->fs_info->btree_inode; | 158 | struct inode *btree_inode = root->fs_info->btree_inode; |
159 | u64 start; | 159 | u64 start; |
@@ -610,7 +610,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, | |||
610 | struct btrfs_transaction *cur_trans; | 610 | struct btrfs_transaction *cur_trans; |
611 | struct btrfs_transaction *prev_trans = NULL; | 611 | struct btrfs_transaction *prev_trans = NULL; |
612 | struct list_head dirty_fs_roots; | 612 | struct list_head dirty_fs_roots; |
613 | struct extent_map_tree *pinned_copy; | 613 | struct extent_io_tree *pinned_copy; |
614 | DEFINE_WAIT(wait); | 614 | DEFINE_WAIT(wait); |
615 | int ret; | 615 | int ret; |
616 | 616 | ||
@@ -639,7 +639,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, | |||
639 | if (!pinned_copy) | 639 | if (!pinned_copy) |
640 | return -ENOMEM; | 640 | return -ENOMEM; |
641 | 641 | ||
642 | extent_map_tree_init(pinned_copy, | 642 | extent_io_tree_init(pinned_copy, |
643 | root->fs_info->btree_inode->i_mapping, GFP_NOFS); | 643 | root->fs_info->btree_inode->i_mapping, GFP_NOFS); |
644 | 644 | ||
645 | trans->transaction->in_commit = 1; | 645 | trans->transaction->in_commit = 1; |