Lines Matching refs:cil
282 struct xfs_cil *cil = log->l_cilp; in xlog_cil_insert_items() local
283 struct xfs_cil_ctx *ctx = cil->xc_ctx; in xlog_cil_insert_items()
302 spin_lock(&cil->xc_cil_lock); in xlog_cil_insert_items()
315 if (!list_is_last(&lip->li_cil, &cil->xc_cil)) in xlog_cil_insert_items()
316 list_move_tail(&lip->li_cil, &cil->xc_cil); in xlog_cil_insert_items()
356 spin_unlock(&cil->xc_cil_lock); in xlog_cil_insert_items()
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()
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()
402 spin_unlock(&ctx->cil->xc_push_lock); in xlog_cil_committed()
434 struct xfs_cil *cil = log->l_cilp; in xlog_cil_push() local
448 if (!cil) in xlog_cil_push()
454 down_write(&cil->xc_ctx_lock); in xlog_cil_push()
455 ctx = cil->xc_ctx; in xlog_cil_push()
457 spin_lock(&cil->xc_push_lock); in xlog_cil_push()
458 push_seq = cil->xc_push_seq; in xlog_cil_push()
466 if (list_empty(&cil->xc_cil)) { in xlog_cil_push()
467 cil->xc_push_seq = 0; in xlog_cil_push()
468 spin_unlock(&cil->xc_push_lock); in xlog_cil_push()
474 if (push_seq < cil->xc_ctx->sequence) { in xlog_cil_push()
475 spin_unlock(&cil->xc_push_lock); in xlog_cil_push()
503 list_add(&ctx->committing, &cil->xc_committing); in xlog_cil_push()
504 spin_unlock(&cil->xc_push_lock); in xlog_cil_push()
514 while (!list_empty(&cil->xc_cil)) { in xlog_cil_push()
517 item = list_first_entry(&cil->xc_cil, in xlog_cil_push()
538 new_ctx->cil = cil; in xlog_cil_push()
539 cil->xc_ctx = new_ctx; in xlog_cil_push()
566 spin_lock(&cil->xc_push_lock); in xlog_cil_push()
567 cil->xc_current_sequence = new_ctx->sequence; in xlog_cil_push()
568 spin_unlock(&cil->xc_push_lock); in xlog_cil_push()
569 up_write(&cil->xc_ctx_lock); in xlog_cil_push()
603 spin_lock(&cil->xc_push_lock); in xlog_cil_push()
604 list_for_each_entry(new_ctx, &cil->xc_committing, committing) { in xlog_cil_push()
611 spin_unlock(&cil->xc_push_lock); in xlog_cil_push()
626 xlog_wait(&cil->xc_commit_wait, &cil->xc_push_lock); in xlog_cil_push()
630 spin_unlock(&cil->xc_push_lock); in xlog_cil_push()
649 spin_lock(&cil->xc_push_lock); in xlog_cil_push()
651 wake_up_all(&cil->xc_commit_wait); in xlog_cil_push()
652 spin_unlock(&cil->xc_push_lock); in xlog_cil_push()
658 up_write(&cil->xc_ctx_lock); in xlog_cil_push()
674 struct xfs_cil *cil = container_of(work, struct xfs_cil, in xlog_cil_push_work() local
676 xlog_cil_push(cil->xc_log); in xlog_cil_push_work()
690 struct xfs_cil *cil = log->l_cilp; in xlog_cil_push_background() local
696 ASSERT(!list_empty(&cil->xc_cil)); in xlog_cil_push_background()
702 if (cil->xc_ctx->space_used < XLOG_CIL_SPACE_LIMIT(log)) in xlog_cil_push_background()
705 spin_lock(&cil->xc_push_lock); in xlog_cil_push_background()
706 if (cil->xc_push_seq < cil->xc_current_sequence) { in xlog_cil_push_background()
707 cil->xc_push_seq = cil->xc_current_sequence; in xlog_cil_push_background()
708 queue_work(log->l_mp->m_cil_workqueue, &cil->xc_push_work); in xlog_cil_push_background()
710 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_background()
725 struct xfs_cil *cil = log->l_cilp; in xlog_cil_push_now() local
727 if (!cil) in xlog_cil_push_now()
730 ASSERT(push_seq && push_seq <= cil->xc_current_sequence); in xlog_cil_push_now()
733 flush_work(&cil->xc_push_work); in xlog_cil_push_now()
739 spin_lock(&cil->xc_push_lock); in xlog_cil_push_now()
740 if (list_empty(&cil->xc_cil) || push_seq <= cil->xc_push_seq) { in xlog_cil_push_now()
741 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_now()
745 cil->xc_push_seq = push_seq; in xlog_cil_push_now()
746 queue_work(log->l_mp->m_cil_workqueue, &cil->xc_push_work); in xlog_cil_push_now()
747 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_now()
754 struct xfs_cil *cil = log->l_cilp; in xlog_cil_empty() local
757 spin_lock(&cil->xc_push_lock); in xlog_cil_empty()
758 if (list_empty(&cil->xc_cil)) in xlog_cil_empty()
760 spin_unlock(&cil->xc_push_lock); in xlog_cil_empty()
785 struct xfs_cil *cil = log->l_cilp; in xfs_log_commit_cil() local
788 down_read(&cil->xc_ctx_lock); in xfs_log_commit_cil()
796 tp->t_commit_lsn = cil->xc_ctx->sequence; in xfs_log_commit_cil()
818 up_read(&cil->xc_ctx_lock); in xfs_log_commit_cil()
836 struct xfs_cil *cil = log->l_cilp; in xlog_cil_force_lsn() local
840 ASSERT(sequence <= cil->xc_current_sequence); in xlog_cil_force_lsn()
856 spin_lock(&cil->xc_push_lock); in xlog_cil_force_lsn()
857 list_for_each_entry(ctx, &cil->xc_committing, committing) { in xlog_cil_force_lsn()
872 xlog_wait(&cil->xc_commit_wait, &cil->xc_push_lock); in xlog_cil_force_lsn()
896 if (sequence == cil->xc_current_sequence && in xlog_cil_force_lsn()
897 !list_empty(&cil->xc_cil)) { in xlog_cil_force_lsn()
898 spin_unlock(&cil->xc_push_lock); in xlog_cil_force_lsn()
902 spin_unlock(&cil->xc_push_lock); in xlog_cil_force_lsn()
913 spin_unlock(&cil->xc_push_lock); in xlog_cil_force_lsn()
954 struct xfs_cil *cil; in xlog_cil_init() local
957 cil = kmem_zalloc(sizeof(*cil), KM_SLEEP|KM_MAYFAIL); in xlog_cil_init()
958 if (!cil) in xlog_cil_init()
963 kmem_free(cil); in xlog_cil_init()
967 INIT_WORK(&cil->xc_push_work, xlog_cil_push_work); in xlog_cil_init()
968 INIT_LIST_HEAD(&cil->xc_cil); in xlog_cil_init()
969 INIT_LIST_HEAD(&cil->xc_committing); in xlog_cil_init()
970 spin_lock_init(&cil->xc_cil_lock); in xlog_cil_init()
971 spin_lock_init(&cil->xc_push_lock); in xlog_cil_init()
972 init_rwsem(&cil->xc_ctx_lock); in xlog_cil_init()
973 init_waitqueue_head(&cil->xc_commit_wait); 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()
982 cil->xc_log = log; in xlog_cil_init()
983 log->l_cilp = cil; in xlog_cil_init()