Btrfs: Reduce stack usage in the resizer, fix 32 bit compiles
Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index de026d9..67d9fd72 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -374,6 +374,7 @@
root->highest_inode = 0;
root->last_inode_alloc = 0;
root->name = NULL;
+ root->in_sysfs = 0;
memset(&root->root_key, 0, sizeof(root->root_key));
memset(&root->root_item, 0, sizeof(root->root_item));
memset(&root->defrag_progress, 0, sizeof(root->defrag_progress));
@@ -516,6 +517,9 @@
if (!root)
return NULL;
+ if (root->in_sysfs)
+ return root;
+
ret = btrfs_set_root_name(root, name, namelen);
if (ret) {
free_extent_buffer(root->node);
@@ -530,6 +534,7 @@
kfree(root);
return ERR_PTR(ret);
}
+ root->in_sysfs = 1;
return root;
}
#if 0