- 论坛徽章:
- 0
|
- struct btrfs_root *btrfs_read_fs_root_no_name(struct btrfs_fs_info *fs_info,
- struct btrfs_key *location)
- {
- struct btrfs_root *root;
- int ret;
- if (location->objectid == BTRFS_ROOT_TREE_OBJECTID)
- return fs_info->tree_root;
- if (location->objectid == BTRFS_EXTENT_TREE_OBJECTID)
- return fs_info->extent_root;
- if (location->objectid == BTRFS_CHUNK_TREE_OBJECTID)
- return fs_info->chunk_root;
- if (location->objectid == BTRFS_DEV_TREE_OBJECTID)
- return fs_info->dev_root;
- if (location->objectid == BTRFS_CSUM_TREE_OBJECTID)
- return fs_info->csum_root;
- + if (radix_tree_preload(GFP_NOIO))
- + return NULL;
- +
- root = radix_tree_lookup(&fs_info->fs_roots_radix,
- (unsigned long)location->objectid);
- - if (root)
- - return root;
- + if (root) {
- + radix_tree_preload_end();
- + return root;
- + }
- root = btrfs_read_fs_root_no_radix(fs_info->tree_root, location);
- - if (IS_ERR(root))
- - return root;
- + if (IS_ERR(root)) {
- + radix_tree_preload_end();
- + return root;
- + }
- set_anon_super(&root->anon_super, NULL);
- ret = radix_tree_insert(&fs_info->fs_roots_radix,
- (unsigned long)root->root_key.objectid,
- root);
- if (ret) {
- + radix_tree_preload_end();
- free_extent_buffer(root->node);
- kfree(root);
- return ERR_PTR(ret);
- }
- if (!(fs_info->sb->s_flags & MS_RDONLY)) {
- ret = btrfs_find_dead_roots(fs_info->tree_root,
- root->root_key.objectid);
- BUG_ON(ret);
- btrfs_orphan_cleanup(root);
- }
- + radix_tree_preload_end();
- return root;
- }
复制代码 |
|