Lines Matching defs:root

57 	struct btrfs_root *root;
162 struct btrfs_root *root, struct inode *inode,
194 ret = btrfs_insert_empty_item(trans, root, path, &key,
244 size = ALIGN(size, root->fs_info->sectorsize);
259 ret = btrfs_update_inode(trans, root, inode);
276 struct btrfs_root *root = inode->root;
277 struct btrfs_fs_info *fs_info = root->fs_info;
306 trans = btrfs_join_transaction(root);
320 ret = __btrfs_drop_extents(trans, root, inode, path, start, aligned_end,
331 root, &inode->vfs_inode, start,
424 struct btrfs_fs_info *fs_info = inode->root->fs_info;
769 struct btrfs_fs_info *fs_info = inode->root->fs_info;
774 struct btrfs_root *root = inode->root;
820 ret = btrfs_reserve_extent(root, async_extent->ram_size,
982 struct btrfs_root *root = inode->root;
983 struct btrfs_fs_info *fs_info = root->fs_info;
1048 if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID)
1055 ret = btrfs_reserve_extent(root, cur_alloc_size, cur_alloc_size,
1083 if (root->root_key.objectid ==
1242 struct btrfs_fs_info *fs_info = inode->root->fs_info;
1378 const bool is_reloc_ino = (inode->root->root_key.objectid ==
1421 struct btrfs_fs_info *fs_info = inode->root->fs_info;
1453 struct btrfs_fs_info *fs_info = inode->root->fs_info;
1454 struct btrfs_root *root = inode->root;
1490 ret = btrfs_lookup_file_extent(NULL, root, path, ino,
1513 ret = btrfs_next_leaf(root, path);
1596 btrfs_root_last_snapshot(&root->root_item))
1603 ret = btrfs_cross_ref_exist(root, ino,
1624 * If there are pending snapshots for this root, we
1627 if (!freespace_inode && atomic_read(&root->snapshot_force_cow))
1734 if (root->root_key.objectid ==
1932 static void btrfs_add_delalloc_inodes(struct btrfs_root *root,
1937 spin_lock(&root->delalloc_lock);
1940 &root->delalloc_inodes);
1943 root->nr_delalloc_inodes++;
1944 if (root->nr_delalloc_inodes == 1) {
1946 BUG_ON(!list_empty(&root->delalloc_root));
1947 list_add_tail(&root->delalloc_root,
1952 spin_unlock(&root->delalloc_lock);
1956 void __btrfs_del_delalloc_inode(struct btrfs_root *root,
1959 struct btrfs_fs_info *fs_info = root->fs_info;
1965 root->nr_delalloc_inodes--;
1966 if (!root->nr_delalloc_inodes) {
1967 ASSERT(list_empty(&root->delalloc_inodes));
1969 BUG_ON(list_empty(&root->delalloc_root));
1970 list_del_init(&root->delalloc_root);
1976 static void btrfs_del_delalloc_inode(struct btrfs_root *root,
1979 spin_lock(&root->delalloc_lock);
1980 __btrfs_del_delalloc_inode(root, inode);
1981 spin_unlock(&root->delalloc_lock);
2001 struct btrfs_root *root = BTRFS_I(inode)->root;
2022 btrfs_add_delalloc_inodes(root, inode);
2059 struct btrfs_root *root = inode->root;
2072 root != fs_info->tree_root)
2079 if (root->root_key.objectid != BTRFS_DATA_RELOC_TREE_OBJECTID &&
2091 btrfs_del_delalloc_inode(root, inode);
2173 * c-2) if root is reloc root: sync submit
2183 struct btrfs_root *root = BTRFS_I(inode)->root;
2212 if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID)
2515 struct btrfs_root *root = inode->root;
2539 ret = __btrfs_drop_extents(trans, root, inode, path, file_pos,
2551 ret = btrfs_insert_empty_item(trans, root, path, &ins,
2575 ret = btrfs_alloc_reserved_file_extent(trans, root, btrfs_ino(inode),
2632 struct btrfs_root *root = BTRFS_I(inode)->root;
2677 trans = btrfs_join_transaction_spacecache(root);
2679 trans = btrfs_join_transaction(root);
2686 ret = btrfs_update_inode_fallback(trans, root, inode);
2696 trans = btrfs_join_transaction_spacecache(root);
2698 trans = btrfs_join_transaction(root);
2716 BUG_ON(root == fs_info->tree_root);
2740 ret = btrfs_update_inode_fallback(trans, root, inode);
2835 struct btrfs_fs_info *fs_info = inode->root->fs_info;
2901 struct btrfs_root *root = BTRFS_I(inode)->root;
2911 if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID &&
3014 ret = btrfs_insert_orphan_item(trans, inode->root, btrfs_ino(inode));
3030 return btrfs_del_orphan_item(trans, inode->root, btrfs_ino(inode));
3035 * of this root.
3037 int btrfs_orphan_cleanup(struct btrfs_root *root)
3039 struct btrfs_fs_info *fs_info = root->fs_info;
3048 if (cmpxchg(&root->orphan_cleanup_state, 0, ORPHAN_CLEANUP_STARTED))
3063 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
3094 * crossing root thing. we store the inode number in the
3110 inode = btrfs_iget(fs_info->sb, last_objectid, root);
3115 if (ret == -ENOENT && root == fs_info->tree_root) {
3120 * this is an orphan in the tree root. Currently these
3127 * is a snapshot deletion, we should find the root
3168 trans = btrfs_start_transaction(root, 1);
3175 ret = btrfs_del_orphan_item(trans, root,
3191 root->orphan_cleanup_state = ORPHAN_CLEANUP_DONE;
3193 if (test_bit(BTRFS_ROOT_ORPHAN_ITEM_INSERTED, &root->state)) {
3194 trans = btrfs_join_transaction(root);
3288 struct btrfs_root *root = BTRFS_I(inode)->root;
3309 ret = btrfs_lookup_inode(NULL, root, path, &location, 0);
3443 "error loading props for ino %llu (root %llu): %d",
3445 root->root_key.objectid, ret);
3530 struct btrfs_root *root, struct inode *inode)
3542 ret = btrfs_lookup_inode(trans, root, path, &BTRFS_I(inode)->location,
3567 struct btrfs_root *root, struct inode *inode)
3569 struct btrfs_fs_info *fs_info = root->fs_info;
3580 && root->root_key.objectid != BTRFS_DATA_RELOC_TREE_OBJECTID
3582 btrfs_update_root_times(trans, root);
3584 ret = btrfs_delayed_update_inode(trans, root, inode);
3590 return btrfs_update_inode_item(trans, root, inode);
3594 struct btrfs_root *root,
3599 ret = btrfs_update_inode(trans, root, inode);
3601 return btrfs_update_inode_item(trans, root, inode);
3611 struct btrfs_root *root,
3616 struct btrfs_fs_info *fs_info = root->fs_info;
3631 di = btrfs_lookup_dir_item(trans, root, path, dir_ino,
3637 ret = btrfs_delete_one_dir_name(trans, root, path, di);
3660 ret = btrfs_del_inode_ref(trans, root, name, name_len, ino,
3676 ret = btrfs_del_inode_ref_in_log(trans, root, name, name_len, inode,
3683 ret = btrfs_del_dir_entries_in_log(trans, root, name, name_len, dir,
3710 ret = btrfs_update_inode(trans, root, &dir->vfs_inode);
3716 struct btrfs_root *root,
3721 ret = __btrfs_unlink_inode(trans, root, dir, inode, name, name_len);
3724 ret = btrfs_update_inode(trans, root, &inode->vfs_inode);
3739 struct btrfs_root *root = BTRFS_I(dir)->root;
3748 return btrfs_start_transaction_fallback_global_rsv(root, 5);
3753 struct btrfs_root *root = BTRFS_I(dir)->root;
3765 ret = btrfs_unlink_inode(trans, root, BTRFS_I(dir),
3779 btrfs_btree_balance_dirty(root->fs_info);
3786 struct btrfs_root *root = BTRFS_I(dir)->root;
3800 objectid = inode->root->root_key.objectid;
3812 di = btrfs_lookup_dir_item(trans, root, path, dir_ino,
3822 ret = btrfs_delete_one_dir_name(trans, root, path, di);
3835 * remove it. Otherwise we know we have a ref to the root and we can
3839 di = btrfs_search_dir_index_item(root, path, dir_ino,
3856 root->root_key.objectid, dir_ino,
3873 ret = btrfs_update_inode_fallback(trans, root, dir);
3885 static noinline int may_destroy_subvol(struct btrfs_root *root)
3887 struct btrfs_fs_info *fs_info = root->fs_info;
3898 /* Make sure this root isn't set as the default subvol */
3904 if (key.objectid == root->root_key.objectid) {
3914 key.objectid = root->root_key.objectid;
3927 if (key.objectid == root->root_key.objectid &&
3936 /* Delete all dentries for inodes belonging to the root */
3937 static void btrfs_prune_dentries(struct btrfs_root *root)
3939 struct btrfs_fs_info *fs_info = root->fs_info;
3947 WARN_ON(btrfs_root_refs(&root->root_item) != 0);
3949 spin_lock(&root->inode_lock);
3951 node = root->inode_tree.rb_node;
3979 spin_unlock(&root->inode_lock);
3988 spin_lock(&root->inode_lock);
3992 if (cond_resched_lock(&root->inode_lock))
3997 spin_unlock(&root->inode_lock);
4003 struct btrfs_root *root = BTRFS_I(dir)->root;
4005 struct btrfs_root *dest = BTRFS_I(inode)->root;
4031 root->root_key.objectid);
4048 * two for root ref/backref.
4050 ret = btrfs_subvolume_reserve_metadata(root, &block_rsv, 5, true);
4054 trans = btrfs_start_transaction(root, 0);
4113 btrfs_subvolume_release_metadata(root, &block_rsv);
4143 struct btrfs_root *root = BTRFS_I(dir)->root;
4168 err = btrfs_unlink_inode(trans, root, BTRFS_I(dir),
4189 btrfs_btree_balance_dirty(root->fs_info);
4212 struct btrfs_root *root,
4216 struct btrfs_fs_info *fs_info = root->fs_info;
4249 test_bit(BTRFS_ROOT_SHAREABLE, &root->state))
4257 if (root->root_key.objectid != BTRFS_TREE_LOG_OBJECTID) {
4273 * we relog the inode, so if root != BTRFS_I(inode)->root, it means
4277 if (min_type == 0 && root == BTRFS_I(inode)->root)
4296 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
4378 &root->state) &&
4394 &root->state))
4429 if (test_bit(BTRFS_ROOT_SHAREABLE, &root->state))
4438 if (root == BTRFS_I(inode)->root) {
4470 root->root_key.objectid != BTRFS_TREE_LOG_OBJECTID) {
4477 ref.real_root = root->root_key.objectid;
4498 ret = btrfs_del_items(trans, root, path,
4536 err = btrfs_del_items(trans, root, path, pending_del_slot,
4543 if (root->root_key.objectid != BTRFS_TREE_LOG_OBJECTID) {
4705 static int maybe_insert_hole(struct btrfs_root *root, struct inode *inode,
4718 BTRFS_I(inode)->last_sub_trans = root->log_transid;
4719 BTRFS_I(inode)->last_log_commit = root->last_log_commit;
4728 trans = btrfs_start_transaction(root, 3);
4732 ret = btrfs_drop_extents(trans, root, inode, offset, offset + len, 1);
4739 ret = btrfs_insert_file_extent(trans, root, btrfs_ino(BTRFS_I(inode)),
4744 btrfs_update_inode(trans, root, inode);
4758 struct btrfs_root *root = BTRFS_I(inode)->root;
4800 err = maybe_insert_hole(root, inode, cur_offset,
4861 struct btrfs_root *root = BTRFS_I(inode)->root;
4889 btrfs_drew_write_lock(&root->snapshot_lock);
4892 btrfs_drew_write_unlock(&root->snapshot_lock);
4896 trans = btrfs_start_transaction(root, 1);
4898 btrfs_drew_write_unlock(&root->snapshot_lock);
4905 ret = btrfs_update_inode(trans, root, inode);
4906 btrfs_drew_write_unlock(&root->snapshot_lock);
4946 struct btrfs_root *root = BTRFS_I(inode)->root;
4949 if (btrfs_root_readonly(root))
5069 static struct btrfs_trans_handle *evict_refill_and_join(struct btrfs_root *root,
5072 struct btrfs_fs_info *fs_info = root->fs_info;
5084 * btrfs_start_transaction(root, 0) for the same deadlocky reason as
5091 ret = btrfs_block_rsv_refill(root, rsv, rsv->size + delayed_refs_extra,
5107 trans = btrfs_join_transaction(root);
5124 struct btrfs_root *root = BTRFS_I(inode)->root;
5130 if (!root) {
5138 ((btrfs_root_refs(&root->root_item) != 0 &&
5139 root->root_key.objectid != BTRFS_ROOT_TREE_OBJECTID) ||
5152 BUG_ON(btrfs_root_refs(&root->root_item) != 0 &&
5153 root->root_key.objectid != BTRFS_ROOT_TREE_OBJECTID);
5170 trans = evict_refill_and_join(root, rsv);
5176 ret = btrfs_truncate_inode_items(trans, root, inode, 0, 0);
5195 trans = evict_refill_and_join(root, rsv);
5203 if (!(root == fs_info->tree_root ||
5204 root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID))
5205 btrfs_return_ino(root, btrfs_ino(BTRFS_I(inode)));
5233 struct btrfs_root *root = BTRFS_I(dir)->root;
5240 di = btrfs_lookup_dir_item(NULL, root, path, btrfs_ino(BTRFS_I(dir)),
5251 btrfs_warn(root->fs_info,
5264 * when we hit a tree root in a directory, the btrfs part of the inode
5265 * needs to be changed to reflect the root directory of the tree root. This
5289 key.objectid = BTRFS_I(dir)->root->root_key.objectid;
5332 struct btrfs_root *root = BTRFS_I(inode)->root;
5342 spin_lock(&root->inode_lock);
5343 p = &root->inode_tree.rb_node;
5355 rb_replace_node(parent, new, &root->inode_tree);
5357 spin_unlock(&root->inode_lock);
5362 rb_insert_color(new, &root->inode_tree);
5363 spin_unlock(&root->inode_lock);
5368 struct btrfs_root *root = inode->root;
5371 spin_lock(&root->inode_lock);
5373 rb_erase(&inode->rb_node, &root->inode_tree);
5375 empty = RB_EMPTY_ROOT(&root->inode_tree);
5377 spin_unlock(&root->inode_lock);
5379 if (empty && btrfs_root_refs(&root->root_item) == 0) {
5380 spin_lock(&root->inode_lock);
5381 empty = RB_EMPTY_ROOT(&root->inode_tree);
5382 spin_unlock(&root->inode_lock);
5384 btrfs_add_dead_root(root);
5397 BTRFS_I(inode)->root = btrfs_grab_root(args->root);
5398 BUG_ON(args->root && !BTRFS_I(inode)->root);
5407 args->root == BTRFS_I(inode)->root;
5411 struct btrfs_root *root)
5415 unsigned long hashval = btrfs_inode_hash(ino, root);
5418 args.root = root;
5427 * Get an inode object given its inode number and corresponding root.
5433 struct btrfs_root *root, struct btrfs_path *path)
5437 inode = btrfs_iget_locked(s, ino, root);
5464 struct inode *btrfs_iget(struct super_block *s, u64 ino, struct btrfs_root *root)
5466 return btrfs_iget_path(s, ino, root, NULL);
5471 struct btrfs_root *root)
5478 BTRFS_I(inode)->root = btrfs_grab_root(root);
5521 struct btrfs_root *root = BTRFS_I(dir)->root;
5522 struct btrfs_root *sub_root = root;
5535 inode = btrfs_iget(dir->i_sb, location.objectid, root);
5561 if (root != sub_root)
5564 if (!IS_ERR(inode) && root != sub_root) {
5580 struct btrfs_root *root;
5587 root = BTRFS_I(inode)->root;
5588 if (btrfs_root_refs(&root->root_item) == 0)
5660 struct btrfs_root *root = BTRFS_I(inode)->root;
5698 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
5708 ret = btrfs_next_leaf(root, path);
5805 struct btrfs_root *root = BTRFS_I(inode)->root;
5812 trans = btrfs_join_transaction(root);
5816 ret = btrfs_update_inode(trans, root, inode);
5820 trans = btrfs_start_transaction(root, 1);
5824 ret = btrfs_update_inode(trans, root, inode);
5840 struct btrfs_root *root = BTRFS_I(inode)->root;
5843 if (btrfs_root_readonly(root))
5864 struct btrfs_root *root = inode->root;
5878 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
5942 args.root = BTRFS_I(inode)->root;
5945 btrfs_inode_hash(inode->i_ino, BTRFS_I(inode)->root),
5981 struct btrfs_root *root,
5987 struct btrfs_fs_info *fs_info = root->fs_info;
6044 BTRFS_I(inode)->root = btrfs_grab_root(root);
6088 ret = btrfs_insert_empty_items(trans, root, path, key, sizes, nitems);
6133 btrfs_update_root_times(trans, root);
6138 "error inheriting props for ino %llu (root %llu): %d",
6139 btrfs_ino(BTRFS_I(inode)), root->root_key.objectid, ret);
6164 struct btrfs_root *root = parent_inode->root;
6169 memcpy(&key, &inode->root->root_key, sizeof(key));
6178 root->root_key.objectid, parent_ino,
6181 ret = btrfs_insert_inode_ref(trans, root, name, name_len, ino,
6207 if (!test_bit(BTRFS_FS_LOG_RECOVERING, &root->fs_info->flags)) {
6213 ret = btrfs_update_inode(trans, root, &parent_inode->vfs_inode);
6223 root->root_key.objectid, parent_ino,
6231 err = btrfs_del_inode_ref(trans, root, name, name_len,
6258 struct btrfs_root *root = BTRFS_I(dir)->root;
6269 trans = btrfs_start_transaction(root, 5);
6273 err = btrfs_find_free_objectid(root, &objectid);
6277 inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name,
6304 btrfs_update_inode(trans, root, inode);
6322 struct btrfs_root *root = BTRFS_I(dir)->root;
6333 trans = btrfs_start_transaction(root, 5);
6337 err = btrfs_find_free_objectid(root, &objectid);
6341 inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name,
6363 err = btrfs_update_inode(trans, root, inode);
6388 struct btrfs_root *root = BTRFS_I(dir)->root;
6396 if (root->root_key.objectid != BTRFS_I(inode)->root->root_key.objectid)
6412 trans = btrfs_start_transaction(root, inode->i_nlink ? 5 : 6);
6435 err = btrfs_update_inode(trans, root, inode);
6467 struct btrfs_root *root = BTRFS_I(dir)->root;
6477 trans = btrfs_start_transaction(root, 5);
6481 err = btrfs_find_free_objectid(root, &objectid);
6485 inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name,
6503 err = btrfs_update_inode(trans, root, inode);
6593 struct btrfs_fs_info *fs_info = inode->root->fs_info;
6600 struct btrfs_root *root = inode->root;
6647 ret = btrfs_lookup_file_extent(NULL, root, path, objectid, start, 0);
6697 ret = btrfs_next_leaf(root, path);
6794 trace_btrfs_get_extent(root, inode, em);
6968 struct btrfs_root *root = inode->root;
6969 struct btrfs_fs_info *fs_info = root->fs_info;
6976 ret = btrfs_reserve_extent(root, len, len, fs_info->sectorsize,
7023 struct btrfs_root *root = BTRFS_I(inode)->root;
7039 ret = btrfs_lookup_file_extent(NULL, root, path,
7097 btrfs_root_last_snapshot(&root->root_item)))
7116 root->fs_info->sectorsize) - 1;
7132 ret = btrfs_cross_ref_exist(root, btrfs_ino(BTRFS_I(inode)),
7655 struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info;
7707 struct btrfs_fs_info *fs_info = inode->root->fs_info;
7760 btrfs_warn(BTRFS_I(dip->inode)->root->fs_info,
8491 struct btrfs_root *root = BTRFS_I(inode)->root;
8543 trans = btrfs_start_transaction(root, 2);
8565 ret = btrfs_truncate_inode_items(trans, root, inode,
8572 ret = btrfs_update_inode(trans, root, inode);
8579 trans = btrfs_start_transaction(root, 2);
8606 trans = btrfs_start_transaction(root, 1);
8618 ret2 = btrfs_update_inode(trans, root, inode);
8680 ei->root = NULL;
8748 struct btrfs_root *root = inode->root;
8765 if (!root)
8773 btrfs_err(root->fs_info,
8785 btrfs_put_root(inode->root);
8790 struct btrfs_root *root = BTRFS_I(inode)->root;
8792 if (root == NULL)
8796 if (btrfs_root_refs(&root->root_item) == 0)
8888 stat->dev = BTRFS_I(inode)->root->anon_dev;
8905 struct btrfs_root *root = BTRFS_I(old_dir)->root;
8906 struct btrfs_root *dest = BTRFS_I(new_dir)->root;
8925 if (root != dest &&
8943 trans = btrfs_start_transaction(root, 12);
8949 if (dest != root)
8971 btrfs_pin_log_trans(root);
8991 ret = btrfs_insert_inode_ref(trans, root,
9025 ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir),
9030 ret = btrfs_update_inode(trans, root, old_inode);
9077 btrfs_end_log_trans(root);
9107 btrfs_end_log_trans(root);
9126 struct btrfs_root *root,
9135 ret = btrfs_find_free_objectid(root, &objectid);
9139 inode = btrfs_new_inode(trans, root, dir,
9166 ret = btrfs_update_inode(trans, root, inode);
9183 struct btrfs_root *root = BTRFS_I(old_dir)->root;
9184 struct btrfs_root *dest = BTRFS_I(new_dir)->root;
9197 if (old_ino != BTRFS_FIRST_FREE_OBJECTID && root != dest)
9252 trans = btrfs_start_transaction(root, trans_num_items);
9258 if (dest != root)
9270 btrfs_pin_log_trans(root);
9295 ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir),
9300 ret = btrfs_update_inode(trans, root, old_inode);
9343 btrfs_end_log_trans(root);
9348 ret = btrfs_whiteout_for_rename(trans, root, old_dir,
9376 btrfs_end_log_trans(root);
9446 static int start_delalloc_inodes(struct btrfs_root *root,
9461 mutex_lock(&root->delalloc_mutex);
9462 spin_lock(&root->delalloc_lock);
9463 list_splice_init(&root->delalloc_inodes, &splice);
9469 &root->delalloc_inodes);
9477 cond_resched_lock(&root->delalloc_lock);
9480 spin_unlock(&root->delalloc_lock);
9493 btrfs_queue_work(root->fs_info->flush_workers,
9506 spin_lock(&root->delalloc_lock);
9508 spin_unlock(&root->delalloc_lock);
9518 spin_lock(&root->delalloc_lock);
9519 list_splice_tail(&splice, &root->delalloc_inodes);
9520 spin_unlock(&root->delalloc_lock);
9522 mutex_unlock(&root->delalloc_mutex);
9526 int btrfs_start_delalloc_snapshot(struct btrfs_root *root)
9534 struct btrfs_fs_info *fs_info = root->fs_info;
9539 return start_delalloc_inodes(root, &wbc, true, false);
9551 struct btrfs_root *root;
9571 root = list_first_entry(&splice, struct btrfs_root,
9573 root = btrfs_grab_root(root);
9574 BUG_ON(!root);
9575 list_move_tail(&root->delalloc_root,
9579 ret = start_delalloc_inodes(root, &wbc, false, in_reclaim_context);
9580 btrfs_put_root(root);
9603 struct btrfs_root *root = BTRFS_I(dir)->root;
9627 trans = btrfs_start_transaction(root, 7);
9631 err = btrfs_find_free_objectid(root, &objectid);
9635 inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name,
9667 err = btrfs_insert_empty_item(trans, root, path, &key,
9693 err = btrfs_update_inode(trans, root, inode);
9784 struct btrfs_root *root = BTRFS_I(inode)->root;
9807 ret = btrfs_reserve_extent(root, cur_bytes, cur_bytes,
9887 ret = btrfs_update_inode(trans, root, inode);
9932 struct btrfs_root *root = BTRFS_I(inode)->root;
9937 if (btrfs_root_readonly(root))
9949 struct btrfs_root *root = BTRFS_I(dir)->root;
9958 trans = btrfs_start_transaction(root, 5);
9962 ret = btrfs_find_free_objectid(root, &objectid);
9966 inode = btrfs_new_inode(trans, root, dir, NULL, 0,
9983 ret = btrfs_update_inode(trans, root, inode);
10034 struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info;
10075 struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info;
10155 atomic_dec(&BTRFS_I(inode)->root->nr_swapfiles);
10162 struct btrfs_root *root = BTRFS_I(inode)->root;
10163 struct btrfs_fs_info *fs_info = root->fs_info;
10222 if (!btrfs_drew_try_write_lock(&root->snapshot_lock)) {
10235 * removed yet. To prevent this race, we check the root status before
10238 spin_lock(&root->root_item_lock);
10239 if (btrfs_root_dead(root)) {
10240 spin_unlock(&root->root_item_lock);
10245 root->root_key.objectid);
10248 atomic_inc(&root->nr_swapfiles);
10249 spin_unlock(&root->root_item_lock);
10395 btrfs_drew_write_unlock(&root->snapshot_lock);