diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-11-17 01:10:02 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-08 19:34:39 -0500 |
commit | ad2b2c802be2d3e8ed8364fef5ffaddabe448219 (patch) | |
tree | 5927c2170cd4edb1d930cabae0c6f0006aa972fd /fs | |
parent | e3029d9fd426c8f582210ba35551ae5506218345 (diff) |
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: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/disk-io.c | 12 | ||||
-rw-r--r-- | fs/btrfs/disk-io.h | 6 | ||||
-rw-r--r-- | fs/btrfs/super.c | 8 |
3 files changed, 13 insertions, 13 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 9308c7f13c17..78247522c693 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -1880,9 +1880,9 @@ static void free_root_pointers(struct btrfs_fs_info *info, int chunk_root) | |||
1880 | } | 1880 | } |
1881 | 1881 | ||
1882 | 1882 | ||
1883 | struct btrfs_root *open_ctree(struct super_block *sb, | 1883 | int open_ctree(struct super_block *sb, |
1884 | struct btrfs_fs_devices *fs_devices, | 1884 | struct btrfs_fs_devices *fs_devices, |
1885 | char *options) | 1885 | char *options) |
1886 | { | 1886 | { |
1887 | u32 sectorsize; | 1887 | u32 sectorsize; |
1888 | u32 nodesize; | 1888 | u32 nodesize; |
@@ -2428,11 +2428,11 @@ retry_root_backup: | |||
2428 | if (err) { | 2428 | if (err) { |
2429 | close_ctree(tree_root); | 2429 | close_ctree(tree_root); |
2430 | free_fs_info(fs_info); | 2430 | free_fs_info(fs_info); |
2431 | return ERR_PTR(err); | 2431 | return err; |
2432 | } | 2432 | } |
2433 | } | 2433 | } |
2434 | 2434 | ||
2435 | return tree_root; | 2435 | return 0; |
2436 | 2436 | ||
2437 | fail_trans_kthread: | 2437 | fail_trans_kthread: |
2438 | kthread_stop(fs_info->transaction_kthread); | 2438 | kthread_stop(fs_info->transaction_kthread); |
@@ -2479,7 +2479,7 @@ fail_srcu: | |||
2479 | fail: | 2479 | fail: |
2480 | btrfs_close_devices(fs_info->fs_devices); | 2480 | btrfs_close_devices(fs_info->fs_devices); |
2481 | free_fs_info(fs_info); | 2481 | free_fs_info(fs_info); |
2482 | return ERR_PTR(err); | 2482 | return err; |
2483 | 2483 | ||
2484 | recovery_tree_root: | 2484 | recovery_tree_root: |
2485 | if (!btrfs_test_opt(tree_root, RECOVERY)) | 2485 | if (!btrfs_test_opt(tree_root, RECOVERY)) |
diff --git a/fs/btrfs/disk-io.h b/fs/btrfs/disk-io.h index 2bb5f59ddf95..6f5f48778b00 100644 --- a/fs/btrfs/disk-io.h +++ b/fs/btrfs/disk-io.h | |||
@@ -46,9 +46,9 @@ struct extent_buffer *btrfs_find_create_tree_block(struct btrfs_root *root, | |||
46 | u64 bytenr, u32 blocksize); | 46 | u64 bytenr, u32 blocksize); |
47 | int clean_tree_block(struct btrfs_trans_handle *trans, | 47 | int clean_tree_block(struct btrfs_trans_handle *trans, |
48 | struct btrfs_root *root, struct extent_buffer *buf); | 48 | struct btrfs_root *root, struct extent_buffer *buf); |
49 | struct btrfs_root *open_ctree(struct super_block *sb, | 49 | int open_ctree(struct super_block *sb, |
50 | struct btrfs_fs_devices *fs_devices, | 50 | struct btrfs_fs_devices *fs_devices, |
51 | char *options); | 51 | char *options); |
52 | int close_ctree(struct btrfs_root *root); | 52 | int close_ctree(struct btrfs_root *root); |
53 | int write_ctree_super(struct btrfs_trans_handle *trans, | 53 | int write_ctree_super(struct btrfs_trans_handle *trans, |
54 | struct btrfs_root *root, int max_mirrors); | 54 | struct btrfs_root *root, int max_mirrors); |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index e9f876a1655b..56e007fd6702 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -604,12 +604,12 @@ static int btrfs_fill_super(struct super_block *sb, | |||
604 | sb->s_flags |= MS_POSIXACL; | 604 | sb->s_flags |= MS_POSIXACL; |
605 | #endif | 605 | #endif |
606 | 606 | ||
607 | tree_root = open_ctree(sb, fs_devices, (char *)data); | 607 | err = open_ctree(sb, fs_devices, (char *)data); |
608 | 608 | if (err) { | |
609 | if (IS_ERR(tree_root)) { | ||
610 | printk("btrfs: open_ctree failed\n"); | 609 | printk("btrfs: open_ctree failed\n"); |
611 | return PTR_ERR(tree_root); | 610 | return err; |
612 | } | 611 | } |
612 | tree_root = sb->s_fs_info; | ||
613 | fs_info = tree_root->fs_info; | 613 | fs_info = tree_root->fs_info; |
614 | sb->s_fs_info = tree_root; | 614 | sb->s_fs_info = tree_root; |
615 | 615 | ||