Lines Matching refs:root

201 	struct btrfs_root *root = binode->root;
211 if (btrfs_root_readonly(root))
313 trans = btrfs_start_transaction(root, 3);
339 ret = btrfs_update_inode(trans, root, inode);
413 struct btrfs_root *root = binode->root;
423 if (btrfs_root_readonly(root))
473 trans = btrfs_start_transaction(root, 1);
482 ret = btrfs_update_inode(trans, root, inode);
588 struct btrfs_root *root = BTRFS_I(dir)->root;
626 ret = btrfs_subvolume_reserve_metadata(root, &block_rsv, 8, false);
630 trans = btrfs_start_transaction(root, 0);
633 btrfs_subvolume_release_metadata(root, &block_rsv);
643 leaf = btrfs_alloc_tree_block(trans, root, 0, objectid, NULL, 0, 0, 0,
698 btrfs_free_tree_block(trans, root, leaf, 0, 1);
719 ret = btrfs_create_subvol_root(trans, new_root, root, new_dirid);
748 ret = btrfs_update_inode(trans, root, dir);
754 ret = btrfs_add_root_ref(trans, objectid, root->root_key.objectid,
770 btrfs_subvolume_release_metadata(root, &block_rsv);
791 static int create_snapshot(struct btrfs_root *root, struct inode *dir,
801 if (btrfs_root_refs(&root->root_item) == 0)
804 if (!test_bit(BTRFS_ROOT_SHAREABLE, &root->state))
807 if (atomic_read(&root->nr_swapfiles)) {
833 * 1 - root item
834 * 2 - root ref/backref
835 * 1 - root of snapshot
838 ret = btrfs_subvolume_reserve_metadata(BTRFS_I(dir)->root,
845 pending_snapshot->root = root;
850 trans = btrfs_start_transaction(root, 0);
887 btrfs_subvolume_release_metadata(root, &pending_snapshot->block_rsv);
913 * 9. We can't remove a root or mountpoint.
993 error = btrfs_check_dir_item_collision(BTRFS_I(dir)->root,
1001 if (btrfs_root_refs(&BTRFS_I(dir)->root->root_item) == 0)
1022 struct btrfs_root *root,
1034 btrfs_drew_read_lock(&root->snapshot_lock);
1036 ret = btrfs_start_delalloc_snapshot(root);
1045 atomic_inc(&root->snapshot_force_cow);
1048 btrfs_wait_ordered_extents(root, U64_MAX, 0, (u64)-1);
1051 root, readonly, inherit);
1054 atomic_dec(&root->snapshot_force_cow);
1055 btrfs_drew_read_unlock(&root->snapshot_lock);
1099 static int find_new_extents(struct btrfs_root *root,
1120 ret = btrfs_search_forward(root, &min_key, path, newer_than);
1476 struct btrfs_root *root = BTRFS_I(inode)->root;
1540 ret = find_new_extents(root, inode, newer_than,
1635 ret = find_new_extents(root, inode, newer_than,
1689 struct btrfs_root *root = BTRFS_I(inode)->root;
1801 trans = btrfs_start_transaction(root, 0);
1865 btrfs_info(BTRFS_I(file_inode(file))->root->fs_info,
1885 BTRFS_I(src_inode)->root,
1985 struct btrfs_root *root = BTRFS_I(inode)->root;
1993 if (btrfs_root_readonly(root))
2008 struct btrfs_root *root = BTRFS_I(inode)->root;
2039 if (!!(flags & BTRFS_SUBVOL_RDONLY) == btrfs_root_readonly(root))
2042 root_flags = btrfs_root_flags(&root->root_item);
2044 btrfs_set_root_flags(&root->root_item,
2051 spin_lock(&root->root_item_lock);
2052 if (root->send_in_progress == 0) {
2053 btrfs_set_root_flags(&root->root_item,
2055 spin_unlock(&root->root_item_lock);
2057 spin_unlock(&root->root_item_lock);
2060 root->root_key.objectid);
2066 trans = btrfs_start_transaction(root, 1);
2073 &root->root_key, &root->root_item);
2083 btrfs_set_root_flags(&root->root_item, root_flags);
2255 struct btrfs_root *root;
2272 /* search the root of the inode that was passed */
2273 root = btrfs_grab_root(BTRFS_I(inode)->root);
2275 root = btrfs_get_fs_root(info, sk->tree_id, true);
2276 if (IS_ERR(root)) {
2278 return PTR_ERR(root);
2292 ret = btrfs_search_forward(root, &key, path, sk->min_transid);
2309 btrfs_put_root(root);
2391 struct btrfs_root *root;
2413 root = btrfs_get_fs_root(info, tree_id, true);
2414 if (IS_ERR(root)) {
2415 ret = PTR_ERR(root);
2416 root = NULL;
2425 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
2429 ret = btrfs_previous_item(root, path, dirid,
2467 btrfs_put_root(root);
2475 struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info;
2478 u64 treeid = BTRFS_I(inode)->root->root_key.objectid;
2484 struct btrfs_root *root = NULL;
2506 root = btrfs_get_fs_root(fs_info, treeid, true);
2507 if (IS_ERR(root)) {
2508 ret = PTR_ERR(root);
2516 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
2520 ret = btrfs_previous_item(root, path, dirid,
2548 ret = btrfs_previous_item(root, path, dirid,
2568 * btrfs_iget() needs to lookup the inode from its root
2572 temp_inode = btrfs_iget(sb, key2.objectid, root);
2598 btrfs_put_root(root);
2599 root = NULL;
2635 btrfs_put_root(root);
2655 * Unprivileged query to obtain the containing subvolume root id. The
2659 args->treeid = BTRFS_I(inode)->root->root_key.objectid;
2671 ret = btrfs_search_path_in_tree(BTRFS_I(inode)->root->fs_info,
2731 struct btrfs_root *root;
2754 fs_info = BTRFS_I(inode)->root->fs_info;
2757 key.objectid = BTRFS_I(inode)->root->root_key.objectid;
2758 root = btrfs_get_fs_root(fs_info, key.objectid, true);
2759 if (IS_ERR(root)) {
2760 ret = PTR_ERR(root);
2763 root_item = &root->root_item;
2793 /* Search root tree for ROOT_BACKREF of this subvolume */
2838 btrfs_put_root(root);
2853 struct btrfs_root *root;
2874 root = BTRFS_I(inode)->root->fs_info->tree_root;
2875 objectid = BTRFS_I(inode)->root->root_key.objectid;
2882 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
2887 ret = btrfs_next_leaf(root, path);
2916 ret = btrfs_next_item(root, path);
2952 struct btrfs_root *root = BTRFS_I(dir)->root;
3079 dest = BTRFS_I(inode)->root;
3084 * subvol root, and when rmdir(2) would have been
3101 * must be called on the dentry referencing the root
3106 if (root == dest)
3150 struct btrfs_root *root = BTRFS_I(inode)->root;
3158 if (btrfs_root_readonly(root)) {
3169 ret = btrfs_defrag_root(root);
3444 struct btrfs_root *root = BTRFS_I(inode)->root;
3486 trans = btrfs_start_transaction(root, 1);
3671 static noinline long btrfs_ioctl_start_sync(struct btrfs_root *root,
3678 trans = btrfs_attach_transaction_barrier(root);
3684 transid = root->fs_info->last_trans_committed;
3864 static long btrfs_ioctl_ino_to_path(struct btrfs_root *root, void __user *arg)
3891 ipath = init_ipath(size, root, path);
4017 struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
4018 struct btrfs_fs_info *fs_info = root->fs_info;
4252 struct btrfs_root *root = BTRFS_I(inode)->root;
4271 trans = btrfs_join_transaction(root);
4304 struct btrfs_root *root = BTRFS_I(inode)->root;
4333 trans = btrfs_join_transaction(root);
4359 struct btrfs_root *root = BTRFS_I(inode)->root;
4379 trans = btrfs_join_transaction(root);
4388 qgroupid = root->root_key.objectid;
4477 struct btrfs_root *root = BTRFS_I(inode)->root;
4478 struct btrfs_root_item *root_item = &root->root_item;
4498 if (btrfs_root_readonly(root)) {
4504 * 1 - root item
4507 trans = btrfs_start_transaction(root, 3);
4524 root->root_key.objectid);
4540 &root->root_key, &root->root_item);
4548 root->root_key.objectid);
4665 struct btrfs_root *root = BTRFS_I(inode)->root;
4688 trans = btrfs_start_transaction(root, 0);
4808 struct btrfs_root *root = BTRFS_I(inode)->root;
4845 trans = btrfs_start_transaction(root, 0);
4915 struct btrfs_root *root = BTRFS_I(inode)->root;
4974 return btrfs_ioctl_ino_to_path(root, argp);
4997 return btrfs_ioctl_start_sync(root, argp);