diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-01-29 09:59:12 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:03:59 -0400 |
commit | 70dec8079d78691e476cc6c7cede40656078ad30 (patch) | |
tree | 19ab80f247fc026c3f5a5713381e98372737227b /fs/btrfs/disk-io.c | |
parent | aadfeb6e39ad6bde080cb3ab23f4da57ccb25f4a (diff) |
Btrfs: extent_io and extent_state optimizations
The end_bio routines are changed to take a pointer to the extent state
struct, and the state tree is walked in order to set/clear appropriate
bits as IO completes. This greatly reduces the number of rbtree searches
done by the end_bio handlers, and reduces lock contention.
The extent_io releasepage function is changed to avoid expensive searches
for locked state.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 4c4ebea0b2a9..e29a0716f6a9 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -274,7 +274,7 @@ int btree_readpage(struct file *file, struct page *page) | |||
274 | return extent_read_full_page(tree, page, btree_get_extent); | 274 | return extent_read_full_page(tree, page, btree_get_extent); |
275 | } | 275 | } |
276 | 276 | ||
277 | static int btree_releasepage(struct page *page, gfp_t unused_gfp_flags) | 277 | static int btree_releasepage(struct page *page, gfp_t gfp_flags) |
278 | { | 278 | { |
279 | struct extent_io_tree *tree; | 279 | struct extent_io_tree *tree; |
280 | struct extent_map_tree *map; | 280 | struct extent_map_tree *map; |
@@ -282,7 +282,7 @@ static int btree_releasepage(struct page *page, gfp_t unused_gfp_flags) | |||
282 | 282 | ||
283 | tree = &BTRFS_I(page->mapping->host)->io_tree; | 283 | tree = &BTRFS_I(page->mapping->host)->io_tree; |
284 | map = &BTRFS_I(page->mapping->host)->extent_tree; | 284 | map = &BTRFS_I(page->mapping->host)->extent_tree; |
285 | ret = try_release_extent_mapping(map, tree, page); | 285 | ret = try_release_extent_mapping(map, tree, page, gfp_flags); |
286 | if (ret == 1) { | 286 | if (ret == 1) { |
287 | ClearPagePrivate(page); | 287 | ClearPagePrivate(page); |
288 | set_page_private(page, 0); | 288 | set_page_private(page, 0); |