/fs/btrfs/ |
D | transaction.c | 153 static noinline void switch_commit_roots(struct btrfs_trans_handle *trans) in switch_commit_roots() argument 155 struct btrfs_transaction *cur_trans = trans->transaction; in switch_commit_roots() 156 struct btrfs_fs_info *fs_info = trans->fs_info; in switch_commit_roots() 179 btrfs_free_log(trans, root); in switch_commit_roots() 226 static inline void extwriter_counter_inc(struct btrfs_transaction *trans, in extwriter_counter_inc() argument 230 atomic_inc(&trans->num_extwriters); in extwriter_counter_inc() 233 static inline void extwriter_counter_dec(struct btrfs_transaction *trans, in extwriter_counter_dec() argument 237 atomic_dec(&trans->num_extwriters); in extwriter_counter_dec() 240 static inline void extwriter_counter_init(struct btrfs_transaction *trans, in extwriter_counter_init() argument 243 atomic_set(&trans->num_extwriters, ((type & TRANS_EXTWRITERS) ? 1 : 0)); in extwriter_counter_init() [all …]
|
D | free-space-tree.c | 15 static int __add_block_group_free_space(struct btrfs_trans_handle *trans, 50 static int add_new_free_space_info(struct btrfs_trans_handle *trans, in add_new_free_space_info() argument 54 struct btrfs_root *root = trans->fs_info->free_space_root; in add_new_free_space_info() 64 ret = btrfs_insert_empty_item(trans, root, path, &key, sizeof(*info)); in add_new_free_space_info() 83 struct btrfs_trans_handle *trans, in search_free_space_info() argument 96 ret = btrfs_search_slot(trans, root, &key, path, 0, cow); in search_free_space_info() 114 static int btrfs_search_prev_slot(struct btrfs_trans_handle *trans, in btrfs_search_prev_slot() argument 121 ret = btrfs_search_slot(trans, root, key, p, ins_len, cow); in btrfs_search_prev_slot() 185 int convert_free_space_to_bitmaps(struct btrfs_trans_handle *trans, in convert_free_space_to_bitmaps() argument 189 struct btrfs_fs_info *fs_info = trans->fs_info; in convert_free_space_to_bitmaps() [all …]
|
D | extent-tree.c | 41 static int __btrfs_free_extent(struct btrfs_trans_handle *trans, 49 static int alloc_reserved_file_extent(struct btrfs_trans_handle *trans, 53 static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans, 113 int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans, in btrfs_lookup_extent_info() argument 141 if (!trans) { in btrfs_lookup_extent_info() 154 ret = btrfs_search_slot(trans, fs_info->extent_root, &key, path, 0, 0); in btrfs_lookup_extent_info() 181 if (trans) in btrfs_lookup_extent_info() 182 btrfs_abort_transaction(trans, ret); in btrfs_lookup_extent_info() 196 if (!trans) in btrfs_lookup_extent_info() 199 delayed_refs = &trans->transaction->delayed_refs; in btrfs_lookup_extent_info() [all …]
|
D | tree-log.c | 96 static int btrfs_log_inode(struct btrfs_trans_handle *trans, 100 static int link_to_fixup_dir(struct btrfs_trans_handle *trans, 103 static noinline int replay_dir_deletes(struct btrfs_trans_handle *trans, 137 static int start_log_trans(struct btrfs_trans_handle *trans, in start_log_trans() argument 147 if (btrfs_need_log_full_commit(trans)) { in start_log_trans() 161 ret = btrfs_init_log_root_tree(trans, fs_info); in start_log_trans() 166 ret = btrfs_add_log_tree(trans, root); in start_log_trans() 284 struct btrfs_trans_handle *trans; member 316 ret = btrfs_pin_extent_for_log_replay(wc->trans, eb->start, in process_one_buffer() 344 static noinline int overwrite_item(struct btrfs_trans_handle *trans, in overwrite_item() argument [all …]
|
D | tree-log.h | 51 static inline void btrfs_set_log_full_commit(struct btrfs_trans_handle *trans) in btrfs_set_log_full_commit() argument 53 WRITE_ONCE(trans->fs_info->last_trans_log_full_commit, trans->transid); in btrfs_set_log_full_commit() 56 static inline int btrfs_need_log_full_commit(struct btrfs_trans_handle *trans) in btrfs_need_log_full_commit() argument 58 return READ_ONCE(trans->fs_info->last_trans_log_full_commit) == in btrfs_need_log_full_commit() 59 trans->transid; in btrfs_need_log_full_commit() 62 int btrfs_sync_log(struct btrfs_trans_handle *trans, 64 int btrfs_free_log(struct btrfs_trans_handle *trans, struct btrfs_root *root); 65 int btrfs_free_log_root_tree(struct btrfs_trans_handle *trans, 68 int btrfs_log_dentry_safe(struct btrfs_trans_handle *trans, 71 int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans, [all …]
|
D | root-tree.c | 118 int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root in btrfs_update_root() argument 134 ret = btrfs_search_slot(trans, root, key, path, 0, 1); in btrfs_update_root() 144 btrfs_abort_transaction(trans, ret); in btrfs_update_root() 160 ret = btrfs_search_slot(trans, root, key, path, in btrfs_update_root() 163 btrfs_abort_transaction(trans, ret); in btrfs_update_root() 167 ret = btrfs_del_item(trans, root, path); in btrfs_update_root() 169 btrfs_abort_transaction(trans, ret); in btrfs_update_root() 173 ret = btrfs_insert_empty_item(trans, root, path, in btrfs_update_root() 176 btrfs_abort_transaction(trans, ret); in btrfs_update_root() 197 int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root *root, in btrfs_insert_root() argument [all …]
|
D | qgroup.c | 583 static int add_qgroup_relation_item(struct btrfs_trans_handle *trans, u64 src, in add_qgroup_relation_item() argument 587 struct btrfs_root *quota_root = trans->fs_info->quota_root; in add_qgroup_relation_item() 599 ret = btrfs_insert_empty_item(trans, quota_root, path, &key, 0); in add_qgroup_relation_item() 607 static int del_qgroup_relation_item(struct btrfs_trans_handle *trans, u64 src, in del_qgroup_relation_item() argument 611 struct btrfs_root *quota_root = trans->fs_info->quota_root; in del_qgroup_relation_item() 623 ret = btrfs_search_slot(trans, quota_root, &key, path, -1, 1); in del_qgroup_relation_item() 632 ret = btrfs_del_item(trans, quota_root, path); in del_qgroup_relation_item() 638 static int add_qgroup_item(struct btrfs_trans_handle *trans, in add_qgroup_item() argument 665 ret = btrfs_insert_empty_item(trans, quota_root, path, &key, in add_qgroup_item() 673 btrfs_set_qgroup_info_generation(leaf, qgroup_info, trans->transid); in add_qgroup_item() [all …]
|
D | transaction.h | 148 #define TRANS_ABORTED(trans) (unlikely(READ_ONCE((trans)->aborted))) argument 168 static inline void btrfs_set_inode_last_trans(struct btrfs_trans_handle *trans, in btrfs_set_inode_last_trans() argument 172 inode->last_trans = trans->transaction->transid; in btrfs_set_inode_last_trans() 182 static inline void btrfs_set_skip_qgroup(struct btrfs_trans_handle *trans, in btrfs_set_skip_qgroup() argument 187 delayed_refs = &trans->transaction->delayed_refs; in btrfs_set_skip_qgroup() 192 static inline void btrfs_clear_skip_qgroup(struct btrfs_trans_handle *trans) in btrfs_clear_skip_qgroup() argument 196 delayed_refs = &trans->transaction->delayed_refs; in btrfs_clear_skip_qgroup() 201 int btrfs_end_transaction(struct btrfs_trans_handle *trans); 218 int btrfs_commit_transaction(struct btrfs_trans_handle *trans); 219 int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans, [all …]
|
D | block-group.c | 879 static int remove_block_group_item(struct btrfs_trans_handle *trans, in remove_block_group_item() argument 883 struct btrfs_fs_info *fs_info = trans->fs_info; in remove_block_group_item() 893 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in remove_block_group_item() 899 ret = btrfs_del_item(trans, root, path); in remove_block_group_item() 903 int btrfs_remove_block_group(struct btrfs_trans_handle *trans, in btrfs_remove_block_group() argument 906 struct btrfs_fs_info *fs_info = trans->fs_info; in btrfs_remove_block_group() 964 mutex_lock(&trans->transaction->cache_write_mutex); in btrfs_remove_block_group() 969 spin_lock(&trans->transaction->dirty_bgs_lock); in btrfs_remove_block_group() 975 spin_unlock(&trans->transaction->dirty_bgs_lock); in btrfs_remove_block_group() 976 btrfs_wait_cache_io(trans, block_group, path); in btrfs_remove_block_group() [all …]
|
D | xattr.c | 79 int btrfs_setxattr(struct btrfs_trans_handle *trans, struct inode *inode, in btrfs_setxattr() argument 89 ASSERT(trans); 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() 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() 231 struct btrfs_trans_handle *trans; in btrfs_setxattr_trans() local 240 trans = btrfs_start_transaction(root, 2); in btrfs_setxattr_trans() 241 if (IS_ERR(trans)) in btrfs_setxattr_trans() 242 return PTR_ERR(trans); in btrfs_setxattr_trans() [all …]
|
D | inode.c | 143 static int btrfs_init_inode_security(struct btrfs_trans_handle *trans, in btrfs_init_inode_security() argument 149 err = btrfs_init_acl(trans, inode, dir); in btrfs_init_inode_security() 151 err = btrfs_xattr_security_init(trans, inode, dir, qstr); in btrfs_init_inode_security() 160 static int insert_inline_extent(struct btrfs_trans_handle *trans, in insert_inline_extent() argument 194 ret = btrfs_insert_empty_item(trans, root, path, &key, in insert_inline_extent() 202 btrfs_set_file_extent_generation(leaf, ei, trans->transid); in insert_inline_extent() 259 ret = btrfs_update_inode(trans, root, inode); in insert_inline_extent() 278 struct btrfs_trans_handle *trans; in cow_file_range_inline() local 306 trans = btrfs_join_transaction(root); in cow_file_range_inline() 307 if (IS_ERR(trans)) { in cow_file_range_inline() [all …]
|
D | relocation.c | 240 static int update_backref_cache(struct btrfs_trans_handle *trans, in update_backref_cache() argument 247 cache->last_trans = trans->transid; in update_backref_cache() 251 if (cache->last_trans == trans->transid) in update_backref_cache() 535 static int clone_backref_node(struct btrfs_trans_handle *trans, in clone_backref_node() argument 549 update_backref_cache(trans, cache); in clone_backref_node() 599 btrfs_backref_panic(trans->fs_info, new_node->bytenr, -EEXIST); in clone_backref_node() 728 static struct btrfs_root *create_reloc_root(struct btrfs_trans_handle *trans, in create_reloc_root() argument 751 ret = btrfs_copy_root(trans, root, root->commit_root, &eb, in create_reloc_root() 774 ret = btrfs_copy_root(trans, root, root->node, &eb, in create_reloc_root() 789 btrfs_set_root_generation(root_item, trans->transid); in create_reloc_root() [all …]
|
D | delayed-ref.c | 53 int btrfs_should_throttle_delayed_refs(struct btrfs_trans_handle *trans) in btrfs_should_throttle_delayed_refs() argument 56 atomic_read(&trans->transaction->delayed_refs.num_entries); in btrfs_should_throttle_delayed_refs() 61 avg_runtime = trans->fs_info->avg_delayed_ref_runtime; in btrfs_should_throttle_delayed_refs() 68 return btrfs_check_space_for_delayed_refs(trans->fs_info); in btrfs_should_throttle_delayed_refs() 98 void btrfs_update_delayed_refs_rsv(struct btrfs_trans_handle *trans) in btrfs_update_delayed_refs_rsv() argument 100 struct btrfs_fs_info *fs_info = trans->fs_info; in btrfs_update_delayed_refs_rsv() 104 if (!trans->delayed_ref_updates) in btrfs_update_delayed_refs_rsv() 108 trans->delayed_ref_updates); in btrfs_update_delayed_refs_rsv() 113 trans->delayed_ref_updates = 0; in btrfs_update_delayed_refs_rsv() 414 static inline void drop_delayed_ref(struct btrfs_trans_handle *trans, in drop_delayed_ref() argument [all …]
|
D | delayed-inode.c | 548 static int btrfs_delayed_item_reserve_metadata(struct btrfs_trans_handle *trans, in btrfs_delayed_item_reserve_metadata() argument 558 if (!trans->bytes_reserved) in btrfs_delayed_item_reserve_metadata() 561 src_rsv = trans->block_rsv; in btrfs_delayed_item_reserve_metadata() 603 struct btrfs_trans_handle *trans, in btrfs_delayed_inode_reserve_metadata() argument 614 src_rsv = trans->block_rsv; in btrfs_delayed_inode_reserve_metadata() 628 if (!src_rsv || (!trans->bytes_reserved && in btrfs_delayed_inode_reserve_metadata() 800 static int btrfs_insert_delayed_item(struct btrfs_trans_handle *trans, in btrfs_insert_delayed_item() argument 811 ret = btrfs_insert_empty_item(trans, root, path, &delayed_item->key, in btrfs_insert_delayed_item() 833 static int btrfs_insert_delayed_items(struct btrfs_trans_handle *trans, in btrfs_insert_delayed_items() argument 847 ret = btrfs_insert_delayed_item(trans, root, path, curr); in btrfs_insert_delayed_items() [all …]
|
D | qgroup.h | 252 int btrfs_add_qgroup_relation(struct btrfs_trans_handle *trans, u64 src, 254 int btrfs_del_qgroup_relation(struct btrfs_trans_handle *trans, u64 src, 256 int btrfs_create_qgroup(struct btrfs_trans_handle *trans, u64 qgroupid); 257 int btrfs_remove_qgroup(struct btrfs_trans_handle *trans, u64 qgroupid); 258 int btrfs_limit_qgroup(struct btrfs_trans_handle *trans, u64 qgroupid, 317 int btrfs_qgroup_trace_extent(struct btrfs_trans_handle *trans, u64 bytenr, 326 int btrfs_qgroup_trace_leaf_items(struct btrfs_trans_handle *trans, 338 int btrfs_qgroup_trace_subtree(struct btrfs_trans_handle *trans, 341 int btrfs_qgroup_account_extent(struct btrfs_trans_handle *trans, u64 bytenr, 344 int btrfs_qgroup_account_extents(struct btrfs_trans_handle *trans); [all …]
|
D | free-space-tree.h | 23 int add_block_group_free_space(struct btrfs_trans_handle *trans, 25 int remove_block_group_free_space(struct btrfs_trans_handle *trans, 27 int add_to_free_space_tree(struct btrfs_trans_handle *trans, 29 int remove_from_free_space_tree(struct btrfs_trans_handle *trans, 34 search_free_space_info(struct btrfs_trans_handle *trans, 37 int __add_to_free_space_tree(struct btrfs_trans_handle *trans, 40 int __remove_from_free_space_tree(struct btrfs_trans_handle *trans, 43 int convert_free_space_to_bitmaps(struct btrfs_trans_handle *trans, 46 int convert_free_space_to_extents(struct btrfs_trans_handle *trans,
|
D | inode-map.c | 398 struct btrfs_trans_handle *trans) in btrfs_save_ino_cache() argument 429 rsv = trans->block_rsv; in btrfs_save_ino_cache() 430 trans->block_rsv = &fs_info->trans_block_rsv; in btrfs_save_ino_cache() 432 num_bytes = trans->bytes_reserved; in btrfs_save_ino_cache() 440 trans->bytes_reserved = btrfs_calc_insert_metadata_size(fs_info, 10); in btrfs_save_ino_cache() 441 ret = btrfs_block_rsv_add(root, trans->block_rsv, in btrfs_save_ino_cache() 442 trans->bytes_reserved, in btrfs_save_ino_cache() 446 trace_btrfs_space_reservation(fs_info, "ino_cache", trans->transid, in btrfs_save_ino_cache() 447 trans->bytes_reserved, 1); in btrfs_save_ino_cache() 459 ret = create_free_ino_inode(root, trans, path); in btrfs_save_ino_cache() [all …]
|
D | reflink.c | 13 static int clone_finish_inode_update(struct btrfs_trans_handle *trans, in clone_finish_inode_update() argument 37 ret = btrfs_update_inode(trans, root, inode); in clone_finish_inode_update() 39 btrfs_abort_transaction(trans, ret); in clone_finish_inode_update() 40 btrfs_end_transaction(trans); in clone_finish_inode_update() 43 ret = btrfs_end_transaction(trans); in clone_finish_inode_update() 178 struct btrfs_trans_handle *trans = NULL; in clone_copy_inline_extent() local 258 trans = btrfs_start_transaction(root, 3); in clone_copy_inline_extent() 259 if (IS_ERR(trans)) { in clone_copy_inline_extent() 260 ret = PTR_ERR(trans); in clone_copy_inline_extent() 261 trans = NULL; in clone_copy_inline_extent() [all …]
|
D | dir-item.c | 19 *trans, in insert_with_overflow() 33 ret = btrfs_insert_empty_item(trans, root, path, cpu_key, data_size); in insert_with_overflow() 55 int btrfs_insert_xattr_item(struct btrfs_trans_handle *trans, in btrfs_insert_xattr_item() argument 77 dir_item = insert_with_overflow(trans, root, path, &key, data_size, in btrfs_insert_xattr_item() 88 btrfs_set_dir_transid(leaf, dir_item, trans->transid); in btrfs_insert_xattr_item() 108 int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, const char *name, in btrfs_insert_dir_item() argument 135 dir_item = insert_with_overflow(trans, root, path, &key, data_size, in btrfs_insert_dir_item() 149 btrfs_set_dir_transid(leaf, dir_item, trans->transid); in btrfs_insert_dir_item() 163 ret2 = btrfs_insert_delayed_dir_index(trans, name, name_len, dir, in btrfs_insert_dir_item() 175 struct btrfs_trans_handle *trans, in btrfs_lookup_match_dir() argument [all …]
|
D | file.c | 134 int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, in btrfs_add_inode_defrag() argument 149 if (trans) in btrfs_add_inode_defrag() 150 transid = trans->transid; in btrfs_add_inode_defrag() 675 int __btrfs_drop_extents(struct btrfs_trans_handle *trans, in __btrfs_drop_extents() argument 716 ret = btrfs_lookup_file_extent(trans, root, path, ino, in __btrfs_drop_extents() 817 ret = btrfs_duplicate_item(trans, root, path, in __btrfs_drop_extents() 849 ret = btrfs_inc_extent_ref(trans, &ref); in __btrfs_drop_extents() 936 ret = btrfs_free_extent(trans, &ref); in __btrfs_drop_extents() 950 ret = btrfs_del_items(trans, root, path, del_slot, in __btrfs_drop_extents() 953 btrfs_abort_transaction(trans, ret); in __btrfs_drop_extents() [all …]
|
D | ctree.c | 18 static int split_node(struct btrfs_trans_handle *trans, struct btrfs_root 20 static int split_leaf(struct btrfs_trans_handle *trans, struct btrfs_root *root, 23 static int push_node_left(struct btrfs_trans_handle *trans, 26 static int balance_node_right(struct btrfs_trans_handle *trans, 178 int btrfs_copy_root(struct btrfs_trans_handle *trans, in btrfs_copy_root() argument 190 trans->transid != fs_info->running_transaction->transid); in btrfs_copy_root() 192 trans->transid != root->last_trans); in btrfs_copy_root() 200 cow = btrfs_alloc_tree_block(trans, root, 0, new_root_objectid, in btrfs_copy_root() 208 btrfs_set_header_generation(cow, trans->transid); in btrfs_copy_root() 219 WARN_ON(btrfs_header_generation(buf) > trans->transid); in btrfs_copy_root() [all …]
|
/fs/xfs/ |
D | xfs_attr_inactive.c | 83 struct xfs_trans **trans, in xfs_attr3_leaf_inactive() argument 120 xfs_trans_brelse(*trans, bp); in xfs_attr3_leaf_inactive() 131 struct xfs_trans **trans, in xfs_attr3_node_inactive() argument 149 xfs_trans_brelse(*trans, bp); /* no locks for later trans */ in xfs_attr3_node_inactive() 156 xfs_trans_brelse(*trans, bp); in xfs_attr3_node_inactive() 160 xfs_trans_brelse(*trans, bp); /* no locks for later trans */ in xfs_attr3_node_inactive() 174 error = xfs_da3_node_read(*trans, dp, child_fsb, &child_bp, in xfs_attr3_node_inactive() 189 error = xfs_attr3_node_inactive(trans, dp, child_bp, in xfs_attr3_node_inactive() 194 error = xfs_attr3_leaf_inactive(trans, dp, child_bp); in xfs_attr3_node_inactive() 198 xfs_trans_brelse(*trans, child_bp); in xfs_attr3_node_inactive() [all …]
|
/fs/btrfs/tests/ |
D | free-space-tree-tests.c | 19 static int __check_free_space_extents(struct btrfs_trans_handle *trans, in __check_free_space_extents() argument 34 info = search_free_space_info(trans, cache, path, 0); in __check_free_space_extents() 106 static int check_free_space_extents(struct btrfs_trans_handle *trans, in check_free_space_extents() argument 117 info = search_free_space_info(trans, cache, path, 0); in check_free_space_extents() 126 ret = __check_free_space_extents(trans, fs_info, cache, path, extents, in check_free_space_extents() 133 ret = convert_free_space_to_extents(trans, cache, path); in check_free_space_extents() 139 ret = convert_free_space_to_bitmaps(trans, cache, path); in check_free_space_extents() 145 return __check_free_space_extents(trans, fs_info, cache, path, extents, in check_free_space_extents() 149 static int test_empty_block_group(struct btrfs_trans_handle *trans, in test_empty_block_group() argument 159 return check_free_space_extents(trans, fs_info, cache, path, in test_empty_block_group() [all …]
|
D | qgroup-tests.c | 17 struct btrfs_trans_handle trans; in insert_normal_tree_ref() local 27 btrfs_init_dummy_trans(&trans, NULL); in insert_normal_tree_ref() 40 ret = btrfs_insert_empty_item(&trans, root, path, &ins, size); in insert_normal_tree_ref() 70 struct btrfs_trans_handle trans; in add_tree_ref() local 77 btrfs_init_dummy_trans(&trans, NULL); in add_tree_ref() 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() 122 struct btrfs_trans_handle trans; in remove_extent_item() local 127 btrfs_init_dummy_trans(&trans, NULL); in remove_extent_item() 140 ret = btrfs_search_slot(&trans, root, &key, path, -1, 1); in remove_extent_item() [all …]
|
/fs/xfs/libxfs/ |
D | xfs_attr.c | 198 xfs_trans_ichgtime(args->trans, dp, XFS_ICHGTIME_CHG); in xfs_attr_try_sf_addname() 201 xfs_trans_set_sync(args->trans); in xfs_attr_try_sf_addname() 237 error2 = xfs_trans_commit(args->trans); in xfs_attr_set_shortform() 238 args->trans = NULL; in xfs_attr_set_shortform() 255 xfs_trans_bhold(args->trans, *leaf_bp); in xfs_attr_set_shortform() 256 error = xfs_defer_finish(&args->trans); in xfs_attr_set_shortform() 257 xfs_trans_bhold_release(args->trans, *leaf_bp); in xfs_attr_set_shortform() 259 xfs_trans_brelse(args->trans, *leaf_bp); in xfs_attr_set_shortform() 292 if (error || !args->trans) in xfs_attr_set_args() 314 error = xfs_defer_finish(&args->trans); in xfs_attr_set_args() [all …]
|