/fs/btrfs/ |
D | transaction.c | 53 static inline int can_join_transaction(struct btrfs_transaction *trans, in can_join_transaction() argument 56 return !(trans->in_commit && in can_join_transaction() 193 static int record_root_in_trans(struct btrfs_trans_handle *trans, in record_root_in_trans() argument 196 if (root->ref_cows && root->last_trans < trans->transid) { in record_root_in_trans() 213 if (root->last_trans == trans->transid) { in record_root_in_trans() 221 root->last_trans = trans->transid; in record_root_in_trans() 242 btrfs_init_reloc_root(trans, root); in record_root_in_trans() 250 int btrfs_record_root_in_trans(struct btrfs_trans_handle *trans, in btrfs_record_root_in_trans() argument 261 if (root->last_trans == trans->transid && in btrfs_record_root_in_trans() 266 record_root_in_trans(trans, root); in btrfs_record_root_in_trans() [all …]
|
D | tree-log.c | 97 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 161 ret = btrfs_init_log_root_tree(trans, root->fs_info); in start_log_trans() 166 ret = btrfs_add_log_tree(trans, root); in start_log_trans() 262 struct btrfs_trans_handle *trans; member 309 static noinline int overwrite_item(struct btrfs_trans_handle *trans, in overwrite_item() argument 404 ret = btrfs_insert_empty_item(trans, root, path, in overwrite_item() 466 trans->transid); in overwrite_item() [all …]
|
D | inode.c | 109 static int btrfs_init_inode_security(struct btrfs_trans_handle *trans, in btrfs_init_inode_security() argument 115 err = btrfs_init_acl(trans, inode, dir); in btrfs_init_inode_security() 117 err = btrfs_xattr_security_init(trans, inode, dir, qstr); in btrfs_init_inode_security() 126 static noinline int insert_inline_extent(struct btrfs_trans_handle *trans, in insert_inline_extent() argument 160 ret = btrfs_insert_empty_item(trans, root, path, &key, in insert_inline_extent() 169 btrfs_set_file_extent_generation(leaf, ei, trans->transid); in insert_inline_extent() 217 ret = btrfs_update_inode(trans, root, inode); in insert_inline_extent() 231 static noinline int cow_file_range_inline(struct btrfs_trans_handle *trans, in cow_file_range_inline() argument 257 ret = btrfs_drop_extents(trans, root, inode, start, aligned_end, 1); in cow_file_range_inline() 263 ret = insert_inline_extent(trans, root, inode, start, in cow_file_range_inline() [all …]
|
D | delayed-ref.c | 220 int btrfs_delayed_ref_lock(struct btrfs_trans_handle *trans, in btrfs_delayed_ref_lock() argument 225 delayed_refs = &trans->transaction->delayed_refs; in btrfs_delayed_ref_lock() 244 static void inline drop_delayed_ref(struct btrfs_trans_handle *trans, in drop_delayed_ref() argument 252 if (trans->delayed_ref_updates) in drop_delayed_ref() 253 trans->delayed_ref_updates--; in drop_delayed_ref() 256 static int merge_ref(struct btrfs_trans_handle *trans, in merge_ref() argument 293 drop_delayed_ref(trans, delayed_refs, next); in merge_ref() 296 drop_delayed_ref(trans, delayed_refs, ref); in merge_ref() 315 void btrfs_merge_delayed_refs(struct btrfs_trans_handle *trans, in btrfs_merge_delayed_refs() argument 345 if (merge_ref(trans, delayed_refs, ref, seq)) in btrfs_merge_delayed_refs() [all …]
|
D | ioctl.c | 183 struct btrfs_trans_handle *trans; in btrfs_ioctl_setflags() local 287 trans = btrfs_start_transaction(root, 1); in btrfs_ioctl_setflags() 288 if (IS_ERR(trans)) { in btrfs_ioctl_setflags() 289 ret = PTR_ERR(trans); in btrfs_ioctl_setflags() 296 ret = btrfs_update_inode(trans, root, inode); in btrfs_ioctl_setflags() 298 btrfs_end_transaction(trans, root); in btrfs_ioctl_setflags() 372 struct btrfs_trans_handle *trans; in create_subvol() local 403 trans = btrfs_start_transaction(root, 0); in create_subvol() 404 if (IS_ERR(trans)) { in create_subvol() 405 ret = PTR_ERR(trans); in create_subvol() [all …]
|
D | extent-tree.c | 78 static int __btrfs_free_extent(struct btrfs_trans_handle *trans, 87 static int alloc_reserved_file_extent(struct btrfs_trans_handle *trans, 92 static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans, 97 static int do_chunk_alloc(struct btrfs_trans_handle *trans, 724 int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans, in btrfs_lookup_extent_info() argument 762 if (!trans) { in btrfs_lookup_extent_info() 767 ret = btrfs_search_slot(trans, root->fs_info->extent_root, in btrfs_lookup_extent_info() 807 if (!trans) in btrfs_lookup_extent_info() 810 delayed_refs = &trans->transaction->delayed_refs; in btrfs_lookup_extent_info() 812 head = btrfs_find_delayed_ref_head(trans, bytenr); in btrfs_lookup_extent_info() [all …]
|
D | qgroup.c | 465 static int add_qgroup_relation_item(struct btrfs_trans_handle *trans, in add_qgroup_relation_item() argument 481 ret = btrfs_insert_empty_item(trans, quota_root, path, &key, 0); in add_qgroup_relation_item() 489 static int del_qgroup_relation_item(struct btrfs_trans_handle *trans, in del_qgroup_relation_item() argument 505 ret = btrfs_search_slot(trans, quota_root, &key, path, -1, 1); in del_qgroup_relation_item() 514 ret = btrfs_del_item(trans, quota_root, path); in del_qgroup_relation_item() 520 static int add_qgroup_item(struct btrfs_trans_handle *trans, in add_qgroup_item() argument 538 ret = btrfs_insert_empty_item(trans, quota_root, path, &key, in add_qgroup_item() 546 btrfs_set_qgroup_info_generation(leaf, qgroup_info, trans->transid); in add_qgroup_item() 557 ret = btrfs_insert_empty_item(trans, quota_root, path, &key, in add_qgroup_item() 579 static int del_qgroup_item(struct btrfs_trans_handle *trans, in del_qgroup_item() argument [all …]
|
D | delayed-inode.c | 552 static int btrfs_delayed_item_reserve_metadata(struct btrfs_trans_handle *trans, in btrfs_delayed_item_reserve_metadata() argument 561 if (!trans->bytes_reserved) in btrfs_delayed_item_reserve_metadata() 564 src_rsv = trans->block_rsv; in btrfs_delayed_item_reserve_metadata() 596 struct btrfs_trans_handle *trans, in btrfs_delayed_inode_reserve_metadata() argument 607 src_rsv = trans->block_rsv; in btrfs_delayed_inode_reserve_metadata() 621 if (!src_rsv || (!trans->bytes_reserved && in btrfs_delayed_inode_reserve_metadata() 840 static int btrfs_insert_delayed_item(struct btrfs_trans_handle *trans, in btrfs_insert_delayed_item() argument 849 ret = btrfs_insert_empty_item(trans, root, path, &delayed_item->key, in btrfs_insert_delayed_item() 870 static int btrfs_insert_delayed_items(struct btrfs_trans_handle *trans, in btrfs_insert_delayed_items() argument 884 ret = btrfs_insert_delayed_item(trans, root, path, curr); in btrfs_insert_delayed_items() [all …]
|
D | tree-log.h | 25 int btrfs_sync_log(struct btrfs_trans_handle *trans, 27 int btrfs_free_log(struct btrfs_trans_handle *trans, struct btrfs_root *root); 28 int btrfs_free_log_root_tree(struct btrfs_trans_handle *trans, 31 int btrfs_log_dentry_safe(struct btrfs_trans_handle *trans, 33 int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans, 37 int btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans, 43 void btrfs_record_unlink_dir(struct btrfs_trans_handle *trans, 46 int btrfs_log_new_name(struct btrfs_trans_handle *trans,
|
D | xattr.c | 88 static int do_setxattr(struct btrfs_trans_handle *trans, in do_setxattr() argument 106 di = btrfs_lookup_xattr(trans, root, path, btrfs_ino(inode), name, in do_setxattr() 115 ret = btrfs_delete_one_dir_name(trans, root, path, di); in do_setxattr() 138 ret = btrfs_insert_xattr_item(trans, root, path, btrfs_ino(inode), in do_setxattr() 160 di = btrfs_lookup_xattr(trans, root, path, btrfs_ino(inode), in do_setxattr() 171 ret = btrfs_delete_one_dir_name(trans, root, path, di); in do_setxattr() 191 int __btrfs_setxattr(struct btrfs_trans_handle *trans, in __btrfs_setxattr() argument 198 if (trans) in __btrfs_setxattr() 199 return do_setxattr(trans, inode, name, value, size, flags); in __btrfs_setxattr() 201 trans = btrfs_start_transaction(root, 2); in __btrfs_setxattr() [all …]
|
D | inode-map.c | 396 struct btrfs_trans_handle *trans) in btrfs_save_ino_cache() argument 426 rsv = trans->block_rsv; in btrfs_save_ino_cache() 427 trans->block_rsv = &root->fs_info->trans_block_rsv; in btrfs_save_ino_cache() 429 num_bytes = trans->bytes_reserved; in btrfs_save_ino_cache() 437 trans->bytes_reserved = btrfs_calc_trans_metadata_size(root, 10); in btrfs_save_ino_cache() 438 ret = btrfs_block_rsv_add(root, trans->block_rsv, in btrfs_save_ino_cache() 439 trans->bytes_reserved, in btrfs_save_ino_cache() 444 trans->transid, trans->bytes_reserved, 1); in btrfs_save_ino_cache() 456 ret = create_free_ino_inode(root, trans, path); in btrfs_save_ino_cache() 463 ret = btrfs_update_inode(trans, root, inode); in btrfs_save_ino_cache() [all …]
|
D | inode-item.c | 95 btrfs_lookup_inode_ref(struct btrfs_trans_handle *trans, in btrfs_lookup_inode_ref() argument 110 ret = btrfs_search_slot(trans, root, &key, path, ins_len, cow); in btrfs_lookup_inode_ref() 122 btrfs_lookup_inode_extref(struct btrfs_trans_handle *trans, in btrfs_lookup_inode_extref() argument 137 ret = btrfs_search_slot(trans, root, &key, path, ins_len, cow); in btrfs_lookup_inode_extref() 147 int btrfs_get_inode_ref_index(struct btrfs_trans_handle *trans, in btrfs_get_inode_ref_index() argument 159 ref = btrfs_lookup_inode_ref(trans, root, path, name, name_len, in btrfs_get_inode_ref_index() 172 extref = btrfs_lookup_inode_extref(trans, root, path, name, in btrfs_get_inode_ref_index() 186 static int btrfs_del_inode_extref(struct btrfs_trans_handle *trans, in btrfs_del_inode_extref() argument 212 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_del_inode_extref() 240 ret = btrfs_del_item(trans, root, path); in btrfs_del_inode_extref() [all …]
|
D | ctree.c | 28 static int split_node(struct btrfs_trans_handle *trans, struct btrfs_root 30 static int split_leaf(struct btrfs_trans_handle *trans, struct btrfs_root 33 static int push_node_left(struct btrfs_trans_handle *trans, 36 static int balance_node_right(struct btrfs_trans_handle *trans, 240 int btrfs_copy_root(struct btrfs_trans_handle *trans, in btrfs_copy_root() argument 250 WARN_ON(root->ref_cows && trans->transid != in btrfs_copy_root() 252 WARN_ON(root->ref_cows && trans->transid != root->last_trans); in btrfs_copy_root() 260 cow = btrfs_alloc_free_block(trans, root, buf->len, 0, in btrfs_copy_root() 268 btrfs_set_header_generation(cow, trans->transid); in btrfs_copy_root() 281 WARN_ON(btrfs_header_generation(buf) > trans->transid); in btrfs_copy_root() [all …]
|
D | transaction.h | 100 static inline void btrfs_set_inode_last_trans(struct btrfs_trans_handle *trans, in btrfs_set_inode_last_trans() argument 103 BTRFS_I(inode)->last_trans = trans->transaction->transid; in btrfs_set_inode_last_trans() 108 int btrfs_end_transaction(struct btrfs_trans_handle *trans, 121 int btrfs_write_and_wait_transaction(struct btrfs_trans_handle *trans, 127 int btrfs_commit_transaction(struct btrfs_trans_handle *trans, 129 int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans, 132 int btrfs_end_transaction_throttle(struct btrfs_trans_handle *trans, 134 int btrfs_end_transaction_dmeta(struct btrfs_trans_handle *trans, 136 int btrfs_should_end_transaction(struct btrfs_trans_handle *trans, 139 int btrfs_record_root_in_trans(struct btrfs_trans_handle *trans,
|
D | root-tree.c | 127 int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root in btrfs_update_root() argument 142 ret = btrfs_search_slot(trans, root, key, path, 0, 1); in btrfs_update_root() 144 btrfs_abort_transaction(trans, root, ret); in btrfs_update_root() 168 ret = btrfs_search_slot(trans, root, key, path, in btrfs_update_root() 171 btrfs_abort_transaction(trans, root, ret); in btrfs_update_root() 175 ret = btrfs_del_item(trans, root, path); in btrfs_update_root() 177 btrfs_abort_transaction(trans, root, ret); in btrfs_update_root() 181 ret = btrfs_insert_empty_item(trans, root, path, in btrfs_update_root() 184 btrfs_abort_transaction(trans, root, ret); in btrfs_update_root() 205 int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root *root, in btrfs_insert_root() argument [all …]
|
D | relocation.c | 474 static int update_backref_cache(struct btrfs_trans_handle *trans, in update_backref_cache() argument 481 cache->last_trans = trans->transid; in update_backref_cache() 485 if (cache->last_trans == trans->transid) in update_backref_cache() 1143 static int clone_backref_node(struct btrfs_trans_handle *trans, argument 1157 update_backref_cache(trans, cache); 1301 static struct btrfs_root *create_reloc_root(struct btrfs_trans_handle *trans, argument 1319 ret = btrfs_copy_root(trans, root, root->commit_root, &eb, 1324 trans->transid - 1); 1333 ret = btrfs_copy_root(trans, root, root->node, &eb, 1341 btrfs_set_root_generation(root_item, trans->transid); [all …]
|
D | ctree.h | 3032 int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, 3035 int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans, 3042 int btrfs_cross_ref_exist(struct btrfs_trans_handle *trans, 3049 struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, 3054 void btrfs_free_tree_block(struct btrfs_trans_handle *trans, 3058 int btrfs_alloc_reserved_file_extent(struct btrfs_trans_handle *trans, 3062 int btrfs_alloc_logged_file_extent(struct btrfs_trans_handle *trans, 3066 int btrfs_reserve_extent(struct btrfs_trans_handle *trans, 3071 int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, 3073 int btrfs_dec_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, [all …]
|
D | file.c | 147 int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, in btrfs_add_inode_defrag() argument 161 if (trans) in btrfs_add_inode_defrag() 162 transid = trans->transid; in btrfs_add_inode_defrag() 679 int __btrfs_drop_extents(struct btrfs_trans_handle *trans, in __btrfs_drop_extents() argument 711 ret = btrfs_lookup_file_extent(trans, root, path, ino, in __btrfs_drop_extents() 785 ret = btrfs_duplicate_item(trans, root, path, in __btrfs_drop_extents() 810 ret = btrfs_inc_extent_ref(trans, root, in __btrfs_drop_extents() 881 ret = btrfs_free_extent(trans, root, in __btrfs_drop_extents() 899 ret = btrfs_del_items(trans, root, path, del_slot, in __btrfs_drop_extents() 902 btrfs_abort_transaction(trans, root, ret); in __btrfs_drop_extents() [all …]
|
D | dir-item.c | 37 *trans, in insert_with_overflow() 50 ret = btrfs_insert_empty_item(trans, root, path, cpu_key, data_size); in insert_with_overflow() 72 int btrfs_insert_xattr_item(struct btrfs_trans_handle *trans, in btrfs_insert_xattr_item() argument 93 dir_item = insert_with_overflow(trans, root, path, &key, data_size, in btrfs_insert_xattr_item() 104 btrfs_set_dir_transid(leaf, dir_item, trans->transid); in btrfs_insert_xattr_item() 124 int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root in btrfs_insert_dir_item() argument 151 dir_item = insert_with_overflow(trans, root, path, &key, data_size, in btrfs_insert_dir_item() 165 btrfs_set_dir_transid(leaf, dir_item, trans->transid); in btrfs_insert_dir_item() 179 ret2 = btrfs_insert_delayed_dir_index(trans, root, name, name_len, dir, in btrfs_insert_dir_item() 195 struct btrfs_dir_item *btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, in btrfs_lookup_dir_item() argument [all …]
|
D | dev-replace.c | 185 int btrfs_run_dev_replace(struct btrfs_trans_handle *trans, in btrfs_run_dev_replace() argument 213 ret = btrfs_search_slot(trans, dev_root, &key, path, -1, 1); in btrfs_run_dev_replace() 233 ret = btrfs_del_item(trans, dev_root, path); in btrfs_run_dev_replace() 245 ret = btrfs_insert_empty_item(trans, dev_root, path, in btrfs_run_dev_replace() 309 struct btrfs_trans_handle *trans; in btrfs_dev_replace_start() local 406 trans = btrfs_start_transaction(root, 0); in btrfs_dev_replace_start() 407 if (IS_ERR(trans)) { in btrfs_dev_replace_start() 408 ret = PTR_ERR(trans); in btrfs_dev_replace_start() 413 ret = btrfs_commit_transaction(trans, root); in btrfs_dev_replace_start() 444 struct btrfs_trans_handle *trans; in btrfs_dev_replace_finishing() local [all …]
|
D | delayed-ref.h | 199 struct btrfs_trans_handle *trans, 205 struct btrfs_trans_handle *trans, 212 struct btrfs_trans_handle *trans, 215 void btrfs_merge_delayed_refs(struct btrfs_trans_handle *trans, 221 btrfs_find_delayed_ref_head(struct btrfs_trans_handle *trans, u64 bytenr); 222 int btrfs_delayed_ref_lock(struct btrfs_trans_handle *trans, 229 int btrfs_find_ref_cluster(struct btrfs_trans_handle *trans,
|
D | delayed-inode.h | 98 int btrfs_insert_delayed_dir_index(struct btrfs_trans_handle *trans, 104 int btrfs_delete_delayed_dir_index(struct btrfs_trans_handle *trans, 110 int btrfs_run_delayed_items(struct btrfs_trans_handle *trans, 112 int btrfs_run_delayed_items_nr(struct btrfs_trans_handle *trans, 117 int btrfs_commit_inode_delayed_items(struct btrfs_trans_handle *trans, 125 int btrfs_delayed_update_inode(struct btrfs_trans_handle *trans,
|
D | orphan.c | 22 int btrfs_insert_orphan_item(struct btrfs_trans_handle *trans, in btrfs_insert_orphan_item() argument 37 ret = btrfs_insert_empty_item(trans, root, path, &key, 0); in btrfs_insert_orphan_item() 43 int btrfs_del_orphan_item(struct btrfs_trans_handle *trans, in btrfs_del_orphan_item() argument 58 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_del_orphan_item() 66 ret = btrfs_del_item(trans, root, path); in btrfs_del_orphan_item()
|
/fs/xfs/ |
D | xfs_attr.c | 286 args.trans = xfs_trans_alloc(mp, XFS_TRANS_ATTR_SET); in xfs_attr_set_int() 294 args.trans->t_flags |= XFS_TRANS_RESERVE; in xfs_attr_set_int() 296 error = xfs_trans_reserve(args.trans, args.total, in xfs_attr_set_int() 302 xfs_trans_cancel(args.trans, 0); in xfs_attr_set_int() 307 error = xfs_trans_reserve_quota_nblks(args.trans, dp, args.total, 0, in xfs_attr_set_int() 312 xfs_trans_cancel(args.trans, XFS_TRANS_RELEASE_LOG_RES); in xfs_attr_set_int() 316 xfs_trans_ijoin(args.trans, dp, 0); in xfs_attr_set_int() 342 ASSERT(args.trans != NULL); in xfs_attr_set_int() 350 xfs_trans_set_sync(args.trans); in xfs_attr_set_int() 354 xfs_trans_ichgtime(args.trans, dp, in xfs_attr_set_int() [all …]
|
D | xfs_attr_leaf.c | 83 STATIC int xfs_attr3_node_inactive(xfs_trans_t **trans, xfs_inode_t *dp, 85 STATIC int xfs_attr3_leaf_inactive(xfs_trans_t **trans, xfs_inode_t *dp, 87 STATIC int xfs_attr3_leaf_freextent(xfs_trans_t **trans, xfs_inode_t *dp, 450 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_ADATA); in xfs_attr_shortform_create() 502 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_ADATA); in xfs_attr_shortform_add() 504 xfs_sbversion_add_attr2(mp, args->trans); in xfs_attr_shortform_add() 578 xfs_attr_fork_reset(dp, args->trans); in xfs_attr_shortform_remove() 587 xfs_trans_log_inode(args->trans, dp, in xfs_attr_shortform_remove() 591 xfs_sbversion_add_attr2(mp, args->trans); in xfs_attr_shortform_remove() 725 nargs.trans = args->trans; in xfs_attr_shortform_to_leaf() [all …]
|