Lines Matching refs:tic

162 	struct xlog_ticket	*tic;  in xlog_grant_head_wake_all()  local
165 list_for_each_entry(tic, &head->waiters, t_queue) in xlog_grant_head_wake_all()
166 wake_up_process(tic->t_task); in xlog_grant_head_wake_all()
174 struct xlog_ticket *tic) in xlog_ticket_reservation() argument
177 ASSERT(tic->t_flags & XLOG_TIC_PERM_RESERV); in xlog_ticket_reservation()
178 return tic->t_unit_res; in xlog_ticket_reservation()
180 if (tic->t_flags & XLOG_TIC_PERM_RESERV) in xlog_ticket_reservation()
181 return tic->t_unit_res * tic->t_cnt; in xlog_ticket_reservation()
183 return tic->t_unit_res; in xlog_ticket_reservation()
193 struct xlog_ticket *tic; in xlog_grant_head_wake() local
197 list_for_each_entry(tic, &head->waiters, t_queue) { in xlog_grant_head_wake()
220 need_bytes = xlog_ticket_reservation(log, head, tic); in xlog_grant_head_wake()
228 trace_xfs_log_grant_wake_up(log, tic); in xlog_grant_head_wake()
229 wake_up_process(tic->t_task); in xlog_grant_head_wake()
240 struct xlog_ticket *tic, in xlog_grant_head_wait() argument
244 list_add_tail(&tic->t_queue, &head->waiters); in xlog_grant_head_wait()
256 trace_xfs_log_grant_sleep(log, tic); in xlog_grant_head_wait()
258 trace_xfs_log_grant_wake(log, tic); in xlog_grant_head_wait()
265 list_del_init(&tic->t_queue); in xlog_grant_head_wait()
268 list_del_init(&tic->t_queue); in xlog_grant_head_wait()
293 struct xlog_ticket *tic, in xlog_grant_head_check() argument
307 *need_bytes = xlog_ticket_reservation(log, head, tic); in xlog_grant_head_check()
313 error = xlog_grant_head_wait(log, head, tic, in xlog_grant_head_check()
319 error = xlog_grant_head_wait(log, head, tic, *need_bytes); in xlog_grant_head_check()
327 xlog_tic_reset_res(xlog_ticket_t *tic) in xlog_tic_reset_res() argument
329 tic->t_res_num = 0; in xlog_tic_reset_res()
330 tic->t_res_arr_sum = 0; in xlog_tic_reset_res()
331 tic->t_res_num_ophdrs = 0; in xlog_tic_reset_res()
335 xlog_tic_add_region(xlog_ticket_t *tic, uint len, uint type) in xlog_tic_add_region() argument
337 if (tic->t_res_num == XLOG_TIC_LEN_MAX) { in xlog_tic_add_region()
339 tic->t_res_o_flow += tic->t_res_arr_sum; in xlog_tic_add_region()
340 tic->t_res_num = 0; in xlog_tic_add_region()
341 tic->t_res_arr_sum = 0; in xlog_tic_add_region()
344 tic->t_res_arr[tic->t_res_num].r_len = len; in xlog_tic_add_region()
345 tic->t_res_arr[tic->t_res_num].r_type = type; in xlog_tic_add_region()
346 tic->t_res_arr_sum += len; in xlog_tic_add_region()
347 tic->t_res_num++; in xlog_tic_add_region()
375 struct xlog_ticket *tic) in xfs_log_regrant() argument
392 tic->t_tid++; in xfs_log_regrant()
394 xlog_grant_push_ail(log, tic->t_unit_res); in xfs_log_regrant()
396 tic->t_curr_res = tic->t_unit_res; in xfs_log_regrant()
397 xlog_tic_reset_res(tic); in xfs_log_regrant()
399 if (tic->t_cnt > 0) in xfs_log_regrant()
402 trace_xfs_log_regrant(log, tic); in xfs_log_regrant()
404 error = xlog_grant_head_check(log, &log->l_write_head, tic, in xfs_log_regrant()
410 trace_xfs_log_regrant_exit(log, tic); in xfs_log_regrant()
420 tic->t_curr_res = 0; in xfs_log_regrant()
421 tic->t_cnt = 0; /* ungrant will give back unit_res * t_cnt. */ in xfs_log_regrant()
443 struct xlog_ticket *tic; in xfs_log_reserve() local
455 tic = xlog_ticket_alloc(log, unit_bytes, cnt, client, permanent); in xfs_log_reserve()
456 *ticp = tic; in xfs_log_reserve()
458 xlog_grant_push_ail(log, tic->t_cnt ? tic->t_unit_res * tic->t_cnt in xfs_log_reserve()
459 : tic->t_unit_res); in xfs_log_reserve()
461 trace_xfs_log_reserve(log, tic); in xfs_log_reserve()
463 error = xlog_grant_head_check(log, &log->l_reserve_head, tic, in xfs_log_reserve()
470 trace_xfs_log_reserve_exit(log, tic); in xfs_log_reserve()
480 tic->t_curr_res = 0; in xfs_log_reserve()
481 tic->t_cnt = 0; /* ungrant will give back unit_res * t_cnt. */ in xfs_log_reserve()
851 struct xlog_ticket *tic = NULL; in xlog_unmount_write() local
856 error = xfs_log_reserve(mp, 600, 1, &tic, XFS_LOG, 0); in xlog_unmount_write()
860 error = xlog_write_unmount_record(log, tic, &lsn, flags); in xlog_unmount_write()
880 if (tic) { in xlog_unmount_write()
881 trace_xfs_log_umount_write(log, tic); in xlog_unmount_write()
882 xfs_log_ticket_ungrant(log, tic); in xlog_unmount_write()
3447 struct xlog_ticket *tic; in xlog_ticket_alloc() local
3450 tic = kmem_cache_zalloc(xfs_log_ticket_zone, GFP_NOFS | __GFP_NOFAIL); in xlog_ticket_alloc()
3454 atomic_set(&tic->t_ref, 1); in xlog_ticket_alloc()
3455 tic->t_task = current; in xlog_ticket_alloc()
3456 INIT_LIST_HEAD(&tic->t_queue); in xlog_ticket_alloc()
3457 tic->t_unit_res = unit_res; in xlog_ticket_alloc()
3458 tic->t_curr_res = unit_res; in xlog_ticket_alloc()
3459 tic->t_cnt = cnt; in xlog_ticket_alloc()
3460 tic->t_ocnt = cnt; in xlog_ticket_alloc()
3461 tic->t_tid = prandom_u32(); in xlog_ticket_alloc()
3462 tic->t_clientid = client; in xlog_ticket_alloc()
3464 tic->t_flags |= XLOG_TIC_PERM_RESERV; in xlog_ticket_alloc()
3466 xlog_tic_reset_res(tic); in xlog_ticket_alloc()
3468 return tic; in xlog_ticket_alloc()