aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2011-05-11 15:26:06 -0400
committerJosef Bacik <josef@redhat.com>2011-05-23 13:03:12 -0400
commitd82a6f1d7e8b61ed5996334d0db66651bb43641d (patch)
tree5738ec75f7679bdc1b97aecbc5cad3464cc65541 /fs/btrfs/extent-tree.c
parent7e2355ba1a11649f0b212a29fdb9f47476f1248e (diff)
Btrfs: kill BTRFS_I(inode)->block_group
Originally this was going to be used as a way to give hints to the allocator, but frankly we can get much better hints elsewhere and it's not even used at all for anything usefull. In addition to be completely useless, when we initialize an inode we try and find a freeish block group to set as the inodes block group, and with a completely full 40gb fs this takes _forever_, so I imagine with say 1tb fs this is just unbearable. So just axe the thing altoghether, we don't need it and it saves us 8 bytes in the inode and saves us 500 microseconds per inode lookup in my testcase. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index a2ca561c70f0..9f0a4e3bd8a9 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -5319,6 +5319,7 @@ checks:
5319 btrfs_add_free_space(block_group, offset, 5319 btrfs_add_free_space(block_group, offset,
5320 search_start - offset); 5320 search_start - offset);
5321 BUG_ON(offset > search_start); 5321 BUG_ON(offset > search_start);
5322 btrfs_put_block_group(block_group);
5322 break; 5323 break;
5323loop: 5324loop:
5324 failed_cluster_refill = false; 5325 failed_cluster_refill = false;
@@ -5411,14 +5412,7 @@ loop:
5411 ret = -ENOSPC; 5412 ret = -ENOSPC;
5412 } else if (!ins->objectid) { 5413 } else if (!ins->objectid) {
5413 ret = -ENOSPC; 5414 ret = -ENOSPC;
5414 } 5415 } else if (ins->objectid) {
5415
5416 /* we found what we needed */
5417 if (ins->objectid) {
5418 if (!(data & BTRFS_BLOCK_GROUP_DATA))
5419 trans->block_group = block_group->key.objectid;
5420
5421 btrfs_put_block_group(block_group);
5422 ret = 0; 5416 ret = 0;
5423 } 5417 }
5424 5418