Lines Matching refs:cil

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