Lines Matching refs:tic
184 struct xlog_ticket *tic; in xlog_grant_head_wake_all() local
187 list_for_each_entry(tic, &head->waiters, t_queue) in xlog_grant_head_wake_all()
188 wake_up_process(tic->t_task); in xlog_grant_head_wake_all()
196 struct xlog_ticket *tic) in xlog_ticket_reservation() argument
199 ASSERT(tic->t_flags & XLOG_TIC_PERM_RESERV); in xlog_ticket_reservation()
200 return tic->t_unit_res; in xlog_ticket_reservation()
202 if (tic->t_flags & XLOG_TIC_PERM_RESERV) in xlog_ticket_reservation()
203 return tic->t_unit_res * tic->t_cnt; in xlog_ticket_reservation()
205 return tic->t_unit_res; in xlog_ticket_reservation()
215 struct xlog_ticket *tic; in xlog_grant_head_wake() local
219 list_for_each_entry(tic, &head->waiters, t_queue) { in xlog_grant_head_wake()
242 need_bytes = xlog_ticket_reservation(log, head, tic); in xlog_grant_head_wake()
250 trace_xfs_log_grant_wake_up(log, tic); in xlog_grant_head_wake()
251 wake_up_process(tic->t_task); in xlog_grant_head_wake()
262 struct xlog_ticket *tic, in xlog_grant_head_wait() argument
266 list_add_tail(&tic->t_queue, &head->waiters); in xlog_grant_head_wait()
278 trace_xfs_log_grant_sleep(log, tic); in xlog_grant_head_wait()
280 trace_xfs_log_grant_wake(log, tic); in xlog_grant_head_wait()
287 list_del_init(&tic->t_queue); in xlog_grant_head_wait()
290 list_del_init(&tic->t_queue); in xlog_grant_head_wait()
315 struct xlog_ticket *tic, in xlog_grant_head_check() argument
329 *need_bytes = xlog_ticket_reservation(log, head, tic); in xlog_grant_head_check()
335 error = xlog_grant_head_wait(log, head, tic, in xlog_grant_head_check()
341 error = xlog_grant_head_wait(log, head, tic, *need_bytes); in xlog_grant_head_check()
349 xlog_tic_reset_res(xlog_ticket_t *tic) in xlog_tic_reset_res() argument
351 tic->t_res_num = 0; in xlog_tic_reset_res()
352 tic->t_res_arr_sum = 0; in xlog_tic_reset_res()
353 tic->t_res_num_ophdrs = 0; in xlog_tic_reset_res()
357 xlog_tic_add_region(xlog_ticket_t *tic, uint len, uint type) in xlog_tic_add_region() argument
359 if (tic->t_res_num == XLOG_TIC_LEN_MAX) { in xlog_tic_add_region()
361 tic->t_res_o_flow += tic->t_res_arr_sum; in xlog_tic_add_region()
362 tic->t_res_num = 0; in xlog_tic_add_region()
363 tic->t_res_arr_sum = 0; in xlog_tic_add_region()
366 tic->t_res_arr[tic->t_res_num].r_len = len; in xlog_tic_add_region()
367 tic->t_res_arr[tic->t_res_num].r_type = type; in xlog_tic_add_region()
368 tic->t_res_arr_sum += len; in xlog_tic_add_region()
369 tic->t_res_num++; in xlog_tic_add_region()
378 struct xlog_ticket *tic) in xfs_log_regrant() argument
395 tic->t_tid++; in xfs_log_regrant()
397 xlog_grant_push_ail(log, tic->t_unit_res); in xfs_log_regrant()
399 tic->t_curr_res = tic->t_unit_res; in xfs_log_regrant()
400 xlog_tic_reset_res(tic); in xfs_log_regrant()
402 if (tic->t_cnt > 0) in xfs_log_regrant()
405 trace_xfs_log_regrant(log, tic); in xfs_log_regrant()
407 error = xlog_grant_head_check(log, &log->l_write_head, tic, in xfs_log_regrant()
413 trace_xfs_log_regrant_exit(log, tic); in xfs_log_regrant()
423 tic->t_curr_res = 0; in xfs_log_regrant()
424 tic->t_cnt = 0; /* ungrant will give back unit_res * t_cnt. */ in xfs_log_regrant()
446 struct xlog_ticket *tic; in xfs_log_reserve() local
458 tic = xlog_ticket_alloc(log, unit_bytes, cnt, client, permanent, 0); in xfs_log_reserve()
459 *ticp = tic; in xfs_log_reserve()
461 xlog_grant_push_ail(log, tic->t_cnt ? tic->t_unit_res * tic->t_cnt in xfs_log_reserve()
462 : tic->t_unit_res); in xfs_log_reserve()
464 trace_xfs_log_reserve(log, tic); in xfs_log_reserve()
466 error = xlog_grant_head_check(log, &log->l_reserve_head, tic, in xfs_log_reserve()
473 trace_xfs_log_reserve_exit(log, tic); in xfs_log_reserve()
483 tic->t_curr_res = 0; in xfs_log_reserve()
484 tic->t_cnt = 0; /* ungrant will give back unit_res * t_cnt. */ in xfs_log_reserve()
831 struct xlog_ticket *tic = NULL; in xfs_log_write_unmount_record() local
836 error = xfs_log_reserve(mp, 600, 1, &tic, XFS_LOG, 0); in xfs_log_write_unmount_record()
854 tic->t_flags = 0; in xfs_log_write_unmount_record()
855 tic->t_curr_res -= sizeof(magic); in xfs_log_write_unmount_record()
856 error = xlog_write(log, &vec, tic, &lsn, NULL, flags); in xfs_log_write_unmount_record()
886 if (tic) { in xfs_log_write_unmount_record()
887 trace_xfs_log_umount_write(log, tic); in xfs_log_write_unmount_record()
888 xlog_ungrant_log_space(log, tic); in xfs_log_write_unmount_record()
889 xfs_log_ticket_put(tic); in xfs_log_write_unmount_record()
3663 struct xlog_ticket *tic; in xlog_ticket_alloc() local
3666 tic = kmem_zone_zalloc(xfs_log_ticket_zone, alloc_flags); in xlog_ticket_alloc()
3667 if (!tic) in xlog_ticket_alloc()
3672 atomic_set(&tic->t_ref, 1); in xlog_ticket_alloc()
3673 tic->t_task = current; in xlog_ticket_alloc()
3674 INIT_LIST_HEAD(&tic->t_queue); in xlog_ticket_alloc()
3675 tic->t_unit_res = unit_res; in xlog_ticket_alloc()
3676 tic->t_curr_res = unit_res; in xlog_ticket_alloc()
3677 tic->t_cnt = cnt; in xlog_ticket_alloc()
3678 tic->t_ocnt = cnt; in xlog_ticket_alloc()
3679 tic->t_tid = prandom_u32(); in xlog_ticket_alloc()
3680 tic->t_clientid = client; in xlog_ticket_alloc()
3681 tic->t_flags = XLOG_TIC_INITED; in xlog_ticket_alloc()
3683 tic->t_flags |= XLOG_TIC_PERM_RESERV; in xlog_ticket_alloc()
3685 xlog_tic_reset_res(tic); in xlog_ticket_alloc()
3687 return tic; in xlog_ticket_alloc()