提交 ad2b2c80 编写于 作者: A Al Viro

btrfs: make open_ctree() return int

It returns either ERR_PTR(-ve) or sb->s_fs_info.  The latter can
be found by caller just as well, TYVM, no need to return it.  Just
return -ve or 0...
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 e3029d9f
...@@ -1880,9 +1880,9 @@ static void free_root_pointers(struct btrfs_fs_info *info, int chunk_root) ...@@ -1880,9 +1880,9 @@ static void free_root_pointers(struct btrfs_fs_info *info, int chunk_root)
} }
struct btrfs_root *open_ctree(struct super_block *sb, int open_ctree(struct super_block *sb,
struct btrfs_fs_devices *fs_devices, struct btrfs_fs_devices *fs_devices,
char *options) char *options)
{ {
u32 sectorsize; u32 sectorsize;
u32 nodesize; u32 nodesize;
...@@ -2428,11 +2428,11 @@ struct btrfs_root *open_ctree(struct super_block *sb, ...@@ -2428,11 +2428,11 @@ struct btrfs_root *open_ctree(struct super_block *sb,
if (err) { if (err) {
close_ctree(tree_root); close_ctree(tree_root);
free_fs_info(fs_info); free_fs_info(fs_info);
return ERR_PTR(err); return err;
} }
} }
return tree_root; return 0;
fail_trans_kthread: fail_trans_kthread:
kthread_stop(fs_info->transaction_kthread); kthread_stop(fs_info->transaction_kthread);
...@@ -2479,7 +2479,7 @@ struct btrfs_root *open_ctree(struct super_block *sb, ...@@ -2479,7 +2479,7 @@ struct btrfs_root *open_ctree(struct super_block *sb,
fail: fail:
btrfs_close_devices(fs_info->fs_devices); btrfs_close_devices(fs_info->fs_devices);
free_fs_info(fs_info); free_fs_info(fs_info);
return ERR_PTR(err); return err;
recovery_tree_root: recovery_tree_root:
if (!btrfs_test_opt(tree_root, RECOVERY)) if (!btrfs_test_opt(tree_root, RECOVERY))
......
...@@ -46,9 +46,9 @@ struct extent_buffer *btrfs_find_create_tree_block(struct btrfs_root *root, ...@@ -46,9 +46,9 @@ struct extent_buffer *btrfs_find_create_tree_block(struct btrfs_root *root,
u64 bytenr, u32 blocksize); u64 bytenr, u32 blocksize);
int clean_tree_block(struct btrfs_trans_handle *trans, int clean_tree_block(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct extent_buffer *buf); struct btrfs_root *root, struct extent_buffer *buf);
struct btrfs_root *open_ctree(struct super_block *sb, int open_ctree(struct super_block *sb,
struct btrfs_fs_devices *fs_devices, struct btrfs_fs_devices *fs_devices,
char *options); char *options);
int close_ctree(struct btrfs_root *root); int close_ctree(struct btrfs_root *root);
int write_ctree_super(struct btrfs_trans_handle *trans, int write_ctree_super(struct btrfs_trans_handle *trans,
struct btrfs_root *root, int max_mirrors); struct btrfs_root *root, int max_mirrors);
......
...@@ -604,12 +604,12 @@ static int btrfs_fill_super(struct super_block *sb, ...@@ -604,12 +604,12 @@ static int btrfs_fill_super(struct super_block *sb,
sb->s_flags |= MS_POSIXACL; sb->s_flags |= MS_POSIXACL;
#endif #endif
tree_root = open_ctree(sb, fs_devices, (char *)data); err = open_ctree(sb, fs_devices, (char *)data);
if (err) {
if (IS_ERR(tree_root)) {
printk("btrfs: open_ctree failed\n"); printk("btrfs: open_ctree failed\n");
return PTR_ERR(tree_root); return err;
} }
tree_root = sb->s_fs_info;
fs_info = tree_root->fs_info; fs_info = tree_root->fs_info;
sb->s_fs_info = tree_root; sb->s_fs_info = tree_root;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册