Lines Matching refs:cil

393 	struct xfs_cil		*cil = log->l_cilp;  in xlog_cil_insert_items()  local
394 struct xfs_cil_ctx *ctx = cil->xc_ctx; in xlog_cil_insert_items()
409 spin_lock(&cil->xc_cil_lock); in xlog_cil_insert_items()
479 if (!list_is_last(&lip->li_cil, &cil->xc_cil)) in xlog_cil_insert_items()
480 list_move_tail(&lip->li_cil, &cil->xc_cil); in xlog_cil_insert_items()
483 spin_unlock(&cil->xc_cil_lock); in xlog_cil_insert_items()
508 struct xfs_mount *mp = ctx->cil->xc_log->l_mp; in xlog_discard_endio_work()
583 struct xfs_mount *mp = ctx->cil->xc_log->l_mp; in xlog_cil_committed()
585 xfs_trans_committed_bulk(ctx->cil->xc_log->l_ailp, ctx->lv_chain, in xlog_cil_committed()
598 spin_lock(&ctx->cil->xc_push_lock); in xlog_cil_committed()
600 wake_up_all(&ctx->cil->xc_commit_wait); in xlog_cil_committed()
602 spin_unlock(&ctx->cil->xc_push_lock); in xlog_cil_committed()
630 struct xfs_cil *cil = log->l_cilp; in xlog_cil_push() local
644 if (!cil) in xlog_cil_push()
650 down_write(&cil->xc_ctx_lock); in xlog_cil_push()
651 ctx = cil->xc_ctx; in xlog_cil_push()
653 spin_lock(&cil->xc_push_lock); in xlog_cil_push()
654 push_seq = cil->xc_push_seq; in xlog_cil_push()
662 if (list_empty(&cil->xc_cil)) { in xlog_cil_push()
663 cil->xc_push_seq = 0; in xlog_cil_push()
664 spin_unlock(&cil->xc_push_lock); in xlog_cil_push()
670 if (push_seq < cil->xc_ctx->sequence) { in xlog_cil_push()
671 spin_unlock(&cil->xc_push_lock); in xlog_cil_push()
699 list_add(&ctx->committing, &cil->xc_committing); in xlog_cil_push()
700 spin_unlock(&cil->xc_push_lock); in xlog_cil_push()
710 while (!list_empty(&cil->xc_cil)) { in xlog_cil_push()
713 item = list_first_entry(&cil->xc_cil, in xlog_cil_push()
734 new_ctx->cil = cil; in xlog_cil_push()
735 cil->xc_ctx = new_ctx; in xlog_cil_push()
762 spin_lock(&cil->xc_push_lock); in xlog_cil_push()
763 cil->xc_current_sequence = new_ctx->sequence; in xlog_cil_push()
764 spin_unlock(&cil->xc_push_lock); in xlog_cil_push()
765 up_write(&cil->xc_ctx_lock); in xlog_cil_push()
799 spin_lock(&cil->xc_push_lock); in xlog_cil_push()
800 list_for_each_entry(new_ctx, &cil->xc_committing, committing) { in xlog_cil_push()
807 spin_unlock(&cil->xc_push_lock); in xlog_cil_push()
822 xlog_wait(&cil->xc_commit_wait, &cil->xc_push_lock); in xlog_cil_push()
826 spin_unlock(&cil->xc_push_lock); in xlog_cil_push()
845 spin_lock(&cil->xc_push_lock); in xlog_cil_push()
847 wake_up_all(&cil->xc_commit_wait); in xlog_cil_push()
848 spin_unlock(&cil->xc_push_lock); in xlog_cil_push()
854 up_write(&cil->xc_ctx_lock); in xlog_cil_push()
870 struct xfs_cil *cil = container_of(work, struct xfs_cil, in xlog_cil_push_work() local
872 xlog_cil_push(cil->xc_log); in xlog_cil_push_work()
886 struct xfs_cil *cil = log->l_cilp; in xlog_cil_push_background() local
892 ASSERT(!list_empty(&cil->xc_cil)); in xlog_cil_push_background()
898 if (cil->xc_ctx->space_used < XLOG_CIL_SPACE_LIMIT(log)) in xlog_cil_push_background()
901 spin_lock(&cil->xc_push_lock); in xlog_cil_push_background()
902 if (cil->xc_push_seq < cil->xc_current_sequence) { in xlog_cil_push_background()
903 cil->xc_push_seq = cil->xc_current_sequence; in xlog_cil_push_background()
904 queue_work(log->l_mp->m_cil_workqueue, &cil->xc_push_work); in xlog_cil_push_background()
906 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_background()
921 struct xfs_cil *cil = log->l_cilp; in xlog_cil_push_now() local
923 if (!cil) in xlog_cil_push_now()
926 ASSERT(push_seq && push_seq <= cil->xc_current_sequence); in xlog_cil_push_now()
929 flush_work(&cil->xc_push_work); in xlog_cil_push_now()
935 spin_lock(&cil->xc_push_lock); in xlog_cil_push_now()
936 if (list_empty(&cil->xc_cil) || push_seq <= cil->xc_push_seq) { in xlog_cil_push_now()
937 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_now()
941 cil->xc_push_seq = push_seq; in xlog_cil_push_now()
942 queue_work(log->l_mp->m_cil_workqueue, &cil->xc_push_work); in xlog_cil_push_now()
943 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_now()
950 struct xfs_cil *cil = log->l_cilp; in xlog_cil_empty() local
953 spin_lock(&cil->xc_push_lock); in xlog_cil_empty()
954 if (list_empty(&cil->xc_cil)) in xlog_cil_empty()
956 spin_unlock(&cil->xc_push_lock); in xlog_cil_empty()
981 struct xfs_cil *cil = log->l_cilp; in xfs_log_commit_cil() local
992 down_read(&cil->xc_ctx_lock); in xfs_log_commit_cil()
996 xc_commit_lsn = cil->xc_ctx->sequence; in xfs_log_commit_cil()
1019 up_read(&cil->xc_ctx_lock); in xfs_log_commit_cil()
1037 struct xfs_cil *cil = log->l_cilp; in xlog_cil_force_lsn() local
1041 ASSERT(sequence <= cil->xc_current_sequence); in xlog_cil_force_lsn()
1057 spin_lock(&cil->xc_push_lock); in xlog_cil_force_lsn()
1058 list_for_each_entry(ctx, &cil->xc_committing, committing) { in xlog_cil_force_lsn()
1073 xlog_wait(&cil->xc_commit_wait, &cil->xc_push_lock); in xlog_cil_force_lsn()
1097 if (sequence == cil->xc_current_sequence && in xlog_cil_force_lsn()
1098 !list_empty(&cil->xc_cil)) { in xlog_cil_force_lsn()
1099 spin_unlock(&cil->xc_push_lock); in xlog_cil_force_lsn()
1103 spin_unlock(&cil->xc_push_lock); in xlog_cil_force_lsn()
1114 spin_unlock(&cil->xc_push_lock); in xlog_cil_force_lsn()
1155 struct xfs_cil *cil; in xlog_cil_init() local
1158 cil = kmem_zalloc(sizeof(*cil), KM_SLEEP|KM_MAYFAIL); in xlog_cil_init()
1159 if (!cil) in xlog_cil_init()
1164 kmem_free(cil); in xlog_cil_init()
1168 INIT_WORK(&cil->xc_push_work, xlog_cil_push_work); in xlog_cil_init()
1169 INIT_LIST_HEAD(&cil->xc_cil); in xlog_cil_init()
1170 INIT_LIST_HEAD(&cil->xc_committing); in xlog_cil_init()
1171 spin_lock_init(&cil->xc_cil_lock); in xlog_cil_init()
1172 spin_lock_init(&cil->xc_push_lock); in xlog_cil_init()
1173 init_rwsem(&cil->xc_ctx_lock); in xlog_cil_init()
1174 init_waitqueue_head(&cil->xc_commit_wait); in xlog_cil_init()
1179 ctx->cil = cil; in xlog_cil_init()
1180 cil->xc_ctx = ctx; in xlog_cil_init()
1181 cil->xc_current_sequence = ctx->sequence; in xlog_cil_init()
1183 cil->xc_log = log; in xlog_cil_init()
1184 log->l_cilp = cil; in xlog_cil_init()