aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorYan, Zheng <zheng.yan@oracle.com>2010-05-16 10:49:59 -0400
committerChris Mason <chris.mason@oracle.com>2010-05-25 10:34:53 -0400
commit4a500fd178c89b96fa166a2d9e7855df33429841 (patch)
treeb97fe0b0c1cb19388fcf28f77cd74a645ec69a61 /fs/btrfs/disk-io.c
parentd68fc57b7e3245cfacf2e3b47acfed1946a11786 (diff)
Btrfs: Metadata ENOSPC handling for tree log
Previous patches make the allocater return -ENOSPC if there is no unreserved free metadata space. This patch updates tree log code and various other places to propagate/handle the ENOSPC error. Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 82955b73a962..a8772b5a9cb5 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -972,42 +972,6 @@ static int find_and_setup_root(struct btrfs_root *tree_root,
972 return 0; 972 return 0;
973} 973}
974 974
975int btrfs_free_log_root_tree(struct btrfs_trans_handle *trans,
976 struct btrfs_fs_info *fs_info)
977{
978 struct extent_buffer *eb;
979 struct btrfs_root *log_root_tree = fs_info->log_root_tree;
980 u64 start = 0;
981 u64 end = 0;
982 int ret;
983
984 if (!log_root_tree)
985 return 0;
986
987 while (1) {
988 ret = find_first_extent_bit(&log_root_tree->dirty_log_pages,
989 0, &start, &end, EXTENT_DIRTY | EXTENT_NEW);
990 if (ret)
991 break;
992
993 clear_extent_bits(&log_root_tree->dirty_log_pages, start, end,
994 EXTENT_DIRTY | EXTENT_NEW, GFP_NOFS);
995 }
996 eb = fs_info->log_root_tree->node;
997
998 WARN_ON(btrfs_header_level(eb) != 0);
999 WARN_ON(btrfs_header_nritems(eb) != 0);
1000
1001 ret = btrfs_free_reserved_extent(fs_info->tree_root,
1002 eb->start, eb->len);
1003 BUG_ON(ret);
1004
1005 free_extent_buffer(eb);
1006 kfree(fs_info->log_root_tree);
1007 fs_info->log_root_tree = NULL;
1008 return 0;
1009}
1010
1011static struct btrfs_root *alloc_log_tree(struct btrfs_trans_handle *trans, 975static struct btrfs_root *alloc_log_tree(struct btrfs_trans_handle *trans,
1012 struct btrfs_fs_info *fs_info) 976 struct btrfs_fs_info *fs_info)
1013{ 977{