Lines Matching refs:tic

161 	struct xlog_ticket	*tic;  in xlog_grant_head_wake_all()  local
164 list_for_each_entry(tic, &head->waiters, t_queue) in xlog_grant_head_wake_all()
165 wake_up_process(tic->t_task); in xlog_grant_head_wake_all()
173 struct xlog_ticket *tic) in xlog_ticket_reservation() argument
176 ASSERT(tic->t_flags & XLOG_TIC_PERM_RESERV); in xlog_ticket_reservation()
177 return tic->t_unit_res; in xlog_ticket_reservation()
179 if (tic->t_flags & XLOG_TIC_PERM_RESERV) in xlog_ticket_reservation()
180 return tic->t_unit_res * tic->t_cnt; in xlog_ticket_reservation()
182 return tic->t_unit_res; in xlog_ticket_reservation()
192 struct xlog_ticket *tic; in xlog_grant_head_wake() local
196 list_for_each_entry(tic, &head->waiters, t_queue) { in xlog_grant_head_wake()
219 need_bytes = xlog_ticket_reservation(log, head, tic); in xlog_grant_head_wake()
227 trace_xfs_log_grant_wake_up(log, tic); in xlog_grant_head_wake()
228 wake_up_process(tic->t_task); in xlog_grant_head_wake()
239 struct xlog_ticket *tic, in xlog_grant_head_wait() argument
243 list_add_tail(&tic->t_queue, &head->waiters); in xlog_grant_head_wait()
255 trace_xfs_log_grant_sleep(log, tic); in xlog_grant_head_wait()
257 trace_xfs_log_grant_wake(log, tic); in xlog_grant_head_wait()
264 list_del_init(&tic->t_queue); in xlog_grant_head_wait()
267 list_del_init(&tic->t_queue); in xlog_grant_head_wait()
292 struct xlog_ticket *tic, in xlog_grant_head_check() argument
306 *need_bytes = xlog_ticket_reservation(log, head, tic); in xlog_grant_head_check()
312 error = xlog_grant_head_wait(log, head, tic, in xlog_grant_head_check()
318 error = xlog_grant_head_wait(log, head, tic, *need_bytes); in xlog_grant_head_check()
326 xlog_tic_reset_res(xlog_ticket_t *tic) in xlog_tic_reset_res() argument
328 tic->t_res_num = 0; in xlog_tic_reset_res()
329 tic->t_res_arr_sum = 0; in xlog_tic_reset_res()
330 tic->t_res_num_ophdrs = 0; in xlog_tic_reset_res()
334 xlog_tic_add_region(xlog_ticket_t *tic, uint len, uint type) in xlog_tic_add_region() argument
336 if (tic->t_res_num == XLOG_TIC_LEN_MAX) { in xlog_tic_add_region()
338 tic->t_res_o_flow += tic->t_res_arr_sum; in xlog_tic_add_region()
339 tic->t_res_num = 0; in xlog_tic_add_region()
340 tic->t_res_arr_sum = 0; in xlog_tic_add_region()
343 tic->t_res_arr[tic->t_res_num].r_len = len; in xlog_tic_add_region()
344 tic->t_res_arr[tic->t_res_num].r_type = type; in xlog_tic_add_region()
345 tic->t_res_arr_sum += len; in xlog_tic_add_region()
346 tic->t_res_num++; in xlog_tic_add_region()
376 struct xlog_ticket *tic) in xfs_log_regrant() argument
393 tic->t_tid++; in xfs_log_regrant()
395 xlog_grant_push_ail(log, tic->t_unit_res); in xfs_log_regrant()
397 tic->t_curr_res = tic->t_unit_res; in xfs_log_regrant()
398 xlog_tic_reset_res(tic); in xfs_log_regrant()
400 if (tic->t_cnt > 0) in xfs_log_regrant()
403 trace_xfs_log_regrant(log, tic); in xfs_log_regrant()
405 error = xlog_grant_head_check(log, &log->l_write_head, tic, in xfs_log_regrant()
411 trace_xfs_log_regrant_exit(log, tic); in xfs_log_regrant()
421 tic->t_curr_res = 0; in xfs_log_regrant()
422 tic->t_cnt = 0; /* ungrant will give back unit_res * t_cnt. */ in xfs_log_regrant()
444 struct xlog_ticket *tic; in xfs_log_reserve() local
456 tic = xlog_ticket_alloc(log, unit_bytes, cnt, client, permanent); in xfs_log_reserve()
457 *ticp = tic; in xfs_log_reserve()
459 xlog_grant_push_ail(log, tic->t_cnt ? tic->t_unit_res * tic->t_cnt in xfs_log_reserve()
460 : tic->t_unit_res); in xfs_log_reserve()
462 trace_xfs_log_reserve(log, tic); in xfs_log_reserve()
464 error = xlog_grant_head_check(log, &log->l_reserve_head, tic, in xfs_log_reserve()
471 trace_xfs_log_reserve_exit(log, tic); in xfs_log_reserve()
481 tic->t_curr_res = 0; in xfs_log_reserve()
482 tic->t_cnt = 0; /* ungrant will give back unit_res * t_cnt. */ in xfs_log_reserve()
947 struct xlog_ticket *tic = NULL; in xlog_unmount_write() local
950 error = xfs_log_reserve(mp, 600, 1, &tic, XFS_LOG, 0); in xlog_unmount_write()
954 error = xlog_write_unmount_record(log, tic); in xlog_unmount_write()
968 if (tic) { in xlog_unmount_write()
969 trace_xfs_log_umount_write(log, tic); in xlog_unmount_write()
970 xfs_log_ticket_ungrant(log, tic); in xlog_unmount_write()
3611 struct xlog_ticket *tic; in xlog_ticket_alloc() local
3614 tic = kmem_cache_zalloc(xfs_log_ticket_zone, GFP_NOFS | __GFP_NOFAIL); in xlog_ticket_alloc()
3618 atomic_set(&tic->t_ref, 1); in xlog_ticket_alloc()
3619 tic->t_task = current; in xlog_ticket_alloc()
3620 INIT_LIST_HEAD(&tic->t_queue); in xlog_ticket_alloc()
3621 tic->t_unit_res = unit_res; in xlog_ticket_alloc()
3622 tic->t_curr_res = unit_res; in xlog_ticket_alloc()
3623 tic->t_cnt = cnt; in xlog_ticket_alloc()
3624 tic->t_ocnt = cnt; in xlog_ticket_alloc()
3625 tic->t_tid = prandom_u32(); in xlog_ticket_alloc()
3626 tic->t_clientid = client; in xlog_ticket_alloc()
3628 tic->t_flags |= XLOG_TIC_PERM_RESERV; in xlog_ticket_alloc()
3630 xlog_tic_reset_res(tic); in xlog_ticket_alloc()
3632 return tic; in xlog_ticket_alloc()