Home
last modified time | relevance | path

Searched refs:trans (Results 1 – 25 of 99) sorted by relevance

1234

/fs/btrfs/
Dtransaction.c176 static noinline void switch_commit_roots(struct btrfs_trans_handle *trans) in switch_commit_roots() argument
178 struct btrfs_transaction *cur_trans = trans->transaction; in switch_commit_roots()
179 struct btrfs_fs_info *fs_info = trans->fs_info; in switch_commit_roots()
191 fs_info->last_reloc_trans = trans->transid; in switch_commit_roots()
209 btrfs_free_log(trans, root); in switch_commit_roots()
218 static inline void extwriter_counter_inc(struct btrfs_transaction *trans, in extwriter_counter_inc() argument
222 atomic_inc(&trans->num_extwriters); in extwriter_counter_inc()
225 static inline void extwriter_counter_dec(struct btrfs_transaction *trans, in extwriter_counter_dec() argument
229 atomic_dec(&trans->num_extwriters); in extwriter_counter_dec()
232 static inline void extwriter_counter_init(struct btrfs_transaction *trans, in extwriter_counter_init() argument
[all …]
Dfree-space-tree.c20 static int __add_block_group_free_space(struct btrfs_trans_handle *trans,
69 static int add_new_free_space_info(struct btrfs_trans_handle *trans, in add_new_free_space_info() argument
83 ret = btrfs_insert_empty_item(trans, root, path, &key, sizeof(*info)); in add_new_free_space_info()
92 btrfs_mark_buffer_dirty(trans, leaf); in add_new_free_space_info()
102 struct btrfs_trans_handle *trans, in search_free_space_info() argument
115 ret = btrfs_search_slot(trans, root, &key, path, 0, cow); in search_free_space_info()
133 static int btrfs_search_prev_slot(struct btrfs_trans_handle *trans, in btrfs_search_prev_slot() argument
140 ret = btrfs_search_slot(trans, root, key, p, ins_len, cow); in btrfs_search_prev_slot()
205 int convert_free_space_to_bitmaps(struct btrfs_trans_handle *trans, in convert_free_space_to_bitmaps() argument
209 struct btrfs_fs_info *fs_info = trans->fs_info; in convert_free_space_to_bitmaps()
[all …]
Dtree-log.c106 static int btrfs_log_inode(struct btrfs_trans_handle *trans,
110 static int link_to_fixup_dir(struct btrfs_trans_handle *trans,
113 static noinline int replay_dir_deletes(struct btrfs_trans_handle *trans,
167 static int start_log_trans(struct btrfs_trans_handle *trans, in start_log_trans() argument
184 ret = btrfs_init_log_root_tree(trans, fs_info); in start_log_trans()
201 if (btrfs_need_log_full_commit(trans)) { in start_log_trans()
229 ret = btrfs_add_log_tree(trans, root); in start_log_trans()
332 struct btrfs_trans_handle *trans; member
369 ret = btrfs_pin_extent_for_log_replay(wc->trans, eb->start, in process_one_buffer()
395 static int overwrite_item(struct btrfs_trans_handle *trans, in overwrite_item() argument
[all …]
Dverity.c111 struct btrfs_trans_handle *trans; in drop_verity_items() local
124 trans = btrfs_start_transaction(root, 1); in drop_verity_items()
125 if (IS_ERR(trans)) { in drop_verity_items()
126 ret = PTR_ERR(trans); in drop_verity_items()
138 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in drop_verity_items()
146 btrfs_end_transaction(trans); in drop_verity_items()
162 ret = btrfs_del_items(trans, root, path, path->slots[0], 1); in drop_verity_items()
164 btrfs_end_transaction(trans); in drop_verity_items()
169 btrfs_end_transaction(trans); in drop_verity_items()
172 btrfs_end_transaction(trans); in drop_verity_items()
[all …]
Dctree.c29 static int split_node(struct btrfs_trans_handle *trans, struct btrfs_root
31 static int split_leaf(struct btrfs_trans_handle *trans, struct btrfs_root *root,
34 static int push_node_left(struct btrfs_trans_handle *trans,
37 static int balance_node_right(struct btrfs_trans_handle *trans,
309 int btrfs_copy_root(struct btrfs_trans_handle *trans, in btrfs_copy_root() argument
321 trans->transid != fs_info->running_transaction->transid); in btrfs_copy_root()
323 trans->transid != root->last_trans); in btrfs_copy_root()
331 cow = btrfs_alloc_tree_block(trans, root, 0, new_root_objectid, in btrfs_copy_root()
339 btrfs_set_header_generation(cow, trans->transid); in btrfs_copy_root()
350 WARN_ON(btrfs_header_generation(buf) > trans->transid); in btrfs_copy_root()
[all …]
Dextent-tree.c49 static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
57 static int alloc_reserved_file_extent(struct btrfs_trans_handle *trans,
61 static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
101 int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans, in btrfs_lookup_extent_info() argument
130 if (!trans) { in btrfs_lookup_extent_info()
173 if (trans) in btrfs_lookup_extent_info()
174 btrfs_abort_transaction(trans, ret); in btrfs_lookup_extent_info()
188 if (!trans) in btrfs_lookup_extent_info()
191 delayed_refs = &trans->transaction->delayed_refs; in btrfs_lookup_extent_info()
430 static noinline int lookup_extent_data_ref(struct btrfs_trans_handle *trans, in lookup_extent_data_ref() argument
[all …]
Dtransaction.h153 #define TRANS_ABORTED(trans) (unlikely(READ_ONCE((trans)->aborted))) argument
173 static inline void btrfs_set_inode_last_trans(struct btrfs_trans_handle *trans, in btrfs_set_inode_last_trans() argument
177 inode->last_trans = trans->transaction->transid; in btrfs_set_inode_last_trans()
187 static inline void btrfs_set_skip_qgroup(struct btrfs_trans_handle *trans, in btrfs_set_skip_qgroup() argument
192 delayed_refs = &trans->transaction->delayed_refs; in btrfs_set_skip_qgroup()
197 static inline void btrfs_clear_skip_qgroup(struct btrfs_trans_handle *trans) in btrfs_clear_skip_qgroup() argument
201 delayed_refs = &trans->transaction->delayed_refs; in btrfs_clear_skip_qgroup()
212 #define btrfs_abort_transaction(trans, errno) \ argument
217 &((trans)->fs_info->fs_state))) { \
225 btrfs_err((trans)->fs_info, \
[all …]
Dqgroup.c608 static int add_qgroup_relation_item(struct btrfs_trans_handle *trans, u64 src, in add_qgroup_relation_item() argument
612 struct btrfs_root *quota_root = trans->fs_info->quota_root; in add_qgroup_relation_item()
624 ret = btrfs_insert_empty_item(trans, quota_root, path, &key, 0); in add_qgroup_relation_item()
626 btrfs_mark_buffer_dirty(trans, path->nodes[0]); in add_qgroup_relation_item()
632 static int del_qgroup_relation_item(struct btrfs_trans_handle *trans, u64 src, in del_qgroup_relation_item() argument
636 struct btrfs_root *quota_root = trans->fs_info->quota_root; in del_qgroup_relation_item()
648 ret = btrfs_search_slot(trans, quota_root, &key, path, -1, 1); in del_qgroup_relation_item()
657 ret = btrfs_del_item(trans, quota_root, path); in del_qgroup_relation_item()
663 static int add_qgroup_item(struct btrfs_trans_handle *trans, in add_qgroup_item() argument
690 ret = btrfs_insert_empty_item(trans, quota_root, path, &key, in add_qgroup_item()
[all …]
Dtree-log.h71 static inline void btrfs_set_log_full_commit(struct btrfs_trans_handle *trans) in btrfs_set_log_full_commit() argument
73 WRITE_ONCE(trans->fs_info->last_trans_log_full_commit, trans->transid); in btrfs_set_log_full_commit()
76 static inline int btrfs_need_log_full_commit(struct btrfs_trans_handle *trans) in btrfs_need_log_full_commit() argument
78 return READ_ONCE(trans->fs_info->last_trans_log_full_commit) == in btrfs_need_log_full_commit()
79 trans->transid; in btrfs_need_log_full_commit()
82 int btrfs_sync_log(struct btrfs_trans_handle *trans,
84 int btrfs_free_log(struct btrfs_trans_handle *trans, struct btrfs_root *root);
85 int btrfs_free_log_root_tree(struct btrfs_trans_handle *trans,
88 int btrfs_log_dentry_safe(struct btrfs_trans_handle *trans,
91 void btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans,
[all …]
Droot-tree.c121 int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root in btrfs_update_root() argument
137 ret = btrfs_search_slot(trans, root, key, path, 0, 1); in btrfs_update_root()
147 btrfs_abort_transaction(trans, ret); in btrfs_update_root()
163 ret = btrfs_search_slot(trans, root, key, path, in btrfs_update_root()
166 btrfs_abort_transaction(trans, ret); in btrfs_update_root()
170 ret = btrfs_del_item(trans, root, path); in btrfs_update_root()
172 btrfs_abort_transaction(trans, ret); in btrfs_update_root()
176 ret = btrfs_insert_empty_item(trans, root, path, in btrfs_update_root()
179 btrfs_abort_transaction(trans, ret); in btrfs_update_root()
194 btrfs_mark_buffer_dirty(trans, path->nodes[0]); in btrfs_update_root()
[all …]
Dxattr.c83 int btrfs_setxattr(struct btrfs_trans_handle *trans, struct inode *inode, in btrfs_setxattr() argument
93 ASSERT(trans); in btrfs_setxattr()
104 di = btrfs_lookup_xattr(trans, root, path, in btrfs_setxattr()
111 ret = btrfs_delete_one_dir_name(trans, root, path, di); in btrfs_setxattr()
136 ret = btrfs_insert_xattr_item(trans, root, path, btrfs_ino(BTRFS_I(inode)), in btrfs_setxattr()
191 btrfs_extend_item(trans, path, size - old_data_len); in btrfs_setxattr()
193 btrfs_truncate_item(trans, path, data_size, 1); in btrfs_setxattr()
196 ret = btrfs_delete_one_dir_name(trans, root, path, di); in btrfs_setxattr()
199 btrfs_extend_item(trans, path, data_size); in btrfs_setxattr()
208 btrfs_mark_buffer_dirty(trans, leaf); in btrfs_setxattr()
[all …]
Dextent-tree.h94 int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, unsigned long count);
99 int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
102 int btrfs_pin_extent(struct btrfs_trans_handle *trans, u64 bytenr, u64 num,
104 int btrfs_pin_extent_for_log_replay(struct btrfs_trans_handle *trans,
110 struct extent_buffer *btrfs_alloc_tree_block(struct btrfs_trans_handle *trans,
117 void btrfs_free_tree_block(struct btrfs_trans_handle *trans,
121 int btrfs_alloc_reserved_file_extent(struct btrfs_trans_handle *trans,
125 int btrfs_alloc_logged_file_extent(struct btrfs_trans_handle *trans,
131 int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
133 int btrfs_dec_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
[all …]
Ddelayed-inode.c488 static int btrfs_delayed_item_reserve_metadata(struct btrfs_trans_handle *trans, in btrfs_delayed_item_reserve_metadata() argument
493 struct btrfs_fs_info *fs_info = trans->fs_info; in btrfs_delayed_item_reserve_metadata()
497 if (!trans->bytes_reserved) in btrfs_delayed_item_reserve_metadata()
500 src_rsv = trans->block_rsv; in btrfs_delayed_item_reserve_metadata()
563 struct btrfs_trans_handle *trans, in btrfs_delayed_inode_reserve_metadata() argument
573 src_rsv = trans->block_rsv; in btrfs_delayed_inode_reserve_metadata()
587 if (!src_rsv || (!trans->bytes_reserved && in btrfs_delayed_inode_reserve_metadata()
644 static int btrfs_insert_delayed_item(struct btrfs_trans_handle *trans, in btrfs_insert_delayed_item() argument
748 ret = btrfs_insert_empty_items(trans, root, path, &batch); in btrfs_insert_delayed_item()
810 static int btrfs_insert_delayed_items(struct btrfs_trans_handle *trans, in btrfs_insert_delayed_items() argument
[all …]
Drelocation.c252 static int update_backref_cache(struct btrfs_trans_handle *trans, in update_backref_cache() argument
259 cache->last_trans = trans->transid; in update_backref_cache()
263 if (cache->last_trans == trans->transid) in update_backref_cache()
469 struct btrfs_trans_handle *trans, in build_backref_tree() argument
503 ret = btrfs_backref_add_tree_node(trans, cache, path, iter, in build_backref_tree()
548 static int clone_backref_node(struct btrfs_trans_handle *trans, in clone_backref_node() argument
562 update_backref_cache(trans, cache); in clone_backref_node()
612 btrfs_backref_panic(trans->fs_info, new_node->bytenr, -EEXIST); in clone_backref_node()
742 static struct btrfs_root *create_reloc_root(struct btrfs_trans_handle *trans, in create_reloc_root() argument
765 ret = btrfs_copy_root(trans, root, root->commit_root, &eb, in create_reloc_root()
[all …]
Dblock-group.c1025 static int remove_block_group_item(struct btrfs_trans_handle *trans, in remove_block_group_item() argument
1029 struct btrfs_fs_info *fs_info = trans->fs_info; in remove_block_group_item()
1039 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in remove_block_group_item()
1045 ret = btrfs_del_item(trans, root, path); in remove_block_group_item()
1049 int btrfs_remove_block_group(struct btrfs_trans_handle *trans, in btrfs_remove_block_group() argument
1052 struct btrfs_fs_info *fs_info = trans->fs_info; in btrfs_remove_block_group()
1111 mutex_lock(&trans->transaction->cache_write_mutex); in btrfs_remove_block_group()
1116 spin_lock(&trans->transaction->dirty_bgs_lock); in btrfs_remove_block_group()
1122 spin_unlock(&trans->transaction->dirty_bgs_lock); in btrfs_remove_block_group()
1123 btrfs_wait_cache_io(trans, block_group, path); in btrfs_remove_block_group()
[all …]
Dinode-item.c83 btrfs_lookup_inode_extref(struct btrfs_trans_handle *trans, in btrfs_lookup_inode_extref() argument
97 ret = btrfs_search_slot(trans, root, &key, path, ins_len, cow); in btrfs_lookup_inode_extref()
107 static int btrfs_del_inode_extref(struct btrfs_trans_handle *trans, in btrfs_del_inode_extref() argument
131 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_del_inode_extref()
160 ret = btrfs_del_item(trans, root, path); in btrfs_del_inode_extref()
170 btrfs_truncate_item(trans, path, item_size - del_len, 1); in btrfs_del_inode_extref()
178 int btrfs_del_inode_ref(struct btrfs_trans_handle *trans, in btrfs_del_inode_ref() argument
202 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_del_inode_ref()
224 ret = btrfs_del_item(trans, root, path); in btrfs_del_inode_ref()
232 btrfs_truncate_item(trans, path, item_size - sub_item_len, 1); in btrfs_del_inode_ref()
[all …]
Dqgroup.h267 int btrfs_add_qgroup_relation(struct btrfs_trans_handle *trans, u64 src,
269 int btrfs_del_qgroup_relation(struct btrfs_trans_handle *trans, u64 src,
271 int btrfs_create_qgroup(struct btrfs_trans_handle *trans, u64 qgroupid);
272 int btrfs_remove_qgroup(struct btrfs_trans_handle *trans, u64 qgroupid);
273 int btrfs_limit_qgroup(struct btrfs_trans_handle *trans, u64 qgroupid,
316 int btrfs_qgroup_trace_extent_post(struct btrfs_trans_handle *trans,
332 int btrfs_qgroup_trace_extent(struct btrfs_trans_handle *trans, u64 bytenr,
341 int btrfs_qgroup_trace_leaf_items(struct btrfs_trans_handle *trans,
353 int btrfs_qgroup_trace_subtree(struct btrfs_trans_handle *trans,
356 int btrfs_qgroup_account_extent(struct btrfs_trans_handle *trans, u64 bytenr,
[all …]
Ddir-item.c22 *trans, in insert_with_overflow()
35 ret = btrfs_insert_empty_item(trans, root, path, cpu_key, data_size); in insert_with_overflow()
41 btrfs_extend_item(trans, path, data_size); in insert_with_overflow()
56 int btrfs_insert_xattr_item(struct btrfs_trans_handle *trans, in btrfs_insert_xattr_item() argument
78 dir_item = insert_with_overflow(trans, root, path, &key, data_size, in btrfs_insert_xattr_item()
89 btrfs_set_dir_transid(leaf, dir_item, trans->transid); in btrfs_insert_xattr_item()
96 btrfs_mark_buffer_dirty(trans, path->nodes[0]); in btrfs_insert_xattr_item()
109 int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, in btrfs_insert_dir_item() argument
135 dir_item = insert_with_overflow(trans, root, path, &key, data_size, in btrfs_insert_dir_item()
152 btrfs_set_dir_transid(leaf, dir_item, trans->transid); in btrfs_insert_dir_item()
[all …]
Dinode.c475 static int btrfs_init_inode_security(struct btrfs_trans_handle *trans, in btrfs_init_inode_security() argument
481 err = __btrfs_set_acl(trans, args->inode, args->default_acl, in btrfs_init_inode_security()
487 err = __btrfs_set_acl(trans, args->inode, args->acl, ACL_TYPE_ACCESS); in btrfs_init_inode_security()
493 return btrfs_xattr_security_init(trans, args->inode, args->dir, in btrfs_init_inode_security()
502 static int insert_inline_extent(struct btrfs_trans_handle *trans, in insert_inline_extent() argument
535 ret = btrfs_insert_empty_item(trans, root, path, &key, in insert_inline_extent()
543 btrfs_set_file_extent_generation(leaf, ei, trans->transid); in insert_inline_extent()
576 btrfs_mark_buffer_dirty(trans, leaf); in insert_inline_extent()
621 struct btrfs_trans_handle *trans; in cow_file_range_inline() local
642 trans = btrfs_join_transaction(root); in cow_file_range_inline()
[all …]
Dfile.c200 int btrfs_drop_extents(struct btrfs_trans_handle *trans, in btrfs_drop_extents() argument
250 ret = btrfs_lookup_file_extent(trans, root, path, ino, in btrfs_drop_extents()
349 ret = btrfs_duplicate_item(trans, root, path, in btrfs_drop_extents()
371 btrfs_mark_buffer_dirty(trans, leaf); in btrfs_drop_extents()
382 ret = btrfs_inc_extent_ref(trans, &ref); in btrfs_drop_extents()
384 btrfs_abort_transaction(trans, ret); in btrfs_drop_extents()
408 btrfs_set_item_key_safe(trans, path, &new_key); in btrfs_drop_extents()
414 btrfs_mark_buffer_dirty(trans, leaf); in btrfs_drop_extents()
434 btrfs_mark_buffer_dirty(trans, leaf); in btrfs_drop_extents()
472 ret = btrfs_free_extent(trans, &ref); in btrfs_drop_extents()
[all …]
Dfree-space-tree.h24 int add_block_group_free_space(struct btrfs_trans_handle *trans,
26 int remove_block_group_free_space(struct btrfs_trans_handle *trans,
28 int add_to_free_space_tree(struct btrfs_trans_handle *trans,
30 int remove_from_free_space_tree(struct btrfs_trans_handle *trans,
35 search_free_space_info(struct btrfs_trans_handle *trans,
38 int __add_to_free_space_tree(struct btrfs_trans_handle *trans,
41 int __remove_from_free_space_tree(struct btrfs_trans_handle *trans,
44 int convert_free_space_to_bitmaps(struct btrfs_trans_handle *trans,
47 int convert_free_space_to_extents(struct btrfs_trans_handle *trans,
Duuid-tree.c85 int btrfs_uuid_tree_add(struct btrfs_trans_handle *trans, u8 *uuid, u8 type, in btrfs_uuid_tree_add() argument
88 struct btrfs_fs_info *fs_info = trans->fs_info; in btrfs_uuid_tree_add()
115 ret = btrfs_insert_empty_item(trans, uuid_root, path, &key, in btrfs_uuid_tree_add()
127 btrfs_extend_item(trans, path, sizeof(subid_le)); in btrfs_uuid_tree_add()
142 btrfs_mark_buffer_dirty(trans, eb); in btrfs_uuid_tree_add()
149 int btrfs_uuid_tree_remove(struct btrfs_trans_handle *trans, u8 *uuid, u8 type, in btrfs_uuid_tree_remove() argument
152 struct btrfs_fs_info *fs_info = trans->fs_info; in btrfs_uuid_tree_remove()
178 ret = btrfs_search_slot(trans, uuid_root, &key, path, -1, 1); in btrfs_uuid_tree_remove()
216 ret = btrfs_del_item(trans, uuid_root, path); in btrfs_uuid_tree_remove()
224 btrfs_truncate_item(trans, path, item_size - sizeof(subid), 1); in btrfs_uuid_tree_remove()
[all …]
/fs/xfs/
Dxfs_attr_inactive.c83 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()
175 error = xfs_da3_node_read(*trans, dp, child_fsb, &child_bp, in xfs_attr3_node_inactive()
190 error = xfs_attr3_node_inactive(trans, dp, child_bp, in xfs_attr3_node_inactive()
195 error = xfs_attr3_leaf_inactive(trans, dp, child_bp); in xfs_attr3_node_inactive()
199 xfs_trans_brelse(*trans, child_bp); in xfs_attr3_node_inactive()
[all …]
/fs/btrfs/tests/
Dfree-space-tree-tests.c20 static int __check_free_space_extents(struct btrfs_trans_handle *trans, in __check_free_space_extents() argument
35 info = search_free_space_info(trans, cache, path, 0); in __check_free_space_extents()
107 static int check_free_space_extents(struct btrfs_trans_handle *trans, in check_free_space_extents() argument
118 info = search_free_space_info(trans, cache, path, 0); in check_free_space_extents()
127 ret = __check_free_space_extents(trans, fs_info, cache, path, extents, in check_free_space_extents()
134 ret = convert_free_space_to_extents(trans, cache, path); in check_free_space_extents()
140 ret = convert_free_space_to_bitmaps(trans, cache, path); in check_free_space_extents()
146 return __check_free_space_extents(trans, fs_info, cache, path, extents, in check_free_space_extents()
150 static int test_empty_block_group(struct btrfs_trans_handle *trans, in test_empty_block_group() argument
160 return check_free_space_extents(trans, fs_info, cache, path, in test_empty_block_group()
[all …]
Dqgroup-tests.c19 struct btrfs_trans_handle trans; in insert_normal_tree_ref() local
29 btrfs_init_dummy_trans(&trans, NULL); in insert_normal_tree_ref()
41 ret = btrfs_insert_empty_item(&trans, root, path, &ins, size); in insert_normal_tree_ref()
71 struct btrfs_trans_handle trans; in add_tree_ref() local
78 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()
139 ret = btrfs_search_slot(&trans, root, &key, path, -1, 1); in remove_extent_item()
[all …]

1234