btrfs: make open_ctree() return int
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 17 Nov 2011 06:10:02 +0000 (01:10 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 9 Jan 2012 00:34:39 +0000 (19:34 -0500)
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: Al Viro <viro@zeniv.linux.org.uk>
fs/btrfs/disk-io.c
fs/btrfs/disk-io.h
fs/btrfs/super.c

index 9308c7f13c173bd64e49e796240b782da6ab8eaa..78247522c6934657fb346984ebff9a34e0abeb12 100644 (file)
@@ -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,
-                             struct btrfs_fs_devices *fs_devices,
-                             char *options)
+int open_ctree(struct super_block *sb,
+              struct btrfs_fs_devices *fs_devices,
+              char *options)
 {
        u32 sectorsize;
        u32 nodesize;
@@ -2428,11 +2428,11 @@ retry_root_backup:
                if (err) {
                        close_ctree(tree_root);
                        free_fs_info(fs_info);
-                       return ERR_PTR(err);
+                       return err;
                }
        }
 
-       return tree_root;
+       return 0;
 
 fail_trans_kthread:
        kthread_stop(fs_info->transaction_kthread);
@@ -2479,7 +2479,7 @@ fail_srcu:
 fail:
        btrfs_close_devices(fs_info->fs_devices);
        free_fs_info(fs_info);
-       return ERR_PTR(err);
+       return err;
 
 recovery_tree_root:
        if (!btrfs_test_opt(tree_root, RECOVERY))
index 2bb5f59ddf9539f2b63735896c08228304b4aba1..6f5f48778b00aff8a864c1e4acdcc4e815e0d82f 100644 (file)
@@ -46,9 +46,9 @@ struct extent_buffer *btrfs_find_create_tree_block(struct btrfs_root *root,
                                                   u64 bytenr, u32 blocksize);
 int clean_tree_block(struct btrfs_trans_handle *trans,
                     struct btrfs_root *root, struct extent_buffer *buf);
-struct btrfs_root *open_ctree(struct super_block *sb,
-                             struct btrfs_fs_devices *fs_devices,
-                             char *options);
+int open_ctree(struct super_block *sb,
+              struct btrfs_fs_devices *fs_devices,
+              char *options);
 int close_ctree(struct btrfs_root *root);
 int write_ctree_super(struct btrfs_trans_handle *trans,
                      struct btrfs_root *root, int max_mirrors);
index e9f876a1655b449354d5519e83b25619442c7f63..56e007fd670262c00a6934375b9da164c0eff0e4 100644 (file)
@@ -604,12 +604,12 @@ static int btrfs_fill_super(struct super_block *sb,
        sb->s_flags |= MS_POSIXACL;
 #endif
 
-       tree_root = open_ctree(sb, fs_devices, (char *)data);
-
-       if (IS_ERR(tree_root)) {
+       err = open_ctree(sb, fs_devices, (char *)data);
+       if (err) {
                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;
        sb->s_fs_info = tree_root;
 
This page took 0.031599 seconds and 5 git commands to generate.