aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c47
1 files changed, 17 insertions, 30 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 8cb1d41ba501..69083330ee16 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -5718,7 +5718,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
5718 5718
5719 if (ret) { 5719 if (ret) {
5720 btrfs_err(info, "umm, got %d back from search, was looking for %llu", 5720 btrfs_err(info, "umm, got %d back from search, was looking for %llu",
5721 ret, (unsigned long long)bytenr); 5721 ret, bytenr);
5722 if (ret > 0) 5722 if (ret > 0)
5723 btrfs_print_leaf(extent_root, 5723 btrfs_print_leaf(extent_root,
5724 path->nodes[0]); 5724 path->nodes[0]);
@@ -5734,11 +5734,8 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
5734 WARN_ON(1); 5734 WARN_ON(1);
5735 btrfs_err(info, 5735 btrfs_err(info,
5736 "unable to find ref byte nr %llu parent %llu root %llu owner %llu offset %llu", 5736 "unable to find ref byte nr %llu parent %llu root %llu owner %llu offset %llu",
5737 (unsigned long long)bytenr, 5737 bytenr, parent, root_objectid, owner_objectid,
5738 (unsigned long long)parent, 5738 owner_offset);
5739 (unsigned long long)root_objectid,
5740 (unsigned long long)owner_objectid,
5741 (unsigned long long)owner_offset);
5742 } else { 5739 } else {
5743 btrfs_abort_transaction(trans, extent_root, ret); 5740 btrfs_abort_transaction(trans, extent_root, ret);
5744 goto out; 5741 goto out;
@@ -5767,7 +5764,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
5767 -1, 1); 5764 -1, 1);
5768 if (ret) { 5765 if (ret) {
5769 btrfs_err(info, "umm, got %d back from search, was looking for %llu", 5766 btrfs_err(info, "umm, got %d back from search, was looking for %llu",
5770 ret, (unsigned long long)bytenr); 5767 ret, bytenr);
5771 btrfs_print_leaf(extent_root, path->nodes[0]); 5768 btrfs_print_leaf(extent_root, path->nodes[0]);
5772 } 5769 }
5773 if (ret < 0) { 5770 if (ret < 0) {
@@ -6529,19 +6526,15 @@ static void dump_space_info(struct btrfs_space_info *info, u64 bytes,
6529 6526
6530 spin_lock(&info->lock); 6527 spin_lock(&info->lock);
6531 printk(KERN_INFO "space_info %llu has %llu free, is %sfull\n", 6528 printk(KERN_INFO "space_info %llu has %llu free, is %sfull\n",
6532 (unsigned long long)info->flags, 6529 info->flags,
6533 (unsigned long long)(info->total_bytes - info->bytes_used - 6530 info->total_bytes - info->bytes_used - info->bytes_pinned -
6534 info->bytes_pinned - info->bytes_reserved - 6531 info->bytes_reserved - info->bytes_readonly,
6535 info->bytes_readonly),
6536 (info->full) ? "" : "not "); 6532 (info->full) ? "" : "not ");
6537 printk(KERN_INFO "space_info total=%llu, used=%llu, pinned=%llu, " 6533 printk(KERN_INFO "space_info total=%llu, used=%llu, pinned=%llu, "
6538 "reserved=%llu, may_use=%llu, readonly=%llu\n", 6534 "reserved=%llu, may_use=%llu, readonly=%llu\n",
6539 (unsigned long long)info->total_bytes, 6535 info->total_bytes, info->bytes_used, info->bytes_pinned,
6540 (unsigned long long)info->bytes_used, 6536 info->bytes_reserved, info->bytes_may_use,
6541 (unsigned long long)info->bytes_pinned, 6537 info->bytes_readonly);
6542 (unsigned long long)info->bytes_reserved,
6543 (unsigned long long)info->bytes_may_use,
6544 (unsigned long long)info->bytes_readonly);
6545 spin_unlock(&info->lock); 6538 spin_unlock(&info->lock);
6546 6539
6547 if (!dump_block_groups) 6540 if (!dump_block_groups)
@@ -6552,12 +6545,9 @@ again:
6552 list_for_each_entry(cache, &info->block_groups[index], list) { 6545 list_for_each_entry(cache, &info->block_groups[index], list) {
6553 spin_lock(&cache->lock); 6546 spin_lock(&cache->lock);
6554 printk(KERN_INFO "block group %llu has %llu bytes, %llu used %llu pinned %llu reserved %s\n", 6547 printk(KERN_INFO "block group %llu has %llu bytes, %llu used %llu pinned %llu reserved %s\n",
6555 (unsigned long long)cache->key.objectid, 6548 cache->key.objectid, cache->key.offset,
6556 (unsigned long long)cache->key.offset, 6549 btrfs_block_group_used(&cache->item), cache->pinned,
6557 (unsigned long long)btrfs_block_group_used(&cache->item), 6550 cache->reserved, cache->ro ? "[readonly]" : "");
6558 (unsigned long long)cache->pinned,
6559 (unsigned long long)cache->reserved,
6560 cache->ro ? "[readonly]" : "");
6561 btrfs_dump_free_space(cache, bytes); 6551 btrfs_dump_free_space(cache, bytes);
6562 spin_unlock(&cache->lock); 6552 spin_unlock(&cache->lock);
6563 } 6553 }
@@ -6594,8 +6584,7 @@ again:
6594 6584
6595 sinfo = __find_space_info(root->fs_info, flags); 6585 sinfo = __find_space_info(root->fs_info, flags);
6596 btrfs_err(root->fs_info, "allocation failed flags %llu, wanted %llu", 6586 btrfs_err(root->fs_info, "allocation failed flags %llu, wanted %llu",
6597 (unsigned long long)flags, 6587 flags, num_bytes);
6598 (unsigned long long)num_bytes);
6599 if (sinfo) 6588 if (sinfo)
6600 dump_space_info(sinfo, num_bytes, 1); 6589 dump_space_info(sinfo, num_bytes, 1);
6601 } 6590 }
@@ -6615,7 +6604,7 @@ static int __btrfs_free_reserved_extent(struct btrfs_root *root,
6615 cache = btrfs_lookup_block_group(root->fs_info, start); 6604 cache = btrfs_lookup_block_group(root->fs_info, start);
6616 if (!cache) { 6605 if (!cache) {
6617 btrfs_err(root->fs_info, "Unable to find block group for %llu", 6606 btrfs_err(root->fs_info, "Unable to find block group for %llu",
6618 (unsigned long long)start); 6607 start);
6619 return -ENOSPC; 6608 return -ENOSPC;
6620 } 6609 }
6621 6610
@@ -6711,8 +6700,7 @@ static int alloc_reserved_file_extent(struct btrfs_trans_handle *trans,
6711 ret = update_block_group(root, ins->objectid, ins->offset, 1); 6700 ret = update_block_group(root, ins->objectid, ins->offset, 1);
6712 if (ret) { /* -ENOENT, logic error */ 6701 if (ret) { /* -ENOENT, logic error */
6713 btrfs_err(fs_info, "update block group failed for %llu %llu", 6702 btrfs_err(fs_info, "update block group failed for %llu %llu",
6714 (unsigned long long)ins->objectid, 6703 ins->objectid, ins->offset);
6715 (unsigned long long)ins->offset);
6716 BUG(); 6704 BUG();
6717 } 6705 }
6718 return ret; 6706 return ret;
@@ -6784,8 +6772,7 @@ static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
6784 ret = update_block_group(root, ins->objectid, root->leafsize, 1); 6772 ret = update_block_group(root, ins->objectid, root->leafsize, 1);
6785 if (ret) { /* -ENOENT, logic error */ 6773 if (ret) { /* -ENOENT, logic error */
6786 btrfs_err(fs_info, "update block group failed for %llu %llu", 6774 btrfs_err(fs_info, "update block group failed for %llu %llu",
6787 (unsigned long long)ins->objectid, 6775 ins->objectid, ins->offset);
6788 (unsigned long long)ins->offset);
6789 BUG(); 6776 BUG();
6790 } 6777 }
6791 return ret; 6778 return ret;