Lines Matching refs:root

41 				struct btrfs_root *root, u64 inode_id)  in btrfs_init_delayed_node()  argument
43 delayed_node->root = root; in btrfs_init_delayed_node()
68 struct btrfs_root *root = btrfs_inode->root; in btrfs_get_delayed_node() local
78 spin_lock(&root->inode_lock); in btrfs_get_delayed_node()
79 node = radix_tree_lookup(&root->delayed_nodes_tree, ino); in btrfs_get_delayed_node()
85 spin_unlock(&root->inode_lock); in btrfs_get_delayed_node()
112 spin_unlock(&root->inode_lock); in btrfs_get_delayed_node()
115 spin_unlock(&root->inode_lock); in btrfs_get_delayed_node()
125 struct btrfs_root *root = btrfs_inode->root; in btrfs_get_or_create_delayed_node() local
137 btrfs_init_delayed_node(node, root, ino); in btrfs_get_or_create_delayed_node()
148 spin_lock(&root->inode_lock); in btrfs_get_or_create_delayed_node()
149 ret = radix_tree_insert(&root->delayed_nodes_tree, ino, node); in btrfs_get_or_create_delayed_node()
151 spin_unlock(&root->inode_lock); in btrfs_get_or_create_delayed_node()
157 spin_unlock(&root->inode_lock); in btrfs_get_or_create_delayed_node()
168 static void btrfs_queue_delayed_node(struct btrfs_delayed_root *root, in btrfs_queue_delayed_node() argument
172 spin_lock(&root->lock); in btrfs_queue_delayed_node()
175 list_move_tail(&node->p_list, &root->prepare_list); in btrfs_queue_delayed_node()
177 list_add_tail(&node->p_list, &root->prepare_list); in btrfs_queue_delayed_node()
179 list_add_tail(&node->n_list, &root->node_list); in btrfs_queue_delayed_node()
180 list_add_tail(&node->p_list, &root->prepare_list); in btrfs_queue_delayed_node()
182 root->nodes++; in btrfs_queue_delayed_node()
185 spin_unlock(&root->lock); in btrfs_queue_delayed_node()
189 static void btrfs_dequeue_delayed_node(struct btrfs_delayed_root *root, in btrfs_dequeue_delayed_node() argument
192 spin_lock(&root->lock); in btrfs_dequeue_delayed_node()
194 root->nodes--; in btrfs_dequeue_delayed_node()
201 spin_unlock(&root->lock); in btrfs_dequeue_delayed_node()
230 delayed_root = node->root->fs_info->delayed_root; in btrfs_next_delayed_node()
259 delayed_root = delayed_node->root->fs_info->delayed_root; in __btrfs_release_delayed_node()
269 struct btrfs_root *root = delayed_node->root; in __btrfs_release_delayed_node() local
271 spin_lock(&root->inode_lock); in __btrfs_release_delayed_node()
277 radix_tree_delete(&root->delayed_nodes_tree, in __btrfs_release_delayed_node()
279 spin_unlock(&root->inode_lock); in __btrfs_release_delayed_node()
340 struct rb_root *root, in __btrfs_lookup_delayed_item() argument
349 node = root->rb_node; in __btrfs_lookup_delayed_item()
404 struct rb_root_cached *root; in __btrfs_add_delayed_item() local
410 root = &delayed_node->ins_root; in __btrfs_add_delayed_item()
412 root = &delayed_node->del_root; in __btrfs_add_delayed_item()
415 p = &root->rb_root.rb_node; in __btrfs_add_delayed_item()
435 rb_insert_color_cached(node, root, leftmost); in __btrfs_add_delayed_item()
445 atomic_inc(&delayed_node->root->fs_info->delayed_root->items); in __btrfs_add_delayed_item()
475 struct rb_root_cached *root; in __btrfs_remove_delayed_item() local
481 delayed_root = delayed_item->delayed_node->root->fs_info->delayed_root; in __btrfs_remove_delayed_item()
488 root = &delayed_item->delayed_node->ins_root; in __btrfs_remove_delayed_item()
490 root = &delayed_item->delayed_node->del_root; in __btrfs_remove_delayed_item()
492 rb_erase_cached(&delayed_item->rb_node, root); in __btrfs_remove_delayed_item()
547 struct btrfs_root *root, in btrfs_delayed_item_reserve_metadata() argument
552 struct btrfs_fs_info *fs_info = root->fs_info; in btrfs_delayed_item_reserve_metadata()
580 static void btrfs_delayed_item_release_metadata(struct btrfs_root *root, in btrfs_delayed_item_release_metadata() argument
584 struct btrfs_fs_info *fs_info = root->fs_info; in btrfs_delayed_item_release_metadata()
603 struct btrfs_root *root, in btrfs_delayed_inode_reserve_metadata() argument
607 struct btrfs_fs_info *fs_info = root->fs_info; in btrfs_delayed_inode_reserve_metadata()
629 ret = btrfs_qgroup_reserve_meta_prealloc(root, in btrfs_delayed_inode_reserve_metadata()
633 ret = btrfs_block_rsv_add(root, dst_rsv, num_bytes, in btrfs_delayed_inode_reserve_metadata()
643 btrfs_qgroup_free_meta_prealloc(root, num_bytes); in btrfs_delayed_inode_reserve_metadata()
652 btrfs_qgroup_free_meta_prealloc(root, fs_info->nodesize); in btrfs_delayed_inode_reserve_metadata()
682 btrfs_qgroup_free_meta_prealloc(node->root, in btrfs_delayed_inode_release_metadata()
685 btrfs_qgroup_convert_reserved_meta(node->root, in btrfs_delayed_inode_release_metadata()
694 static int btrfs_batch_insert_items(struct btrfs_root *root, in btrfs_batch_insert_items() argument
772 setup_items_for_insert(root, path, keys, data_size, in btrfs_batch_insert_items()
784 btrfs_delayed_item_release_metadata(root, curr); in btrfs_batch_insert_items()
802 struct btrfs_root *root, in btrfs_insert_delayed_item() argument
810 ret = btrfs_insert_empty_item(trans, root, path, &delayed_item->key, in btrfs_insert_delayed_item()
823 btrfs_delayed_item_release_metadata(root, delayed_item); in btrfs_insert_delayed_item()
833 struct btrfs_root *root, in btrfs_insert_delayed_items() argument
845 ret = btrfs_insert_delayed_item(trans, root, path, curr); in btrfs_insert_delayed_items()
856 btrfs_batch_insert_items(root, path, curr); in btrfs_insert_delayed_items()
871 struct btrfs_root *root, in btrfs_batch_delete_items() argument
919 ret = btrfs_del_items(trans, root, path, path->slots[0], nitems); in btrfs_batch_delete_items()
924 btrfs_delayed_item_release_metadata(root, curr); in btrfs_batch_delete_items()
935 struct btrfs_root *root, in btrfs_delete_delayed_items() argument
947 ret = btrfs_search_slot(trans, root, &curr->key, path, -1, 1); in btrfs_delete_delayed_items()
967 btrfs_batch_delete_items(trans, root, path, curr); in btrfs_delete_delayed_items()
984 BUG_ON(!delayed_node->root); in btrfs_release_delayed_inode()
988 delayed_root = delayed_node->root->fs_info->delayed_root; in btrfs_release_delayed_inode()
997 ASSERT(delayed_node->root); in btrfs_release_delayed_iref()
1001 delayed_root = delayed_node->root->fs_info->delayed_root; in btrfs_release_delayed_iref()
1006 struct btrfs_root *root, in __btrfs_update_delayed_inode() argument
1010 struct btrfs_fs_info *fs_info = root->fs_info; in __btrfs_update_delayed_inode()
1026 ret = btrfs_lookup_inode(trans, root, path, &key, mod); in __btrfs_update_delayed_inode()
1061 btrfs_del_item(trans, root, path); in __btrfs_update_delayed_inode()
1077 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in __btrfs_update_delayed_inode()
1089 struct btrfs_root *root, in btrfs_update_delayed_inode() argument
1101 ret = __btrfs_update_delayed_inode(trans, root, path, node); in btrfs_update_delayed_inode()
1113 ret = btrfs_insert_delayed_items(trans, path, node->root, node); in __btrfs_commit_inode_delayed_items()
1117 ret = btrfs_delete_delayed_items(trans, path, node->root, node); in __btrfs_commit_inode_delayed_items()
1121 ret = btrfs_update_delayed_inode(trans, node->root, path, node); in __btrfs_commit_inode_delayed_items()
1215 trans->block_rsv = &delayed_node->root->fs_info->delayed_block_rsv; in btrfs_commit_inode_delayed_items()
1228 struct btrfs_fs_info *fs_info = inode->root->fs_info; in btrfs_commit_inode_delayed_inode()
1246 trans = btrfs_join_transaction(delayed_node->root); in btrfs_commit_inode_delayed_inode()
1264 ret = __btrfs_update_delayed_inode(trans, delayed_node->root, in btrfs_commit_inode_delayed_inode()
1306 struct btrfs_root *root; in btrfs_async_run_delayed_root() local
1327 root = delayed_node->root; in btrfs_async_run_delayed_root()
1329 trans = btrfs_join_transaction(root); in btrfs_async_run_delayed_root()
1338 trans->block_rsv = &root->fs_info->delayed_block_rsv; in btrfs_async_run_delayed_root()
1344 btrfs_btree_balance_dirty_nodelay(root->fs_info); in btrfs_async_run_delayed_root()
1456 ret = btrfs_delayed_item_reserve_metadata(trans, dir->root, delayed_item); in btrfs_insert_delayed_dir_index()
1468 name_len, name, delayed_node->root->root_key.objectid, in btrfs_insert_delayed_dir_index()
1492 btrfs_delayed_item_release_metadata(node->root, item); in btrfs_delete_delayed_insertion_item()
1527 ret = btrfs_delayed_item_reserve_metadata(trans, dir->root, item); in btrfs_delete_delayed_dir_index()
1544 index, node->root->root_key.objectid, in btrfs_delete_delayed_dir_index()
1546 btrfs_delayed_item_release_metadata(dir->root, item); in btrfs_delete_delayed_dir_index()
1816 struct btrfs_root *root, struct inode *inode) in btrfs_delayed_update_inode() argument
1831 ret = btrfs_delayed_inode_reserve_metadata(trans, root, BTRFS_I(inode), in btrfs_delayed_update_inode()
1839 atomic_inc(&root->fs_info->delayed_root->items); in btrfs_delayed_update_inode()
1848 struct btrfs_fs_info *fs_info = inode->root->fs_info; in btrfs_delayed_delete_inode_ref()
1892 struct btrfs_root *root = delayed_node->root; in __btrfs_kill_delayed_node() local
1893 struct btrfs_fs_info *fs_info = root->fs_info; in __btrfs_kill_delayed_node()
1899 btrfs_delayed_item_release_metadata(root, curr_item); in __btrfs_kill_delayed_node()
1907 btrfs_delayed_item_release_metadata(root, curr_item); in __btrfs_kill_delayed_node()
1935 void btrfs_kill_all_delayed_nodes(struct btrfs_root *root) in btrfs_kill_all_delayed_nodes() argument
1942 spin_lock(&root->inode_lock); in btrfs_kill_all_delayed_nodes()
1943 n = radix_tree_gang_lookup(&root->delayed_nodes_tree, in btrfs_kill_all_delayed_nodes()
1947 spin_unlock(&root->inode_lock); in btrfs_kill_all_delayed_nodes()
1955 spin_unlock(&root->inode_lock); in btrfs_kill_all_delayed_nodes()