aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2010-02-02 15:51:14 -0500
committerChris Mason <chris.mason@oracle.com>2010-03-15 11:00:13 -0400
commit5a1a3df1f6c86926cfe8657e6f9b4b4c2f467d60 (patch)
treebc73836bf0bde137da48eaff72dae75ee729aaba /fs/btrfs/inode.c
parentc2a128d28a2e78e159e17e8c9274d0a9d9492555 (diff)
Btrfs: cache ordered extent when completing io
When finishing io we run btrfs_dec_test_ordered_pending, and then immediately run btrfs_lookup_ordered_extent, but btrfs_dec_test_ordered_pending does that already, so we're searching twice when we don't have to. This patch lets us pass a btrfs_ordered_extent in to btrfs_dec_test_ordered_pending so if we do complete io on that ordered extent we can just use the one we found then instead of having to do another btrfs_lookup_ordered_extent. This made my fio job with the other patch go from 24 mb/s to 29 mb/s. Signed-off-by: Josef Bacik <josef@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 50ce8840a99b..1824dda1d351 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1698,11 +1698,10 @@ static int btrfs_finish_ordered_io(struct inode *inode, u64 start, u64 end)
1698 int compressed = 0; 1698 int compressed = 0;
1699 int ret; 1699 int ret;
1700 1700
1701 ret = btrfs_dec_test_ordered_pending(inode, start, end - start + 1); 1701 ret = btrfs_dec_test_ordered_pending(inode, &ordered_extent, start,
1702 end - start + 1);
1702 if (!ret) 1703 if (!ret)
1703 return 0; 1704 return 0;
1704
1705 ordered_extent = btrfs_lookup_ordered_extent(inode, start);
1706 BUG_ON(!ordered_extent); 1705 BUG_ON(!ordered_extent);
1707 1706
1708 if (test_bit(BTRFS_ORDERED_NOCOW, &ordered_extent->flags)) { 1707 if (test_bit(BTRFS_ORDERED_NOCOW, &ordered_extent->flags)) {