aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2011-04-05 13:02:27 -0400
committerJosef Bacik <josef@redhat.com>2011-04-08 13:00:34 -0400
commit12ddb96cb6752218d8a1aeb696ec9b0ca7adb42f (patch)
treecffdb38f2f479dde85d5f96879e53ac4b8f4d6ef /fs/btrfs
parent06d5a5899d6d3ac401d2359b5eac6d2a3a0fe331 (diff)
Btrfs: map the inode item when doing fill_inode_item
Instead of calling kmap_atomic for every thing we set in the inode item, map the entire inode item at the start and unmap it at the end. This makes a sequential dd of 400mb O_DIRECT something like 1% faster. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/inode.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index cc6022842e0c..da2680263d9f 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -2589,6 +2589,13 @@ static void fill_inode_item(struct btrfs_trans_handle *trans,
2589 struct btrfs_inode_item *item, 2589 struct btrfs_inode_item *item,
2590 struct inode *inode) 2590 struct inode *inode)
2591{ 2591{
2592 if (!leaf->map_token)
2593 map_private_extent_buffer(leaf, (unsigned long)item,
2594 sizeof(struct btrfs_inode_item),
2595 &leaf->map_token, &leaf->kaddr,
2596 &leaf->map_start, &leaf->map_len,
2597 KM_USER1);
2598
2592 btrfs_set_inode_uid(leaf, item, inode->i_uid); 2599 btrfs_set_inode_uid(leaf, item, inode->i_uid);
2593 btrfs_set_inode_gid(leaf, item, inode->i_gid); 2600 btrfs_set_inode_gid(leaf, item, inode->i_gid);
2594 btrfs_set_inode_size(leaf, item, BTRFS_I(inode)->disk_i_size); 2601 btrfs_set_inode_size(leaf, item, BTRFS_I(inode)->disk_i_size);
@@ -2617,6 +2624,11 @@ static void fill_inode_item(struct btrfs_trans_handle *trans,
2617 btrfs_set_inode_rdev(leaf, item, inode->i_rdev); 2624 btrfs_set_inode_rdev(leaf, item, inode->i_rdev);
2618 btrfs_set_inode_flags(leaf, item, BTRFS_I(inode)->flags); 2625 btrfs_set_inode_flags(leaf, item, BTRFS_I(inode)->flags);
2619 btrfs_set_inode_block_group(leaf, item, BTRFS_I(inode)->block_group); 2626 btrfs_set_inode_block_group(leaf, item, BTRFS_I(inode)->block_group);
2627
2628 if (leaf->map_token) {
2629 unmap_extent_buffer(leaf, leaf->map_token, KM_USER1);
2630 leaf->map_token = NULL;
2631 }
2620} 2632}
2621 2633
2622/* 2634/*