Lines Matching refs:ctx
283 struct xfs_cil_ctx *ctx = cil->xc_ctx; in xlog_cil_insert_items() local
315 ctx->nvecs += diff_iovecs; in xlog_cil_insert_items()
319 list_splice_init(&tp->t_busy, &ctx->busy_extents); in xlog_cil_insert_items()
328 if (ctx->ticket->t_curr_res == 0) { in xlog_cil_insert_items()
329 ctx->ticket->t_curr_res = ctx->ticket->t_unit_res; in xlog_cil_insert_items()
330 tp->t_ticket->t_curr_res -= ctx->ticket->t_unit_res; in xlog_cil_insert_items()
335 if (len > 0 && (ctx->space_used / iclog_space != in xlog_cil_insert_items()
336 (ctx->space_used + len) / iclog_space)) { in xlog_cil_insert_items()
342 ctx->ticket->t_unit_res += hdrs; in xlog_cil_insert_items()
343 ctx->ticket->t_curr_res += hdrs; in xlog_cil_insert_items()
348 ctx->space_used += len; in xlog_cil_insert_items()
376 struct xfs_cil_ctx *ctx = args; in xlog_cil_committed() local
377 struct xfs_mount *mp = ctx->cil->xc_log->l_mp; in xlog_cil_committed()
379 xfs_trans_committed_bulk(ctx->cil->xc_log->l_ailp, ctx->lv_chain, in xlog_cil_committed()
380 ctx->start_lsn, abort); in xlog_cil_committed()
382 xfs_extent_busy_sort(&ctx->busy_extents); in xlog_cil_committed()
383 xfs_extent_busy_clear(mp, &ctx->busy_extents, in xlog_cil_committed()
392 spin_lock(&ctx->cil->xc_push_lock); in xlog_cil_committed()
394 wake_up_all(&ctx->cil->xc_commit_wait); in xlog_cil_committed()
395 list_del(&ctx->committing); in xlog_cil_committed()
396 spin_unlock(&ctx->cil->xc_push_lock); in xlog_cil_committed()
398 xlog_cil_free_logvec(ctx->lv_chain); in xlog_cil_committed()
400 if (!list_empty(&ctx->busy_extents)) { in xlog_cil_committed()
403 xfs_discard_extents(mp, &ctx->busy_extents); in xlog_cil_committed()
404 xfs_extent_busy_clear(mp, &ctx->busy_extents, false); in xlog_cil_committed()
407 kmem_free(ctx); in xlog_cil_committed()
430 struct xfs_cil_ctx *ctx; in xlog_cil_push() local
449 ctx = cil->xc_ctx; in xlog_cil_push()
453 ASSERT(push_seq <= ctx->sequence); in xlog_cil_push()
497 list_add(&ctx->committing, &cil->xc_committing); in xlog_cil_push()
514 if (!ctx->lv_chain) in xlog_cil_push()
515 ctx->lv_chain = item->li_lv; in xlog_cil_push()
531 new_ctx->sequence = ctx->sequence + 1; in xlog_cil_push()
574 tic = ctx->ticket; in xlog_cil_push()
586 lvhdr.lv_next = ctx->lv_chain; in xlog_cil_push()
588 error = xlog_write(log, &lvhdr, tic, &ctx->start_lsn, NULL, 0); in xlog_cil_push()
613 if (new_ctx->sequence >= ctx->sequence) in xlog_cil_push()
632 ctx->log_cb.cb_func = xlog_cil_committed; in xlog_cil_push()
633 ctx->log_cb.cb_arg = ctx; in xlog_cil_push()
634 error = xfs_log_notify(log->l_mp, commit_iclog, &ctx->log_cb); in xlog_cil_push()
644 ctx->commit_lsn = commit_lsn; in xlog_cil_push()
660 xlog_cil_committed(ctx, XFS_LI_ABORTED); in xlog_cil_push()
835 struct xfs_cil_ctx *ctx; in xlog_cil_force_lsn() local
855 list_for_each_entry(ctx, &cil->xc_committing, committing) { in xlog_cil_force_lsn()
863 if (ctx->sequence > sequence) in xlog_cil_force_lsn()
865 if (!ctx->commit_lsn) { in xlog_cil_force_lsn()
873 if (ctx->sequence != sequence) in xlog_cil_force_lsn()
876 commit_lsn = ctx->commit_lsn; in xlog_cil_force_lsn()
928 struct xfs_cil_ctx *ctx; in xfs_log_item_in_current_chkpt() local
933 ctx = lip->li_mountp->m_log->l_cilp->xc_ctx; in xfs_log_item_in_current_chkpt()
940 if (XFS_LSN_CMP(lip->li_seq, ctx->sequence) != 0) in xfs_log_item_in_current_chkpt()
953 struct xfs_cil_ctx *ctx; in xlog_cil_init() local
959 ctx = kmem_zalloc(sizeof(*ctx), KM_SLEEP|KM_MAYFAIL); in xlog_cil_init()
960 if (!ctx) { in xlog_cil_init()
973 INIT_LIST_HEAD(&ctx->committing); in xlog_cil_init()
974 INIT_LIST_HEAD(&ctx->busy_extents); in xlog_cil_init()
975 ctx->sequence = 1; in xlog_cil_init()
976 ctx->cil = cil; in xlog_cil_init()
977 cil->xc_ctx = ctx; in xlog_cil_init()
978 cil->xc_current_sequence = ctx->sequence; in xlog_cil_init()