Lines Matching refs:ctx
392 struct xfs_cil_ctx *ctx = cil->xc_ctx; in xlog_cil_insert_items() local
412 ctx->nvecs += diff_iovecs; in xlog_cil_insert_items()
416 list_splice_init(&tp->t_busy, &ctx->busy_extents); in xlog_cil_insert_items()
425 if (ctx->ticket->t_curr_res == 0) { in xlog_cil_insert_items()
426 ctx_res = ctx->ticket->t_unit_res; in xlog_cil_insert_items()
427 ctx->ticket->t_curr_res = ctx_res; in xlog_cil_insert_items()
433 if (len > 0 && (ctx->space_used / iclog_space != in xlog_cil_insert_items()
434 (ctx->space_used + len) / iclog_space)) { in xlog_cil_insert_items()
438 ctx->ticket->t_unit_res += split_res; in xlog_cil_insert_items()
439 ctx->ticket->t_curr_res += split_res; in xlog_cil_insert_items()
444 ctx->space_used += len; in xlog_cil_insert_items()
504 struct xfs_cil_ctx *ctx = in xlog_discard_endio_work() local
506 struct xfs_mount *mp = ctx->cil->xc_log->l_mp; in xlog_discard_endio_work()
508 xfs_extent_busy_clear(mp, &ctx->busy_extents, false); in xlog_discard_endio_work()
509 kmem_free(ctx); in xlog_discard_endio_work()
521 struct xfs_cil_ctx *ctx = bio->bi_private; in xlog_discard_endio() local
523 INIT_WORK(&ctx->discard_endio_work, xlog_discard_endio_work); in xlog_discard_endio()
524 queue_work(xfs_discard_wq, &ctx->discard_endio_work); in xlog_discard_endio()
531 struct xfs_cil_ctx *ctx) in xlog_discard_busy_extents() argument
533 struct list_head *list = &ctx->busy_extents; in xlog_discard_busy_extents()
561 bio->bi_private = ctx; in xlog_discard_busy_extents()
565 xlog_discard_endio_work(&ctx->discard_endio_work); in xlog_discard_busy_extents()
577 struct xfs_cil_ctx *ctx, in xlog_cil_committed() argument
580 struct xfs_mount *mp = ctx->cil->xc_log->l_mp; in xlog_cil_committed()
590 spin_lock(&ctx->cil->xc_push_lock); in xlog_cil_committed()
591 wake_up_all(&ctx->cil->xc_commit_wait); in xlog_cil_committed()
592 spin_unlock(&ctx->cil->xc_push_lock); in xlog_cil_committed()
595 xfs_trans_committed_bulk(ctx->cil->xc_log->l_ailp, ctx->lv_chain, in xlog_cil_committed()
596 ctx->start_lsn, abort); in xlog_cil_committed()
598 xfs_extent_busy_sort(&ctx->busy_extents); in xlog_cil_committed()
599 xfs_extent_busy_clear(mp, &ctx->busy_extents, in xlog_cil_committed()
602 spin_lock(&ctx->cil->xc_push_lock); in xlog_cil_committed()
603 list_del(&ctx->committing); in xlog_cil_committed()
604 spin_unlock(&ctx->cil->xc_push_lock); in xlog_cil_committed()
606 xlog_cil_free_logvec(ctx->lv_chain); in xlog_cil_committed()
608 if (!list_empty(&ctx->busy_extents)) in xlog_cil_committed()
609 xlog_discard_busy_extents(mp, ctx); in xlog_cil_committed()
611 kmem_free(ctx); in xlog_cil_committed()
619 struct xfs_cil_ctx *ctx; in xlog_cil_process_committed() local
621 while ((ctx = list_first_entry_or_null(list, in xlog_cil_process_committed()
623 list_del(&ctx->iclog_entry); in xlog_cil_process_committed()
624 xlog_cil_committed(ctx, aborted); in xlog_cil_process_committed()
648 struct xfs_cil_ctx *ctx; in xlog_cil_push() local
667 ctx = cil->xc_ctx; in xlog_cil_push()
671 ASSERT(push_seq <= ctx->sequence); in xlog_cil_push()
676 if (ctx->space_used >= XLOG_CIL_BLOCKING_SPACE_LIMIT(log)) in xlog_cil_push()
721 list_add(&ctx->committing, &cil->xc_committing); in xlog_cil_push()
738 if (!ctx->lv_chain) in xlog_cil_push()
739 ctx->lv_chain = item->li_lv; in xlog_cil_push()
755 new_ctx->sequence = ctx->sequence + 1; in xlog_cil_push()
798 tic = ctx->ticket; in xlog_cil_push()
810 lvhdr.lv_next = ctx->lv_chain; in xlog_cil_push()
812 error = xlog_write(log, &lvhdr, tic, &ctx->start_lsn, NULL, 0); in xlog_cil_push()
837 if (new_ctx->sequence >= ctx->sequence) in xlog_cil_push()
862 list_add_tail(&ctx->iclog_entry, &commit_iclog->ic_callbacks); in xlog_cil_push()
871 ctx->commit_lsn = commit_lsn; in xlog_cil_push()
887 xlog_cil_committed(ctx, true); in xlog_cil_push()
1090 struct xfs_cil_ctx *ctx; in xlog_cil_force_lsn() local
1110 list_for_each_entry(ctx, &cil->xc_committing, committing) { in xlog_cil_force_lsn()
1118 if (ctx->sequence > sequence) in xlog_cil_force_lsn()
1120 if (!ctx->commit_lsn) { in xlog_cil_force_lsn()
1128 if (ctx->sequence != sequence) in xlog_cil_force_lsn()
1131 commit_lsn = ctx->commit_lsn; in xlog_cil_force_lsn()
1206 struct xfs_cil_ctx *ctx; in xlog_cil_init() local
1212 ctx = kmem_zalloc(sizeof(*ctx), KM_MAYFAIL); in xlog_cil_init()
1213 if (!ctx) { in xlog_cil_init()
1227 INIT_LIST_HEAD(&ctx->committing); in xlog_cil_init()
1228 INIT_LIST_HEAD(&ctx->busy_extents); in xlog_cil_init()
1229 ctx->sequence = 1; in xlog_cil_init()
1230 ctx->cil = cil; in xlog_cil_init()
1231 cil->xc_ctx = ctx; in xlog_cil_init()
1232 cil->xc_current_sequence = ctx->sequence; in xlog_cil_init()