Lines Matching refs:ctx
109 struct btrfs_log_ctx *ctx);
150 struct btrfs_log_ctx *ctx)
220 if (!ctx->logging_new_name) {
222 list_add_tail(&ctx->list, &root->log_ctxs[index]);
223 ctx->log_transid = root->log_transid;
2827 struct btrfs_log_ctx *ctx)
2830 list_del_init(&ctx->list);
2841 struct btrfs_log_ctx *ctx;
2844 list_for_each_entry_safe(ctx, safe, &root->log_ctxs[index], list) {
2845 list_del_init(&ctx->list);
2846 ctx->log_ret = error;
2863 struct btrfs_root *root, struct btrfs_log_ctx *ctx)
2880 log_transid = ctx->log_transid;
2883 return ctx->log_ret;
2890 return ctx->log_ret;
3634 struct btrfs_log_ctx *ctx,
3719 if (!ctx->log_new_dentries) {
3724 ctx->log_new_dentries = true;
3753 struct btrfs_log_ctx *ctx,
3860 ret = process_dir_items_leaf(trans, inode, path, dst_path, ctx,
3939 const struct btrfs_log_ctx *ctx)
3950 if (!ctx->logged_before) {
4010 struct btrfs_log_ctx *ctx)
4016 ret = update_last_dir_index_offset(inode, path, ctx);
4025 ctx, min_key, &max_key);
4518 struct btrfs_log_ctx *ctx)
4534 list_for_each_entry(ordered, &ctx->ordered_extents, log_list) {
4626 struct btrfs_log_ctx *ctx)
4658 ret = log_extent_csums(trans, inode, log, em, ctx);
4671 if (ctx->logged_before) {
4839 struct btrfs_log_ctx *ctx)
4899 ret = log_one_extent(trans, inode, em, path, ctx);
4919 list_for_each_entry_safe(ordered, tmp, &ctx->ordered_extents, log_list) {
5372 struct btrfs_log_ctx *ctx)
5388 if (ctx->logging_new_name)
5447 ctx->log_new_dentries = false;
5451 log_mode, ctx);
5455 if (ctx->log_new_dentries) {
5524 static void free_conflicting_inodes(struct btrfs_log_ctx *ctx)
5529 list_for_each_entry_safe(curr, next, &ctx->conflict_inodes, list) {
5576 struct btrfs_log_ctx *ctx)
5588 if (ctx->num_conflict_inodes >= MAX_CONFLICT_INODES)
5629 list_add_tail(&ino_elem->list, &ctx->conflict_inodes);
5630 ctx->num_conflict_inodes++;
5682 list_add_tail(&ino_elem->list, &ctx->conflict_inodes);
5683 ctx->num_conflict_inodes++;
5690 struct btrfs_log_ctx *ctx)
5700 if (ctx->logging_conflict_inodes)
5703 ctx->logging_conflict_inodes = true;
5710 while (!list_empty(&ctx->conflict_inodes)) {
5716 curr = list_first_entry(&ctx->conflict_inodes,
5749 LOG_INODE_ALL, ctx);
5778 ret = btrfs_log_inode(trans, BTRFS_I(inode), LOG_INODE_EXISTS, ctx);
5784 ctx->logging_conflict_inodes = false;
5786 free_conflicting_inodes(ctx);
5799 struct btrfs_log_ctx *ctx,
5837 ctx->logging_conflict_inodes)) {
5847 other_ino != btrfs_ino(BTRFS_I(ctx->inode))) {
5864 other_parent, ctx);
5981 struct btrfs_log_ctx *ctx)
6076 struct btrfs_log_ctx *ctx)
6119 struct btrfs_log_ctx *ctx,
6155 struct btrfs_log_ctx *ctx)
6180 ret = batch_delete_dir_index_items(trans, inode, path, ctx,
6227 struct btrfs_log_ctx *ctx)
6238 if (ctx->logged_before)
6240 delayed_del_list, ctx);
6243 ctx);
6253 struct btrfs_log_ctx *ctx)
6255 const bool orig_log_new_dentries = ctx->log_new_dentries;
6267 ASSERT(!ctx->logging_new_delayed_dentries);
6268 ctx->logging_new_delayed_dentries = true;
6296 ctx->log_new_dentries = false;
6297 ret = btrfs_log_inode(trans, BTRFS_I(di_inode), log_mode, ctx);
6299 if (!ret && ctx->log_new_dentries)
6300 ret = log_new_dir_dentries(trans, BTRFS_I(di_inode), ctx);
6308 ctx->log_new_dentries = orig_log_new_dentries;
6309 ctx->logging_new_delayed_dentries = false;
6331 struct btrfs_log_ctx *ctx)
6409 if (full_dir_logging && ctx->logging_new_delayed_dentries) {
6437 ctx->logged_before = (ret == 1);
6458 if (ctx->logged_before)
6462 if (inode_only == LOG_INODE_EXISTS && ctx->logged_before) {
6484 if (ctx->logged_before)
6492 if (ctx->logged_before)
6502 if (ctx->logged_before)
6522 if (full_dir_logging && !ctx->logging_new_delayed_dentries)
6528 inode_only, ctx,
6569 ret = btrfs_log_changed_extents(trans, inode, dst_path, ctx);
6582 ret = log_directory_changes(trans, inode, path, dst_path, ctx);
6586 &delayed_ins_list, ctx);
6590 &delayed_del_list, ctx);
6646 free_conflicting_inodes(ctx);
6648 ret = log_conflicting_inodes(trans, inode->root, ctx);
6650 if (full_dir_logging && !ctx->logging_new_delayed_dentries) {
6653 &delayed_ins_list, ctx);
6664 struct btrfs_log_ctx *ctx)
6766 ctx->log_new_dentries = false;
6768 LOG_INODE_ALL, ctx);
6769 if (!ret && ctx->log_new_dentries)
6771 BTRFS_I(dir_inode), ctx);
6787 struct btrfs_log_ctx *ctx)
6816 LOG_INODE_EXISTS, ctx);
6852 struct btrfs_log_ctx *ctx)
6871 LOG_INODE_EXISTS, ctx);
6890 struct btrfs_log_ctx *ctx)
6903 return log_new_ancestors_fast(trans, inode, parent, ctx);
6958 ret = log_new_ancestors(trans, root, path, ctx);
6980 struct btrfs_log_ctx *ctx)
7003 list_empty(&ctx->ordered_extents)) ||
7009 ret = start_log_trans(trans, root, ctx);
7013 ret = btrfs_log_inode(trans, inode, inode_only, ctx);
7030 if (S_ISDIR(inode->vfs_inode.i_mode) && ctx->log_new_dentries)
7075 ret = btrfs_log_all_parents(trans, inode, ctx);
7080 ret = log_all_new_ancestors(trans, inode, parent, ctx);
7085 ret = log_new_dir_dentries(trans, inode, ctx);
7095 btrfs_remove_log_ctx(root, ctx);
7109 struct btrfs_log_ctx *ctx)
7115 LOG_INODE_ALL, ctx);
7402 struct btrfs_log_ctx ctx;
7511 btrfs_init_log_ctx(&ctx, &inode->vfs_inode);
7512 ctx.logging_new_name = true;
7520 btrfs_log_inode_parent(trans, inode, parent, LOG_INODE_EXISTS, &ctx);
7521 ASSERT(list_empty(&ctx.conflict_inodes));