Lines Matching refs:cil

70 	struct xfs_cil		*cil,  in xlog_cil_ctx_switch()  argument
73 ctx->sequence = ++cil->xc_current_sequence; in xlog_cil_ctx_switch()
74 ctx->cil = cil; in xlog_cil_ctx_switch()
75 cil->xc_ctx = ctx; in xlog_cil_ctx_switch()
426 struct xfs_cil *cil = log->l_cilp; in xlog_cil_insert_items() local
427 struct xfs_cil_ctx *ctx = cil->xc_ctx; in xlog_cil_insert_items()
442 spin_lock(&cil->xc_cil_lock); in xlog_cil_insert_items()
512 if (!list_is_last(&lip->li_cil, &cil->xc_cil)) in xlog_cil_insert_items()
513 list_move_tail(&lip->li_cil, &cil->xc_cil); in xlog_cil_insert_items()
516 spin_unlock(&cil->xc_cil_lock); in xlog_cil_insert_items()
541 struct xfs_mount *mp = ctx->cil->xc_log->l_mp; in xlog_discard_endio_work()
614 struct xfs_mount *mp = ctx->cil->xc_log->l_mp; in xlog_cil_committed()
615 bool abort = xlog_is_shutdown(ctx->cil->xc_log); in xlog_cil_committed()
625 spin_lock(&ctx->cil->xc_push_lock); in xlog_cil_committed()
626 wake_up_all(&ctx->cil->xc_start_wait); in xlog_cil_committed()
627 wake_up_all(&ctx->cil->xc_commit_wait); in xlog_cil_committed()
628 spin_unlock(&ctx->cil->xc_push_lock); in xlog_cil_committed()
631 xfs_trans_committed_bulk(ctx->cil->xc_log->l_ailp, ctx->lv_chain, in xlog_cil_committed()
638 spin_lock(&ctx->cil->xc_push_lock); in xlog_cil_committed()
640 spin_unlock(&ctx->cil->xc_push_lock); in xlog_cil_committed()
674 struct xfs_cil *cil = ctx->cil; in xlog_cil_set_ctx_write_state() local
679 spin_lock(&cil->xc_push_lock); in xlog_cil_set_ctx_write_state()
687 wake_up_all(&cil->xc_start_wait); in xlog_cil_set_ctx_write_state()
688 spin_unlock(&cil->xc_push_lock); in xlog_cil_set_ctx_write_state()
707 spin_lock(&cil->xc_log->l_icloglock); in xlog_cil_set_ctx_write_state()
709 spin_unlock(&cil->xc_log->l_icloglock); in xlog_cil_set_ctx_write_state()
716 spin_lock(&cil->xc_push_lock); in xlog_cil_set_ctx_write_state()
719 wake_up_all(&cil->xc_commit_wait); in xlog_cil_set_ctx_write_state()
720 spin_unlock(&cil->xc_push_lock); in xlog_cil_set_ctx_write_state()
736 struct xfs_cil *cil, in xlog_cil_order_write() argument
743 spin_lock(&cil->xc_push_lock); in xlog_cil_order_write()
744 list_for_each_entry(ctx, &cil->xc_committing, committing) { in xlog_cil_order_write()
750 if (xlog_is_shutdown(cil->xc_log)) { in xlog_cil_order_write()
751 spin_unlock(&cil->xc_push_lock); in xlog_cil_order_write()
766 xlog_wait(&cil->xc_start_wait, &cil->xc_push_lock); in xlog_cil_order_write()
772 xlog_wait(&cil->xc_commit_wait, &cil->xc_push_lock); in xlog_cil_order_write()
778 spin_unlock(&cil->xc_push_lock); in xlog_cil_order_write()
793 struct xlog *log = ctx->cil->xc_log; in xlog_cil_write_chain()
796 error = xlog_cil_order_write(ctx->cil, ctx->sequence, _START_RECORD); in xlog_cil_write_chain()
812 struct xlog *log = ctx->cil->xc_log; in xlog_cil_write_commit_record()
827 error = xlog_cil_order_write(ctx->cil, ctx->sequence, _COMMIT_RECORD); in xlog_cil_write_commit_record()
857 struct xfs_cil *cil = ctx->cil; in xlog_cil_push_work() local
858 struct xlog *log = cil->xc_log; in xlog_cil_push_work()
876 down_write(&cil->xc_ctx_lock); in xlog_cil_push_work()
878 spin_lock(&cil->xc_push_lock); in xlog_cil_push_work()
879 push_seq = cil->xc_push_seq; in xlog_cil_push_work()
881 push_commit_stable = cil->xc_push_commit_stable; in xlog_cil_push_work()
882 cil->xc_push_commit_stable = false; in xlog_cil_push_work()
892 if (waitqueue_active(&cil->xc_push_wait)) in xlog_cil_push_work()
893 wake_up_all(&cil->xc_push_wait); in xlog_cil_push_work()
900 if (list_empty(&cil->xc_cil)) { in xlog_cil_push_work()
901 cil->xc_push_seq = 0; in xlog_cil_push_work()
902 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_work()
909 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_work()
937 list_add(&ctx->committing, &cil->xc_committing); in xlog_cil_push_work()
938 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_work()
965 while (!list_empty(&cil->xc_cil)) { in xlog_cil_push_work()
968 item = list_first_entry(&cil->xc_cil, in xlog_cil_push_work()
1005 spin_lock(&cil->xc_push_lock); in xlog_cil_push_work()
1006 xlog_cil_ctx_switch(cil, new_ctx); in xlog_cil_push_work()
1007 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_work()
1008 up_write(&cil->xc_ctx_lock); in xlog_cil_push_work()
1105 up_write(&cil->xc_ctx_lock); in xlog_cil_push_work()
1132 struct xlog *log) __releases(cil->xc_ctx_lock) in xlog_cil_push_background()
1134 struct xfs_cil *cil = log->l_cilp; in xlog_cil_push_background() local
1140 ASSERT(!list_empty(&cil->xc_cil)); in xlog_cil_push_background()
1146 if (cil->xc_ctx->space_used < XLOG_CIL_SPACE_LIMIT(log)) { in xlog_cil_push_background()
1147 up_read(&cil->xc_ctx_lock); in xlog_cil_push_background()
1151 spin_lock(&cil->xc_push_lock); in xlog_cil_push_background()
1152 if (cil->xc_push_seq < cil->xc_current_sequence) { in xlog_cil_push_background()
1153 cil->xc_push_seq = cil->xc_current_sequence; in xlog_cil_push_background()
1154 queue_work(cil->xc_push_wq, &cil->xc_ctx->push_work); in xlog_cil_push_background()
1163 up_read(&cil->xc_ctx_lock); in xlog_cil_push_background()
1175 if (cil->xc_ctx->space_used >= XLOG_CIL_BLOCKING_SPACE_LIMIT(log) || in xlog_cil_push_background()
1176 waitqueue_active(&cil->xc_push_wait)) { in xlog_cil_push_background()
1177 trace_xfs_log_cil_wait(log, cil->xc_ctx->ticket); in xlog_cil_push_background()
1178 ASSERT(cil->xc_ctx->space_used < log->l_logsize); in xlog_cil_push_background()
1179 xlog_wait(&cil->xc_push_wait, &cil->xc_push_lock); in xlog_cil_push_background()
1183 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_background()
1211 struct xfs_cil *cil = log->l_cilp; in xlog_cil_push_now() local
1213 if (!cil) in xlog_cil_push_now()
1216 ASSERT(push_seq && push_seq <= cil->xc_current_sequence); in xlog_cil_push_now()
1220 flush_workqueue(cil->xc_push_wq); in xlog_cil_push_now()
1226 spin_lock(&cil->xc_push_lock); in xlog_cil_push_now()
1227 if (list_empty(&cil->xc_cil) || push_seq <= cil->xc_push_seq) { in xlog_cil_push_now()
1228 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_now()
1232 cil->xc_push_seq = push_seq; in xlog_cil_push_now()
1233 cil->xc_push_commit_stable = async; in xlog_cil_push_now()
1234 queue_work(cil->xc_push_wq, &cil->xc_ctx->push_work); in xlog_cil_push_now()
1235 spin_unlock(&cil->xc_push_lock); in xlog_cil_push_now()
1242 struct xfs_cil *cil = log->l_cilp; in xlog_cil_empty() local
1245 spin_lock(&cil->xc_push_lock); in xlog_cil_empty()
1246 if (list_empty(&cil->xc_cil)) in xlog_cil_empty()
1248 spin_unlock(&cil->xc_push_lock); in xlog_cil_empty()
1272 struct xfs_cil *cil = log->l_cilp; in xlog_cil_commit() local
1283 down_read(&cil->xc_ctx_lock); in xlog_cil_commit()
1309 lip->li_ops->iop_committing(lip, cil->xc_ctx->sequence); in xlog_cil_commit()
1312 *commit_seq = cil->xc_ctx->sequence; in xlog_cil_commit()
1348 struct xfs_cil *cil = log->l_cilp; in xlog_cil_force_seq() local
1352 ASSERT(sequence <= cil->xc_current_sequence); in xlog_cil_force_seq()
1355 sequence = cil->xc_current_sequence; in xlog_cil_force_seq()
1372 spin_lock(&cil->xc_push_lock); in xlog_cil_force_seq()
1373 list_for_each_entry(ctx, &cil->xc_committing, committing) { in xlog_cil_force_seq()
1389 xlog_wait(&cil->xc_commit_wait, &cil->xc_push_lock); in xlog_cil_force_seq()
1413 if (sequence == cil->xc_current_sequence && in xlog_cil_force_seq()
1414 !list_empty(&cil->xc_cil)) { in xlog_cil_force_seq()
1415 spin_unlock(&cil->xc_push_lock); in xlog_cil_force_seq()
1419 spin_unlock(&cil->xc_push_lock); in xlog_cil_force_seq()
1430 spin_unlock(&cil->xc_push_lock); in xlog_cil_force_seq()
1467 struct xfs_cil *cil; in xlog_cil_init() local
1470 cil = kmem_zalloc(sizeof(*cil), KM_MAYFAIL); in xlog_cil_init()
1471 if (!cil) in xlog_cil_init()
1477 cil->xc_push_wq = alloc_workqueue("xfs-cil/%s", in xlog_cil_init()
1480 if (!cil->xc_push_wq) in xlog_cil_init()
1483 INIT_LIST_HEAD(&cil->xc_cil); in xlog_cil_init()
1484 INIT_LIST_HEAD(&cil->xc_committing); in xlog_cil_init()
1485 spin_lock_init(&cil->xc_cil_lock); in xlog_cil_init()
1486 spin_lock_init(&cil->xc_push_lock); in xlog_cil_init()
1487 init_waitqueue_head(&cil->xc_push_wait); in xlog_cil_init()
1488 init_rwsem(&cil->xc_ctx_lock); in xlog_cil_init()
1489 init_waitqueue_head(&cil->xc_start_wait); in xlog_cil_init()
1490 init_waitqueue_head(&cil->xc_commit_wait); in xlog_cil_init()
1491 cil->xc_log = log; in xlog_cil_init()
1492 log->l_cilp = cil; in xlog_cil_init()
1495 xlog_cil_ctx_switch(cil, ctx); in xlog_cil_init()
1500 kmem_free(cil); in xlog_cil_init()