summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index ae488aa1966a..a3f435e58987 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -151,6 +151,7 @@ static void btrfs_put_super(struct super_block *sb)
int ret;
ret = close_ctree(root);
+ free_fs_info(root->fs_info);
sb->s_fs_info = NULL;
(void)ret; /* FIXME: need to fix VFS to return error? */
@@ -589,6 +590,7 @@ static int btrfs_fill_super(struct super_block *sb,
struct inode *inode;
struct dentry *root_dentry;
struct btrfs_root *tree_root;
+ struct btrfs_fs_info *fs_info;
struct btrfs_key key;
int err;
@@ -609,12 +611,13 @@ static int btrfs_fill_super(struct super_block *sb,
printk("btrfs: open_ctree failed\n");
return PTR_ERR(tree_root);
}
+ fs_info = tree_root->fs_info;
sb->s_fs_info = tree_root;
key.objectid = BTRFS_FIRST_FREE_OBJECTID;
key.type = BTRFS_INODE_ITEM_KEY;
key.offset = 0;
- inode = btrfs_iget(sb, &key, tree_root->fs_info->fs_root, NULL);
+ inode = btrfs_iget(sb, &key, fs_info->fs_root, NULL);
if (IS_ERR(inode)) {
err = PTR_ERR(inode);
goto fail_close;
@@ -635,6 +638,7 @@ static int btrfs_fill_super(struct super_block *sb,
fail_close:
close_ctree(tree_root);
+ free_fs_info(fs_info);
return err;
}