aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-10-15 16:18:55 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:56 -0400
commit810191ff3087e8143b41a944fcf4fd8c693f00e3 (patch)
tree9d23dd51458623eaac41bc8c89dd2998a2eda7ae /fs/btrfs/disk-io.c
parent3326d1b07c0cb6a2ff5b835b7a2cffa54124d074 (diff)
Btrfs: extent_map optimizations to cut down on CPU usage
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index fd7e6c182b9d..16f0260fca66 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -644,20 +644,20 @@ int close_ctree(struct btrfs_root *root)
644 644
645int btrfs_buffer_uptodate(struct extent_buffer *buf) 645int btrfs_buffer_uptodate(struct extent_buffer *buf)
646{ 646{
647 struct inode *btree_inode = buf->last_page->mapping->host; 647 struct inode *btree_inode = buf->first_page->mapping->host;
648 return extent_buffer_uptodate(&BTRFS_I(btree_inode)->extent_tree, buf); 648 return extent_buffer_uptodate(&BTRFS_I(btree_inode)->extent_tree, buf);
649} 649}
650 650
651int btrfs_set_buffer_uptodate(struct extent_buffer *buf) 651int btrfs_set_buffer_uptodate(struct extent_buffer *buf)
652{ 652{
653 struct inode *btree_inode = buf->last_page->mapping->host; 653 struct inode *btree_inode = buf->first_page->mapping->host;
654 return set_extent_buffer_uptodate(&BTRFS_I(btree_inode)->extent_tree, 654 return set_extent_buffer_uptodate(&BTRFS_I(btree_inode)->extent_tree,
655 buf); 655 buf);
656} 656}
657 657
658void btrfs_mark_buffer_dirty(struct extent_buffer *buf) 658void btrfs_mark_buffer_dirty(struct extent_buffer *buf)
659{ 659{
660 struct btrfs_root *root = BTRFS_I(buf->last_page->mapping->host)->root; 660 struct btrfs_root *root = BTRFS_I(buf->first_page->mapping->host)->root;
661 u64 transid = btrfs_header_generation(buf); 661 u64 transid = btrfs_header_generation(buf);
662 struct inode *btree_inode = root->fs_info->btree_inode; 662 struct inode *btree_inode = root->fs_info->btree_inode;
663 663
@@ -678,7 +678,7 @@ void btrfs_btree_balance_dirty(struct btrfs_root *root, unsigned long nr)
678 678
679void btrfs_set_buffer_defrag(struct extent_buffer *buf) 679void btrfs_set_buffer_defrag(struct extent_buffer *buf)
680{ 680{
681 struct btrfs_root *root = BTRFS_I(buf->last_page->mapping->host)->root; 681 struct btrfs_root *root = BTRFS_I(buf->first_page->mapping->host)->root;
682 struct inode *btree_inode = root->fs_info->btree_inode; 682 struct inode *btree_inode = root->fs_info->btree_inode;
683 set_extent_bits(&BTRFS_I(btree_inode)->extent_tree, buf->start, 683 set_extent_bits(&BTRFS_I(btree_inode)->extent_tree, buf->start,
684 buf->start + buf->len - 1, EXTENT_DEFRAG, GFP_NOFS); 684 buf->start + buf->len - 1, EXTENT_DEFRAG, GFP_NOFS);
@@ -686,7 +686,7 @@ void btrfs_set_buffer_defrag(struct extent_buffer *buf)
686 686
687void btrfs_set_buffer_defrag_done(struct extent_buffer *buf) 687void btrfs_set_buffer_defrag_done(struct extent_buffer *buf)
688{ 688{
689 struct btrfs_root *root = BTRFS_I(buf->last_page->mapping->host)->root; 689 struct btrfs_root *root = BTRFS_I(buf->first_page->mapping->host)->root;
690 struct inode *btree_inode = root->fs_info->btree_inode; 690 struct inode *btree_inode = root->fs_info->btree_inode;
691 set_extent_bits(&BTRFS_I(btree_inode)->extent_tree, buf->start, 691 set_extent_bits(&BTRFS_I(btree_inode)->extent_tree, buf->start,
692 buf->start + buf->len - 1, EXTENT_DEFRAG_DONE, 692 buf->start + buf->len - 1, EXTENT_DEFRAG_DONE,
@@ -695,7 +695,7 @@ void btrfs_set_buffer_defrag_done(struct extent_buffer *buf)
695 695
696int btrfs_buffer_defrag(struct extent_buffer *buf) 696int btrfs_buffer_defrag(struct extent_buffer *buf)
697{ 697{
698 struct btrfs_root *root = BTRFS_I(buf->last_page->mapping->host)->root; 698 struct btrfs_root *root = BTRFS_I(buf->first_page->mapping->host)->root;
699 struct inode *btree_inode = root->fs_info->btree_inode; 699 struct inode *btree_inode = root->fs_info->btree_inode;
700 return test_range_bit(&BTRFS_I(btree_inode)->extent_tree, 700 return test_range_bit(&BTRFS_I(btree_inode)->extent_tree,
701 buf->start, buf->start + buf->len - 1, EXTENT_DEFRAG, 0); 701 buf->start, buf->start + buf->len - 1, EXTENT_DEFRAG, 0);
@@ -703,7 +703,7 @@ int btrfs_buffer_defrag(struct extent_buffer *buf)
703 703
704int btrfs_buffer_defrag_done(struct extent_buffer *buf) 704int btrfs_buffer_defrag_done(struct extent_buffer *buf)
705{ 705{
706 struct btrfs_root *root = BTRFS_I(buf->last_page->mapping->host)->root; 706 struct btrfs_root *root = BTRFS_I(buf->first_page->mapping->host)->root;
707 struct inode *btree_inode = root->fs_info->btree_inode; 707 struct inode *btree_inode = root->fs_info->btree_inode;
708 return test_range_bit(&BTRFS_I(btree_inode)->extent_tree, 708 return test_range_bit(&BTRFS_I(btree_inode)->extent_tree,
709 buf->start, buf->start + buf->len - 1, 709 buf->start, buf->start + buf->len - 1,
@@ -712,7 +712,7 @@ int btrfs_buffer_defrag_done(struct extent_buffer *buf)
712 712
713int btrfs_clear_buffer_defrag_done(struct extent_buffer *buf) 713int btrfs_clear_buffer_defrag_done(struct extent_buffer *buf)
714{ 714{
715 struct btrfs_root *root = BTRFS_I(buf->last_page->mapping->host)->root; 715 struct btrfs_root *root = BTRFS_I(buf->first_page->mapping->host)->root;
716 struct inode *btree_inode = root->fs_info->btree_inode; 716 struct inode *btree_inode = root->fs_info->btree_inode;
717 return clear_extent_bits(&BTRFS_I(btree_inode)->extent_tree, 717 return clear_extent_bits(&BTRFS_I(btree_inode)->extent_tree,
718 buf->start, buf->start + buf->len - 1, 718 buf->start, buf->start + buf->len - 1,
@@ -721,7 +721,7 @@ int btrfs_clear_buffer_defrag_done(struct extent_buffer *buf)
721 721
722int btrfs_clear_buffer_defrag(struct extent_buffer *buf) 722int btrfs_clear_buffer_defrag(struct extent_buffer *buf)
723{ 723{
724 struct btrfs_root *root = BTRFS_I(buf->last_page->mapping->host)->root; 724 struct btrfs_root *root = BTRFS_I(buf->first_page->mapping->host)->root;
725 struct inode *btree_inode = root->fs_info->btree_inode; 725 struct inode *btree_inode = root->fs_info->btree_inode;
726 return clear_extent_bits(&BTRFS_I(btree_inode)->extent_tree, 726 return clear_extent_bits(&BTRFS_I(btree_inode)->extent_tree,
727 buf->start, buf->start + buf->len - 1, 727 buf->start, buf->start + buf->len - 1,
@@ -730,7 +730,7 @@ int btrfs_clear_buffer_defrag(struct extent_buffer *buf)
730 730
731int btrfs_read_buffer(struct extent_buffer *buf) 731int btrfs_read_buffer(struct extent_buffer *buf)
732{ 732{
733 struct btrfs_root *root = BTRFS_I(buf->last_page->mapping->host)->root; 733 struct btrfs_root *root = BTRFS_I(buf->first_page->mapping->host)->root;
734 struct inode *btree_inode = root->fs_info->btree_inode; 734 struct inode *btree_inode = root->fs_info->btree_inode;
735 return read_extent_buffer_pages(&BTRFS_I(btree_inode)->extent_tree, 735 return read_extent_buffer_pages(&BTRFS_I(btree_inode)->extent_tree,
736 buf, 1); 736 buf, 1);