Lines Matching refs:cil

390 	struct xfs_cil		*cil = log->l_cilp;  in xlog_cil_insert_items()  local
391 struct xfs_cil_ctx *ctx = cil->xc_ctx; in xlog_cil_insert_items()
406 spin_lock(&cil->xc_cil_lock); in xlog_cil_insert_items()
476 if (!list_is_last(&lip->li_cil, &cil->xc_cil)) in xlog_cil_insert_items()
477 list_move_tail(&lip->li_cil, &cil->xc_cil); in xlog_cil_insert_items()
480 spin_unlock(&cil->xc_cil_lock); in xlog_cil_insert_items()
505 struct xfs_mount *mp = ctx->cil->xc_log->l_mp; in xlog_discard_endio_work()
578 struct xfs_mount *mp = ctx->cil->xc_log->l_mp; in xlog_cil_committed()
579 bool abort = XLOG_FORCED_SHUTDOWN(ctx->cil->xc_log); in xlog_cil_committed()
589 spin_lock(&ctx->cil->xc_push_lock); in xlog_cil_committed()
590 wake_up_all(&ctx->cil->xc_commit_wait); in xlog_cil_committed()
591 spin_unlock(&ctx->cil->xc_push_lock); in xlog_cil_committed()
594 xfs_trans_committed_bulk(ctx->cil->xc_log->l_ailp, ctx->lv_chain, in xlog_cil_committed()
601 spin_lock(&ctx->cil->xc_push_lock); in xlog_cil_committed()
603 spin_unlock(&ctx->cil->xc_push_lock); in xlog_cil_committed()
644 struct xfs_cil *cil = in xlog_cil_push_work() local
646 struct xlog *log = cil->xc_log; in xlog_cil_push_work()
663 down_write(&cil->xc_ctx_lock); in xlog_cil_push_work()
664 ctx = cil->xc_ctx; in xlog_cil_push_work()
666 spin_lock(&cil->xc_push_lock); in xlog_cil_push_work()
667 push_seq = cil->xc_push_seq; in xlog_cil_push_work()
678 if (waitqueue_active(&cil->xc_push_wait)) in xlog_cil_push_work()
679 wake_up_all(&cil->xc_push_wait); in xlog_cil_push_work()
686 if (list_empty(&cil->xc_cil)) { in xlog_cil_push_work()
687 cil->xc_push_seq = 0; in xlog_cil_push_work()
688 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_work()
694 if (push_seq < cil->xc_ctx->sequence) { in xlog_cil_push_work()
695 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_work()
723 list_add(&ctx->committing, &cil->xc_committing); in xlog_cil_push_work()
724 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_work()
734 while (!list_empty(&cil->xc_cil)) { in xlog_cil_push_work()
737 item = list_first_entry(&cil->xc_cil, in xlog_cil_push_work()
758 new_ctx->cil = cil; in xlog_cil_push_work()
759 cil->xc_ctx = new_ctx; in xlog_cil_push_work()
786 spin_lock(&cil->xc_push_lock); in xlog_cil_push_work()
787 cil->xc_current_sequence = new_ctx->sequence; in xlog_cil_push_work()
788 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_work()
789 up_write(&cil->xc_ctx_lock); in xlog_cil_push_work()
823 spin_lock(&cil->xc_push_lock); in xlog_cil_push_work()
824 list_for_each_entry(new_ctx, &cil->xc_committing, committing) { in xlog_cil_push_work()
831 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_work()
846 xlog_wait(&cil->xc_commit_wait, &cil->xc_push_lock); in xlog_cil_push_work()
850 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_work()
873 spin_lock(&cil->xc_push_lock); in xlog_cil_push_work()
875 wake_up_all(&cil->xc_commit_wait); in xlog_cil_push_work()
876 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_work()
883 up_write(&cil->xc_ctx_lock); in xlog_cil_push_work()
904 struct xlog *log) __releases(cil->xc_ctx_lock) in xlog_cil_push_background()
906 struct xfs_cil *cil = log->l_cilp; in xlog_cil_push_background() local
912 ASSERT(!list_empty(&cil->xc_cil)); in xlog_cil_push_background()
918 if (cil->xc_ctx->space_used < XLOG_CIL_SPACE_LIMIT(log)) { in xlog_cil_push_background()
919 up_read(&cil->xc_ctx_lock); in xlog_cil_push_background()
923 spin_lock(&cil->xc_push_lock); in xlog_cil_push_background()
924 if (cil->xc_push_seq < cil->xc_current_sequence) { in xlog_cil_push_background()
925 cil->xc_push_seq = cil->xc_current_sequence; in xlog_cil_push_background()
926 queue_work(log->l_mp->m_cil_workqueue, &cil->xc_push_work); in xlog_cil_push_background()
935 up_read(&cil->xc_ctx_lock); in xlog_cil_push_background()
947 if (cil->xc_ctx->space_used >= XLOG_CIL_BLOCKING_SPACE_LIMIT(log) || in xlog_cil_push_background()
948 waitqueue_active(&cil->xc_push_wait)) { in xlog_cil_push_background()
949 trace_xfs_log_cil_wait(log, cil->xc_ctx->ticket); in xlog_cil_push_background()
950 ASSERT(cil->xc_ctx->space_used < log->l_logsize); in xlog_cil_push_background()
951 xlog_wait(&cil->xc_push_wait, &cil->xc_push_lock); in xlog_cil_push_background()
955 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_background()
970 struct xfs_cil *cil = log->l_cilp; in xlog_cil_push_now() local
972 if (!cil) in xlog_cil_push_now()
975 ASSERT(push_seq && push_seq <= cil->xc_current_sequence); in xlog_cil_push_now()
978 flush_work(&cil->xc_push_work); in xlog_cil_push_now()
984 spin_lock(&cil->xc_push_lock); in xlog_cil_push_now()
985 if (list_empty(&cil->xc_cil) || push_seq <= cil->xc_push_seq) { in xlog_cil_push_now()
986 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_now()
990 cil->xc_push_seq = push_seq; in xlog_cil_push_now()
991 queue_work(log->l_mp->m_cil_workqueue, &cil->xc_push_work); in xlog_cil_push_now()
992 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_now()
999 struct xfs_cil *cil = log->l_cilp; in xlog_cil_empty() local
1002 spin_lock(&cil->xc_push_lock); in xlog_cil_empty()
1003 if (list_empty(&cil->xc_cil)) in xlog_cil_empty()
1005 spin_unlock(&cil->xc_push_lock); in xlog_cil_empty()
1029 struct xfs_cil *cil = log->l_cilp; in xlog_cil_commit() local
1040 down_read(&cil->xc_ctx_lock); in xlog_cil_commit()
1066 lip->li_ops->iop_committing(lip, cil->xc_ctx->sequence); in xlog_cil_commit()
1069 *commit_seq = cil->xc_ctx->sequence; in xlog_cil_commit()
1090 struct xfs_cil *cil = log->l_cilp; in xlog_cil_force_seq() local
1094 ASSERT(sequence <= cil->xc_current_sequence); in xlog_cil_force_seq()
1110 spin_lock(&cil->xc_push_lock); in xlog_cil_force_seq()
1111 list_for_each_entry(ctx, &cil->xc_committing, committing) { in xlog_cil_force_seq()
1126 xlog_wait(&cil->xc_commit_wait, &cil->xc_push_lock); in xlog_cil_force_seq()
1150 if (sequence == cil->xc_current_sequence && in xlog_cil_force_seq()
1151 !list_empty(&cil->xc_cil)) { in xlog_cil_force_seq()
1152 spin_unlock(&cil->xc_push_lock); in xlog_cil_force_seq()
1156 spin_unlock(&cil->xc_push_lock); in xlog_cil_force_seq()
1167 spin_unlock(&cil->xc_push_lock); in xlog_cil_force_seq()
1184 struct xfs_cil *cil = lip->li_mountp->m_log->l_cilp; in xfs_log_item_in_current_chkpt() local
1194 return lip->li_seq == READ_ONCE(cil->xc_current_sequence); in xfs_log_item_in_current_chkpt()
1204 struct xfs_cil *cil; in xlog_cil_init() local
1207 cil = kmem_zalloc(sizeof(*cil), KM_MAYFAIL); in xlog_cil_init()
1208 if (!cil) in xlog_cil_init()
1213 kmem_free(cil); in xlog_cil_init()
1217 INIT_WORK(&cil->xc_push_work, xlog_cil_push_work); in xlog_cil_init()
1218 INIT_LIST_HEAD(&cil->xc_cil); in xlog_cil_init()
1219 INIT_LIST_HEAD(&cil->xc_committing); in xlog_cil_init()
1220 spin_lock_init(&cil->xc_cil_lock); in xlog_cil_init()
1221 spin_lock_init(&cil->xc_push_lock); in xlog_cil_init()
1222 init_waitqueue_head(&cil->xc_push_wait); in xlog_cil_init()
1223 init_rwsem(&cil->xc_ctx_lock); in xlog_cil_init()
1224 init_waitqueue_head(&cil->xc_commit_wait); in xlog_cil_init()
1229 ctx->cil = cil; in xlog_cil_init()
1230 cil->xc_ctx = ctx; in xlog_cil_init()
1231 cil->xc_current_sequence = ctx->sequence; in xlog_cil_init()
1233 cil->xc_log = log; in xlog_cil_init()
1234 log->l_cilp = cil; in xlog_cil_init()