Lines Matching refs:tic

206 	struct xlog_ticket	*tic;  in xlog_grant_head_wake_all()  local
209 list_for_each_entry(tic, &head->waiters, t_queue) in xlog_grant_head_wake_all()
210 wake_up_process(tic->t_task); in xlog_grant_head_wake_all()
218 struct xlog_ticket *tic) in xlog_ticket_reservation() argument
221 ASSERT(tic->t_flags & XLOG_TIC_PERM_RESERV); in xlog_ticket_reservation()
222 return tic->t_unit_res; in xlog_ticket_reservation()
224 if (tic->t_flags & XLOG_TIC_PERM_RESERV) in xlog_ticket_reservation()
225 return tic->t_unit_res * tic->t_cnt; in xlog_ticket_reservation()
227 return tic->t_unit_res; in xlog_ticket_reservation()
237 struct xlog_ticket *tic; in xlog_grant_head_wake() local
240 list_for_each_entry(tic, &head->waiters, t_queue) { in xlog_grant_head_wake()
241 need_bytes = xlog_ticket_reservation(log, head, tic); in xlog_grant_head_wake()
246 trace_xfs_log_grant_wake_up(log, tic); in xlog_grant_head_wake()
247 wake_up_process(tic->t_task); in xlog_grant_head_wake()
257 struct xlog_ticket *tic, in xlog_grant_head_wait() argument
261 list_add_tail(&tic->t_queue, &head->waiters); in xlog_grant_head_wait()
273 trace_xfs_log_grant_sleep(log, tic); in xlog_grant_head_wait()
275 trace_xfs_log_grant_wake(log, tic); in xlog_grant_head_wait()
282 list_del_init(&tic->t_queue); in xlog_grant_head_wait()
285 list_del_init(&tic->t_queue); in xlog_grant_head_wait()
310 struct xlog_ticket *tic, in xlog_grant_head_check() argument
324 *need_bytes = xlog_ticket_reservation(log, head, tic); in xlog_grant_head_check()
330 error = xlog_grant_head_wait(log, head, tic, in xlog_grant_head_check()
336 error = xlog_grant_head_wait(log, head, tic, *need_bytes); in xlog_grant_head_check()
344 xlog_tic_reset_res(xlog_ticket_t *tic) in xlog_tic_reset_res() argument
346 tic->t_res_num = 0; in xlog_tic_reset_res()
347 tic->t_res_arr_sum = 0; in xlog_tic_reset_res()
348 tic->t_res_num_ophdrs = 0; in xlog_tic_reset_res()
352 xlog_tic_add_region(xlog_ticket_t *tic, uint len, uint type) in xlog_tic_add_region() argument
354 if (tic->t_res_num == XLOG_TIC_LEN_MAX) { in xlog_tic_add_region()
356 tic->t_res_o_flow += tic->t_res_arr_sum; in xlog_tic_add_region()
357 tic->t_res_num = 0; in xlog_tic_add_region()
358 tic->t_res_arr_sum = 0; in xlog_tic_add_region()
361 tic->t_res_arr[tic->t_res_num].r_len = len; in xlog_tic_add_region()
362 tic->t_res_arr[tic->t_res_num].r_type = type; in xlog_tic_add_region()
363 tic->t_res_arr_sum += len; in xlog_tic_add_region()
364 tic->t_res_num++; in xlog_tic_add_region()
373 struct xlog_ticket *tic) in xfs_log_regrant() argument
390 tic->t_tid++; in xfs_log_regrant()
392 xlog_grant_push_ail(log, tic->t_unit_res); in xfs_log_regrant()
394 tic->t_curr_res = tic->t_unit_res; in xfs_log_regrant()
395 xlog_tic_reset_res(tic); in xfs_log_regrant()
397 if (tic->t_cnt > 0) in xfs_log_regrant()
400 trace_xfs_log_regrant(log, tic); in xfs_log_regrant()
402 error = xlog_grant_head_check(log, &log->l_write_head, tic, in xfs_log_regrant()
408 trace_xfs_log_regrant_exit(log, tic); in xfs_log_regrant()
418 tic->t_curr_res = 0; in xfs_log_regrant()
419 tic->t_cnt = 0; /* ungrant will give back unit_res * t_cnt. */ in xfs_log_regrant()
442 struct xlog_ticket *tic; in xfs_log_reserve() local
454 tic = xlog_ticket_alloc(log, unit_bytes, cnt, client, permanent, in xfs_log_reserve()
456 if (!tic) in xfs_log_reserve()
459 tic->t_trans_type = t_type; in xfs_log_reserve()
460 *ticp = tic; in xfs_log_reserve()
462 xlog_grant_push_ail(log, tic->t_cnt ? tic->t_unit_res * tic->t_cnt in xfs_log_reserve()
463 : tic->t_unit_res); in xfs_log_reserve()
465 trace_xfs_log_reserve(log, tic); in xfs_log_reserve()
467 error = xlog_grant_head_check(log, &log->l_reserve_head, tic, in xfs_log_reserve()
474 trace_xfs_log_reserve_exit(log, tic); in xfs_log_reserve()
484 tic->t_curr_res = 0; in xfs_log_reserve()
485 tic->t_cnt = 0; /* ungrant will give back unit_res * t_cnt. */ in xfs_log_reserve()
786 xlog_ticket_t *tic = NULL; in xfs_log_unmount_write() local
811 error = xfs_log_reserve(mp, 600, 1, &tic, in xfs_log_unmount_write()
833 tic->t_flags = 0; in xfs_log_unmount_write()
834 tic->t_curr_res -= sizeof(magic); in xfs_log_unmount_write()
835 error = xlog_write(log, &vec, tic, &lsn, in xfs_log_unmount_write()
867 if (tic) { in xfs_log_unmount_write()
868 trace_xfs_log_umount_write(log, tic); in xfs_log_unmount_write()
869 xlog_ungrant_log_space(log, tic); in xfs_log_unmount_write()
870 xfs_log_ticket_put(tic); in xfs_log_unmount_write()
3623 struct xlog_ticket *tic; in xlog_ticket_alloc() local
3626 tic = kmem_zone_zalloc(xfs_log_ticket_zone, alloc_flags); in xlog_ticket_alloc()
3627 if (!tic) in xlog_ticket_alloc()
3632 atomic_set(&tic->t_ref, 1); in xlog_ticket_alloc()
3633 tic->t_task = current; in xlog_ticket_alloc()
3634 INIT_LIST_HEAD(&tic->t_queue); in xlog_ticket_alloc()
3635 tic->t_unit_res = unit_res; in xlog_ticket_alloc()
3636 tic->t_curr_res = unit_res; in xlog_ticket_alloc()
3637 tic->t_cnt = cnt; in xlog_ticket_alloc()
3638 tic->t_ocnt = cnt; in xlog_ticket_alloc()
3639 tic->t_tid = prandom_u32(); in xlog_ticket_alloc()
3640 tic->t_clientid = client; in xlog_ticket_alloc()
3641 tic->t_flags = XLOG_TIC_INITED; in xlog_ticket_alloc()
3642 tic->t_trans_type = 0; in xlog_ticket_alloc()
3644 tic->t_flags |= XLOG_TIC_PERM_RESERV; in xlog_ticket_alloc()
3646 xlog_tic_reset_res(tic); in xlog_ticket_alloc()
3648 return tic; in xlog_ticket_alloc()