diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-11-17 00:32:06 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-08 19:34:36 -0500 |
commit | 2eb34cd368b3e5cef960ae9d9971a037cd6fa9d3 (patch) | |
tree | 44a64d151c1d3c6b7941b2aa059d08fe7d175974 /fs/btrfs/disk-io.c | |
parent | 10f6327b5d26660e06120ba17cff993cb616b1d2 (diff) |
btrfs: sanitizing ->fs_info, part 1
take assignment of ->fs_info to callers of __setup_root()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index dcb5d949b543..04eba10af825 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -1142,7 +1142,6 @@ static int __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize, | |||
1142 | root->orphan_item_inserted = 0; | 1142 | root->orphan_item_inserted = 0; |
1143 | root->orphan_cleanup_state = 0; | 1143 | root->orphan_cleanup_state = 0; |
1144 | 1144 | ||
1145 | root->fs_info = fs_info; | ||
1146 | root->objectid = objectid; | 1145 | root->objectid = objectid; |
1147 | root->last_trans = 0; | 1146 | root->last_trans = 0; |
1148 | root->highest_objectid = 0; | 1147 | root->highest_objectid = 0; |
@@ -1193,6 +1192,7 @@ static int find_and_setup_root(struct btrfs_root *tree_root, | |||
1193 | u32 blocksize; | 1192 | u32 blocksize; |
1194 | u64 generation; | 1193 | u64 generation; |
1195 | 1194 | ||
1195 | root->fs_info = fs_info; | ||
1196 | __setup_root(tree_root->nodesize, tree_root->leafsize, | 1196 | __setup_root(tree_root->nodesize, tree_root->leafsize, |
1197 | tree_root->sectorsize, tree_root->stripesize, | 1197 | tree_root->sectorsize, tree_root->stripesize, |
1198 | root, fs_info, objectid); | 1198 | root, fs_info, objectid); |
@@ -1227,6 +1227,7 @@ static struct btrfs_root *alloc_log_tree(struct btrfs_trans_handle *trans, | |||
1227 | if (!root) | 1227 | if (!root) |
1228 | return ERR_PTR(-ENOMEM); | 1228 | return ERR_PTR(-ENOMEM); |
1229 | 1229 | ||
1230 | root->fs_info = fs_info; | ||
1230 | __setup_root(tree_root->nodesize, tree_root->leafsize, | 1231 | __setup_root(tree_root->nodesize, tree_root->leafsize, |
1231 | tree_root->sectorsize, tree_root->stripesize, | 1232 | tree_root->sectorsize, tree_root->stripesize, |
1232 | root, fs_info, BTRFS_TREE_LOG_OBJECTID); | 1233 | root, fs_info, BTRFS_TREE_LOG_OBJECTID); |
@@ -1330,6 +1331,7 @@ struct btrfs_root *btrfs_read_fs_root_no_radix(struct btrfs_root *tree_root, | |||
1330 | goto out; | 1331 | goto out; |
1331 | } | 1332 | } |
1332 | 1333 | ||
1334 | root->fs_info = fs_info; | ||
1333 | __setup_root(tree_root->nodesize, tree_root->leafsize, | 1335 | __setup_root(tree_root->nodesize, tree_root->leafsize, |
1334 | tree_root->sectorsize, tree_root->stripesize, | 1336 | tree_root->sectorsize, tree_root->stripesize, |
1335 | root, fs_info, location->objectid); | 1337 | root, fs_info, location->objectid); |
@@ -2055,6 +2057,7 @@ struct btrfs_root *open_ctree(struct super_block *sb, | |||
2055 | init_waitqueue_head(&fs_info->transaction_blocked_wait); | 2057 | init_waitqueue_head(&fs_info->transaction_blocked_wait); |
2056 | init_waitqueue_head(&fs_info->async_submit_wait); | 2058 | init_waitqueue_head(&fs_info->async_submit_wait); |
2057 | 2059 | ||
2060 | tree_root->fs_info = fs_info; | ||
2058 | __setup_root(4096, 4096, 4096, 4096, tree_root, | 2061 | __setup_root(4096, 4096, 4096, 4096, tree_root, |
2059 | fs_info, BTRFS_ROOT_TREE_OBJECTID); | 2062 | fs_info, BTRFS_ROOT_TREE_OBJECTID); |
2060 | 2063 | ||
@@ -2247,6 +2250,7 @@ struct btrfs_root *open_ctree(struct super_block *sb, | |||
2247 | btrfs_super_chunk_root_level(disk_super)); | 2250 | btrfs_super_chunk_root_level(disk_super)); |
2248 | generation = btrfs_super_chunk_root_generation(disk_super); | 2251 | generation = btrfs_super_chunk_root_generation(disk_super); |
2249 | 2252 | ||
2253 | chunk_root->fs_info = fs_info; | ||
2250 | __setup_root(nodesize, leafsize, sectorsize, stripesize, | 2254 | __setup_root(nodesize, leafsize, sectorsize, stripesize, |
2251 | chunk_root, fs_info, BTRFS_CHUNK_TREE_OBJECTID); | 2255 | chunk_root, fs_info, BTRFS_CHUNK_TREE_OBJECTID); |
2252 | 2256 | ||
@@ -2373,6 +2377,7 @@ retry_root_backup: | |||
2373 | goto fail_trans_kthread; | 2377 | goto fail_trans_kthread; |
2374 | } | 2378 | } |
2375 | 2379 | ||
2380 | log_tree_root->fs_info = fs_info; | ||
2376 | __setup_root(nodesize, leafsize, sectorsize, stripesize, | 2381 | __setup_root(nodesize, leafsize, sectorsize, stripesize, |
2377 | log_tree_root, fs_info, BTRFS_TREE_LOG_OBJECTID); | 2382 | log_tree_root, fs_info, BTRFS_TREE_LOG_OBJECTID); |
2378 | 2383 | ||