/fs/btrfs/ |
D | inode-map.c | 16 static void fail_caching_thread(struct btrfs_root *root) in fail_caching_thread() argument 18 struct btrfs_fs_info *fs_info = root->fs_info; in fail_caching_thread() 23 spin_lock(&root->ino_cache_lock); in fail_caching_thread() 24 root->ino_cache_state = BTRFS_CACHE_ERROR; in fail_caching_thread() 25 spin_unlock(&root->ino_cache_lock); in fail_caching_thread() 26 wake_up(&root->ino_cache_wait); in fail_caching_thread() 31 struct btrfs_root *root = data; in caching_kthread() local 32 struct btrfs_fs_info *fs_info = root->fs_info; in caching_kthread() 33 struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; in caching_kthread() 46 fail_caching_thread(root); in caching_kthread() [all …]
|
D | tree-defrag.c | 20 struct btrfs_root *root) in btrfs_defrag_leaves() argument 30 if (root->fs_info->extent_root == root) { in btrfs_defrag_leaves() 38 if (!test_bit(BTRFS_ROOT_REF_COWS, &root->state)) in btrfs_defrag_leaves() 45 level = btrfs_header_level(root->node); in btrfs_defrag_leaves() 50 if (root->defrag_progress.objectid == 0) { in btrfs_defrag_leaves() 54 root_node = btrfs_lock_root_node(root); in btrfs_defrag_leaves() 57 root->defrag_max.objectid = 0; in btrfs_defrag_leaves() 59 btrfs_node_key_to_cpu(root_node, &root->defrag_max, in btrfs_defrag_leaves() 65 memcpy(&key, &root->defrag_progress, sizeof(key)); in btrfs_defrag_leaves() 70 ret = btrfs_search_forward(root, &key, path, BTRFS_OLDEST_GENERATION); in btrfs_defrag_leaves() [all …]
|
D | disk-io.c | 54 static void btrfs_destroy_ordered_extents(struct btrfs_root *root); 57 static void btrfs_destroy_delalloc_inodes(struct btrfs_root *root); 208 struct btrfs_fs_info *fs_info = inode->root->fs_info; in btree_get_extent() 596 struct btrfs_root *root = BTRFS_I(page->mapping->host)->root; in btree_readpage_end_io_hook() local 597 struct btrfs_fs_info *fs_info = root->fs_info; in btree_readpage_end_io_hook() 843 struct btrfs_root *root; in btree_csum_one_bio() local 849 root = BTRFS_I(bvec->bv_page->mapping->host)->root; in btree_csum_one_bio() 850 ret = csum_dirty_buffer(root->fs_info, bvec->bv_page); in btree_csum_one_bio() 954 fs_info = BTRFS_I(mapping->host)->root->fs_info; in btree_writepages() 988 btrfs_warn(BTRFS_I(page->mapping->host)->root->fs_info, in btree_invalidatepage() [all …]
|
D | transaction.c | 83 struct btrfs_root *root, *tmp; in switch_commit_roots() local 86 list_for_each_entry_safe(root, tmp, &trans->switch_commits, in switch_commit_roots() 88 list_del_init(&root->dirty_list); in switch_commit_roots() 89 free_extent_buffer(root->commit_root); in switch_commit_roots() 90 root->commit_root = btrfs_root_node(root); in switch_commit_roots() 91 if (is_fstree(root->root_key.objectid)) in switch_commit_roots() 92 btrfs_unpin_free_ino(root); in switch_commit_roots() 93 extent_io_tree_release(&root->dirty_log_pages); in switch_commit_roots() 94 btrfs_qgroup_clean_swapped_blocks(root); in switch_commit_roots() 100 root = list_first_entry(&trans->dropped_roots, in switch_commit_roots() [all …]
|
D | root-tree.c | 66 int btrfs_find_root(struct btrfs_root *root, const struct btrfs_key *search_key, in btrfs_find_root() argument 75 ret = btrfs_search_slot(NULL, root, search_key, path, 0, 0); in btrfs_find_root() 121 *root, struct btrfs_key *key, struct btrfs_root_item in btrfs_update_root() 124 struct btrfs_fs_info *fs_info = root->fs_info; in btrfs_update_root() 136 ret = btrfs_search_slot(trans, root, key, path, 0, 1); in btrfs_update_root() 144 root->root_key.objectid); in btrfs_update_root() 162 ret = btrfs_search_slot(trans, root, key, path, in btrfs_update_root() 169 ret = btrfs_del_item(trans, root, path); in btrfs_update_root() 175 ret = btrfs_insert_empty_item(trans, root, path, in btrfs_update_root() 199 int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root *root, in btrfs_insert_root() argument [all …]
|
D | delayed-inode.c | 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() [all …]
|
D | tree-log.c | 95 struct btrfs_root *root, struct btrfs_inode *inode, 101 struct btrfs_root *root, 104 struct btrfs_root *root, 138 struct btrfs_root *root, in start_log_trans() argument 141 struct btrfs_fs_info *fs_info = root->fs_info; in start_log_trans() 144 mutex_lock(&root->log_mutex); in start_log_trans() 146 if (root->log_root) { in start_log_trans() 152 if (!root->log_start_pid) { in start_log_trans() 153 clear_bit(BTRFS_ROOT_MULTI_LOG_TASKS, &root->state); in start_log_trans() 154 root->log_start_pid = current->pid; in start_log_trans() [all …]
|
D | relocation.c | 51 struct btrfs_root *root; member 282 static struct rb_node *tree_insert(struct rb_root *root, u64 bytenr, in tree_insert() argument 285 struct rb_node **p = &root->rb_node; in tree_insert() 302 rb_insert_color(node, root); in tree_insert() 306 static struct rb_node *tree_search(struct rb_root *root, u64 bytenr) in tree_search() argument 308 struct rb_node *n = root->rb_node; in tree_search() 330 if (bnode->root) in backref_tree_panic() 331 fs_info = bnode->root->fs_info; in backref_tree_panic() 520 static bool reloc_root_is_dead(struct btrfs_root *root) in reloc_root_is_dead() argument 528 if (test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state)) in reloc_root_is_dead() [all …]
|
D | inode.c | 55 struct btrfs_root *root; member 168 struct btrfs_root *root, struct inode *inode, in insert_inline_extent() argument 200 ret = btrfs_insert_empty_item(trans, root, path, &key, in insert_inline_extent() 256 ret = btrfs_update_inode(trans, root, inode); in insert_inline_extent() 273 struct btrfs_root *root = BTRFS_I(inode)->root; in cow_file_range_inline() local 274 struct btrfs_fs_info *fs_info = root->fs_info; in cow_file_range_inline() 303 trans = btrfs_join_transaction(root); in cow_file_range_inline() 317 ret = __btrfs_drop_extents(trans, root, inode, path, in cow_file_range_inline() 328 root, inode, start, in cow_file_range_inline() 761 struct btrfs_root *root = BTRFS_I(inode)->root; in submit_compressed_extents() local [all …]
|
D | dir-item.c | 20 struct btrfs_root *root, in insert_with_overflow() argument 27 struct btrfs_fs_info *fs_info = root->fs_info; in insert_with_overflow() 33 ret = btrfs_insert_empty_item(trans, root, path, cpu_key, data_size); in insert_with_overflow() 56 struct btrfs_root *root, in btrfs_insert_xattr_item() argument 69 if (name_len + data_len > BTRFS_MAX_XATTR_SIZE(root->fs_info)) in btrfs_insert_xattr_item() 77 dir_item = insert_with_overflow(trans, root, path, &key, data_size, in btrfs_insert_xattr_item() 114 struct btrfs_root *root = dir->root; in btrfs_insert_dir_item() local 135 dir_item = insert_with_overflow(trans, root, path, &key, data_size, in btrfs_insert_dir_item() 157 if (root == root->fs_info->tree_root) { in btrfs_insert_dir_item() 180 struct btrfs_root *root, in btrfs_lookup_dir_item() argument [all …]
|
D | btrfs_inode.h | 38 struct btrfs_root *root; member 206 const struct btrfs_root *root) in btrfs_inode_hash() argument 208 u64 h = objectid ^ (root->root_key.objectid * GOLDEN_RATIO_PRIME); in btrfs_inode_hash() 219 unsigned long h = btrfs_inode_hash(inode->i_ino, BTRFS_I(inode)->root); in btrfs_insert_inode_hash() 245 struct btrfs_root *root = inode->root; in btrfs_is_free_space_inode() local 247 if (root == root->fs_info->tree_root && in btrfs_is_free_space_inode() 267 trace_btrfs_inode_mod_outstanding_extents(inode->root, btrfs_ino(inode), in btrfs_mod_outstanding_extents() 278 inode->last_sub_trans <= inode->root->last_log_commit) { in btrfs_inode_in_log() 347 struct btrfs_root *root = inode->root; in btrfs_print_data_csum_error() local 348 struct btrfs_super_block *sb = root->fs_info->super_copy; in btrfs_print_data_csum_error() [all …]
|
D | ctree.c | 19 *root, struct btrfs_path *path, int level); 20 static int split_leaf(struct btrfs_trans_handle *trans, struct btrfs_root *root, 29 static void del_ptr(struct btrfs_root *root, struct btrfs_path *path, 126 struct extent_buffer *btrfs_root_node(struct btrfs_root *root) in btrfs_root_node() argument 132 eb = rcu_dereference(root->node); in btrfs_root_node() 154 struct extent_buffer *btrfs_lock_root_node(struct btrfs_root *root) in btrfs_lock_root_node() argument 159 eb = btrfs_root_node(root); in btrfs_lock_root_node() 161 if (eb == root->node) in btrfs_lock_root_node() 173 struct extent_buffer *btrfs_read_lock_root_node(struct btrfs_root *root) in btrfs_read_lock_root_node() argument 178 eb = btrfs_root_node(root); in btrfs_read_lock_root_node() [all …]
|
D | transaction.h | 125 struct btrfs_root *root; member 133 struct btrfs_root *root; member 151 BTRFS_I(inode)->last_sub_trans = BTRFS_I(inode)->root->log_transid; in btrfs_set_inode_last_trans() 152 BTRFS_I(inode)->last_log_commit = BTRFS_I(inode)->root->last_log_commit; in btrfs_set_inode_last_trans() 180 struct btrfs_trans_handle *btrfs_start_transaction(struct btrfs_root *root, 183 struct btrfs_root *root, 186 struct btrfs_trans_handle *btrfs_join_transaction(struct btrfs_root *root); 187 struct btrfs_trans_handle *btrfs_join_transaction_nolock(struct btrfs_root *root); 188 struct btrfs_trans_handle *btrfs_join_transaction_nostart(struct btrfs_root *root); 189 struct btrfs_trans_handle *btrfs_attach_transaction(struct btrfs_root *root); [all …]
|
D | ordered-data.c | 31 static struct rb_node *tree_insert(struct rb_root *root, u64 file_offset, in tree_insert() argument 34 struct rb_node **p = &root->rb_node; in tree_insert() 51 rb_insert_color(node, root); in tree_insert() 67 static struct rb_node *__tree_search(struct rb_root *root, u64 file_offset, in __tree_search() argument 70 struct rb_node *n = root->rb_node; in __tree_search() 144 struct rb_root *root = &tree->tree; in tree_search() local 155 ret = __tree_search(root, file_offset, &prev); in tree_search() 179 struct btrfs_root *root = BTRFS_I(inode)->root; in __btrfs_add_ordered_extent() local 225 spin_lock(&root->ordered_extent_lock); in __btrfs_add_ordered_extent() 227 &root->ordered_extents); in __btrfs_add_ordered_extent() [all …]
|
D | delalloc-space.c | 14 struct btrfs_root *root = inode->root; in btrfs_alloc_data_chunk_ondemand() local 15 struct btrfs_fs_info *fs_info = root->fs_info; in btrfs_alloc_data_chunk_ondemand() 59 trans = btrfs_join_transaction(root); in btrfs_alloc_data_chunk_ondemand() 100 trans = btrfs_join_transaction(root); in btrfs_alloc_data_chunk_ondemand() 197 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_free_reserved_data_space() local 200 len = round_up(start + len, root->fs_info->sectorsize) - in btrfs_free_reserved_data_space() 201 round_down(start, root->fs_info->sectorsize); in btrfs_free_reserved_data_space() 202 start = round_down(start, root->fs_info->sectorsize); in btrfs_free_reserved_data_space() 221 struct btrfs_fs_info *fs_info = inode->root->fs_info; in btrfs_inode_rsv_release() 237 btrfs_qgroup_free_meta_prealloc(inode->root, qgroup_to_release); in btrfs_inode_rsv_release() [all …]
|
D | xattr.c | 27 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_getxattr() local 38 di = btrfs_lookup_xattr(NULL, root, path, btrfs_ino(BTRFS_I(inode)), in btrfs_getxattr() 83 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_setxattr() local 84 struct btrfs_fs_info *fs_info = root->fs_info; in btrfs_setxattr() 91 if (name_len + size > BTRFS_MAX_XATTR_SIZE(root->fs_info)) in btrfs_setxattr() 100 di = btrfs_lookup_xattr(trans, root, path, in btrfs_setxattr() 107 ret = btrfs_delete_one_dir_name(trans, root, path, di); in btrfs_setxattr() 120 di = btrfs_lookup_xattr(NULL, root, path, in btrfs_setxattr() 132 ret = btrfs_insert_xattr_item(trans, root, path, btrfs_ino(BTRFS_I(inode)), in btrfs_setxattr() 193 ret = btrfs_delete_one_dir_name(trans, root, path, di); in btrfs_setxattr() [all …]
|
D | qgroup.h | 353 int __btrfs_qgroup_reserve_meta(struct btrfs_root *root, int num_bytes, 356 static inline int btrfs_qgroup_reserve_meta_pertrans(struct btrfs_root *root, in btrfs_qgroup_reserve_meta_pertrans() argument 359 return __btrfs_qgroup_reserve_meta(root, num_bytes, in btrfs_qgroup_reserve_meta_pertrans() 362 static inline int btrfs_qgroup_reserve_meta_prealloc(struct btrfs_root *root, in btrfs_qgroup_reserve_meta_prealloc() argument 365 return __btrfs_qgroup_reserve_meta(root, num_bytes, in btrfs_qgroup_reserve_meta_prealloc() 369 void __btrfs_qgroup_free_meta(struct btrfs_root *root, int num_bytes, 373 static inline void btrfs_qgroup_free_meta_pertrans(struct btrfs_root *root, in btrfs_qgroup_free_meta_pertrans() argument 376 __btrfs_qgroup_free_meta(root, num_bytes, in btrfs_qgroup_free_meta_pertrans() 381 static inline void btrfs_qgroup_free_meta_prealloc(struct btrfs_root *root, in btrfs_qgroup_free_meta_prealloc() argument 384 __btrfs_qgroup_free_meta(root, num_bytes, in btrfs_qgroup_free_meta_prealloc() [all …]
|
D | ioctl.c | 191 struct btrfs_root *root = binode->root; in btrfs_ioctl_setflags() local 201 if (btrfs_root_readonly(root)) in btrfs_ioctl_setflags() 302 trans = btrfs_start_transaction(root, 3); in btrfs_ioctl_setflags() 328 ret = btrfs_update_inode(trans, root, inode); in btrfs_ioctl_setflags() 390 struct btrfs_root *root = binode->root; in btrfs_ioctl_fssetxattr() local 400 if (btrfs_root_readonly(root)) in btrfs_ioctl_fssetxattr() 450 trans = btrfs_start_transaction(root, 1); in btrfs_ioctl_fssetxattr() 459 ret = btrfs_update_inode(trans, root, inode); in btrfs_ioctl_fssetxattr() 567 struct btrfs_root *root = BTRFS_I(dir)->root; in create_subvol() local 601 ret = btrfs_subvolume_reserve_metadata(root, &block_rsv, 8, false); in create_subvol() [all …]
|
D | export.c | 36 fid->root_objectid = BTRFS_I(inode)->root->root_key.objectid; in btrfs_encode_fh() 44 parent_root_id = BTRFS_I(parent)->root->root_key.objectid; in btrfs_encode_fh() 65 struct btrfs_root *root; in btrfs_get_dentry() local 80 root = btrfs_read_fs_root_no_name(fs_info, &key); in btrfs_get_dentry() 81 if (IS_ERR(root)) { in btrfs_get_dentry() 82 err = PTR_ERR(root); in btrfs_get_dentry() 90 inode = btrfs_iget(sb, &key, root, NULL); in btrfs_get_dentry() 159 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_get_parent() local 172 key.objectid = root->root_key.objectid; in btrfs_get_parent() 175 root = fs_info->tree_root; in btrfs_get_parent() [all …]
|
/fs/btrfs/tests/ |
D | qgroup-tests.c | 14 static int insert_normal_tree_ref(struct btrfs_root *root, u64 bytenr, in insert_normal_tree_ref() argument 40 ret = btrfs_insert_empty_item(&trans, root, path, &ins, size); in insert_normal_tree_ref() 67 static int add_tree_ref(struct btrfs_root *root, u64 bytenr, u64 num_bytes, in add_tree_ref() argument 90 ret = btrfs_search_slot(&trans, root, &key, path, 0, 1); in add_tree_ref() 112 ret = btrfs_insert_empty_item(&trans, root, path, &key, 0); in add_tree_ref() 119 static int remove_extent_item(struct btrfs_root *root, u64 bytenr, in remove_extent_item() argument 140 ret = btrfs_search_slot(&trans, root, &key, path, -1, 1); in remove_extent_item() 146 btrfs_del_item(&trans, root, path); in remove_extent_item() 151 static int remove_extent_ref(struct btrfs_root *root, u64 bytenr, in remove_extent_ref() argument 174 ret = btrfs_search_slot(&trans, root, &key, path, 0, 1); in remove_extent_ref() [all …]
|
D | inode-tests.c | 15 static void insert_extent(struct btrfs_root *root, u64 start, u64 len, in insert_extent() argument 21 struct extent_buffer *leaf = root->node; in insert_extent() 36 setup_items_for_insert(root, &path, &key, &value_len, value_len, in insert_extent() 51 static void insert_inode_item_key(struct btrfs_root *root) in insert_inode_item_key() argument 54 struct extent_buffer *leaf = root->node; in insert_inode_item_key() 67 setup_items_for_insert(root, &path, &key, &value_len, value_len, in insert_inode_item_key() 89 static void setup_file_extents(struct btrfs_root *root, u32 sectorsize) in setup_file_extents() argument 96 insert_extent(root, offset, 5, 5, 0, 0, 0, BTRFS_FILE_EXTENT_REG, 0, in setup_file_extents() 107 insert_extent(root, offset, 1, 1, 0, 0, 0, BTRFS_FILE_EXTENT_INLINE, 0, in setup_file_extents() 113 insert_extent(root, offset, 4, 4, 0, 0, 0, BTRFS_FILE_EXTENT_REG, 0, in setup_file_extents() [all …]
|
/fs/kernfs/ |
D | mount.c | 26 struct kernfs_root *root = kernfs_root(kernfs_dentry_node(dentry)); in kernfs_sop_show_options() local 27 struct kernfs_syscall_ops *scops = root->syscall_ops; in kernfs_sop_show_options() 30 return scops->show_options(sf, root); in kernfs_sop_show_options() 37 struct kernfs_root *root = kernfs_root(node); in kernfs_sop_show_path() local 38 struct kernfs_syscall_ops *scops = root->syscall_ops; in kernfs_sop_show_path() 41 return scops->show_path(sf, node, root); in kernfs_sop_show_path() 60 struct kernfs_node *kernfs_get_node_by_id(struct kernfs_root *root, in kernfs_get_node_by_id() argument 65 kn = kernfs_find_and_get_node_by_ino(root, id->ino); in kernfs_get_node_by_id() 85 kn = kernfs_find_and_get_node_by_ino(info->root, ino); in kernfs_fh_get_inode() 138 return kernfs_info(sb)->root; in kernfs_root_from_sb() [all …]
|
D | dir.c | 460 struct kernfs_root *root = kernfs_root(kn); in kernfs_drain() local 474 wait_event(root->deactivate_waitq, in kernfs_drain() 509 struct kernfs_root *root; in kernfs_put() local 517 root = kernfs_root(kn); in kernfs_put() 539 idr_remove(&root->ino_idr, kn->id.ino); in kernfs_put() 549 idr_destroy(&root->ino_idr); in kernfs_put() 550 kfree(root); in kernfs_put() 617 static struct kernfs_node *__kernfs_new_node(struct kernfs_root *root, in __kernfs_new_node() argument 637 ret = idr_alloc_cyclic(&root->ino_idr, kn, 1, 0, GFP_ATOMIC); in __kernfs_new_node() 638 if (ret >= 0 && ret < root->last_ino) in __kernfs_new_node() [all …]
|
/fs/nfs/blocklayout/ |
D | extent_tree.c | 19 ext_tree_first(struct rb_root *root) in ext_tree_first() argument 21 struct rb_node *node = rb_first(root); in ext_tree_first() 46 __ext_tree_search(struct rb_root *root, sector_t start) in __ext_tree_search() argument 48 struct rb_node *node = root->rb_node; in __ext_tree_search() 95 ext_try_to_merge_left(struct rb_root *root, struct pnfs_block_extent *be) in ext_try_to_merge_left() argument 101 rb_erase(&be->be_node, root); in ext_try_to_merge_left() 111 ext_try_to_merge_right(struct rb_root *root, struct pnfs_block_extent *be) in ext_try_to_merge_right() argument 117 rb_erase(&right->be_node, root); in ext_try_to_merge_right() 136 __ext_tree_insert(struct rb_root *root, in __ext_tree_insert() argument 139 struct rb_node **p = &root->rb_node, *parent = NULL; in __ext_tree_insert() [all …]
|
/fs/ |
D | d_path.c | 76 const struct path *root, in prepend_path() argument 100 while (dentry != root->dentry || vfsmnt != root->mnt) { in prepend_path() 177 const struct path *root, in __d_path() argument 184 error = prepend_path(path, root, &res, &buflen); in __d_path() 196 struct path root = {}; in d_absolute_path() local 201 error = prepend_path(path, &root, &res, &buflen); in d_absolute_path() 214 const struct path *root, in path_with_deleted() argument 224 return prepend_path(path, root, buf, buflen); in path_with_deleted() 232 static void get_fs_root_rcu(struct fs_struct *fs, struct path *root) in get_fs_root_rcu() argument 238 *root = fs->root; in get_fs_root_rcu() [all …]
|