Lines Matching refs:ctx

283 	struct xfs_cil_ctx	*ctx = cil->xc_ctx;  in xlog_cil_insert_items()  local
321 ctx->nvecs += diff_iovecs; in xlog_cil_insert_items()
325 list_splice_init(&tp->t_busy, &ctx->busy_extents); in xlog_cil_insert_items()
334 if (ctx->ticket->t_curr_res == 0) { in xlog_cil_insert_items()
335 ctx->ticket->t_curr_res = ctx->ticket->t_unit_res; in xlog_cil_insert_items()
336 tp->t_ticket->t_curr_res -= ctx->ticket->t_unit_res; in xlog_cil_insert_items()
341 if (len > 0 && (ctx->space_used / iclog_space != in xlog_cil_insert_items()
342 (ctx->space_used + len) / iclog_space)) { in xlog_cil_insert_items()
348 ctx->ticket->t_unit_res += hdrs; in xlog_cil_insert_items()
349 ctx->ticket->t_curr_res += hdrs; in xlog_cil_insert_items()
354 ctx->space_used += len; in xlog_cil_insert_items()
382 struct xfs_cil_ctx *ctx = args; in xlog_cil_committed() local
383 struct xfs_mount *mp = ctx->cil->xc_log->l_mp; in xlog_cil_committed()
385 xfs_trans_committed_bulk(ctx->cil->xc_log->l_ailp, ctx->lv_chain, in xlog_cil_committed()
386 ctx->start_lsn, abort); in xlog_cil_committed()
388 xfs_extent_busy_sort(&ctx->busy_extents); in xlog_cil_committed()
389 xfs_extent_busy_clear(mp, &ctx->busy_extents, in xlog_cil_committed()
398 spin_lock(&ctx->cil->xc_push_lock); in xlog_cil_committed()
400 wake_up_all(&ctx->cil->xc_commit_wait); in xlog_cil_committed()
401 list_del(&ctx->committing); in xlog_cil_committed()
402 spin_unlock(&ctx->cil->xc_push_lock); in xlog_cil_committed()
404 xlog_cil_free_logvec(ctx->lv_chain); in xlog_cil_committed()
406 if (!list_empty(&ctx->busy_extents)) { in xlog_cil_committed()
409 xfs_discard_extents(mp, &ctx->busy_extents); in xlog_cil_committed()
410 xfs_extent_busy_clear(mp, &ctx->busy_extents, false); in xlog_cil_committed()
413 kmem_free(ctx); in xlog_cil_committed()
436 struct xfs_cil_ctx *ctx; in xlog_cil_push() local
455 ctx = cil->xc_ctx; in xlog_cil_push()
459 ASSERT(push_seq <= ctx->sequence); in xlog_cil_push()
503 list_add(&ctx->committing, &cil->xc_committing); in xlog_cil_push()
520 if (!ctx->lv_chain) in xlog_cil_push()
521 ctx->lv_chain = item->li_lv; in xlog_cil_push()
537 new_ctx->sequence = ctx->sequence + 1; in xlog_cil_push()
580 tic = ctx->ticket; in xlog_cil_push()
592 lvhdr.lv_next = ctx->lv_chain; in xlog_cil_push()
594 error = xlog_write(log, &lvhdr, tic, &ctx->start_lsn, NULL, 0); in xlog_cil_push()
619 if (new_ctx->sequence >= ctx->sequence) in xlog_cil_push()
638 ctx->log_cb.cb_func = xlog_cil_committed; in xlog_cil_push()
639 ctx->log_cb.cb_arg = ctx; in xlog_cil_push()
640 error = xfs_log_notify(log->l_mp, commit_iclog, &ctx->log_cb); in xlog_cil_push()
650 ctx->commit_lsn = commit_lsn; in xlog_cil_push()
666 xlog_cil_committed(ctx, XFS_LI_ABORTED); in xlog_cil_push()
837 struct xfs_cil_ctx *ctx; in xlog_cil_force_lsn() local
857 list_for_each_entry(ctx, &cil->xc_committing, committing) { in xlog_cil_force_lsn()
865 if (ctx->sequence > sequence) in xlog_cil_force_lsn()
867 if (!ctx->commit_lsn) { in xlog_cil_force_lsn()
875 if (ctx->sequence != sequence) in xlog_cil_force_lsn()
878 commit_lsn = ctx->commit_lsn; in xlog_cil_force_lsn()
930 struct xfs_cil_ctx *ctx; in xfs_log_item_in_current_chkpt() local
935 ctx = lip->li_mountp->m_log->l_cilp->xc_ctx; in xfs_log_item_in_current_chkpt()
942 if (XFS_LSN_CMP(lip->li_seq, ctx->sequence) != 0) in xfs_log_item_in_current_chkpt()
955 struct xfs_cil_ctx *ctx; in xlog_cil_init() local
961 ctx = kmem_zalloc(sizeof(*ctx), KM_SLEEP|KM_MAYFAIL); in xlog_cil_init()
962 if (!ctx) { in xlog_cil_init()
975 INIT_LIST_HEAD(&ctx->committing); in xlog_cil_init()
976 INIT_LIST_HEAD(&ctx->busy_extents); in xlog_cil_init()
977 ctx->sequence = 1; in xlog_cil_init()
978 ctx->cil = cil; in xlog_cil_init()
979 cil->xc_ctx = ctx; in xlog_cil_init()
980 cil->xc_current_sequence = ctx->sequence; in xlog_cil_init()