Lines Matching defs:ticket

72  *     wait on ticket->wait for ->bytes to be reduced to 0, or ->error to be set
73 * on the ticket.
84 * the ticket is woken up.
86 * -> ticket wakeup
94 * space_info->priority_tickets, and we do not use ticket->wait, we simply
431 struct reserve_ticket *ticket)
433 if (!list_empty(&ticket->list)) {
434 list_del_init(&ticket->list);
435 ASSERT(space_info->reclaim_size >= ticket->bytes);
436 space_info->reclaim_size -= ticket->bytes;
455 struct reserve_ticket *ticket;
458 ticket = list_first_entry(head, struct reserve_ticket, list);
460 /* Check and see if our ticket can be satisfied now. */
461 if ((used + ticket->bytes <= space_info->total_bytes) ||
462 btrfs_can_overcommit(fs_info, space_info, ticket->bytes,
466 ticket->bytes);
467 remove_ticket(space_info, ticket);
468 ticket->bytes = 0;
470 wake_up(&ticket->wait);
969 struct reserve_ticket *ticket)
974 if (!ticket->steal)
982 if (global_rsv->reserved < min_bytes + ticket->bytes) {
986 global_rsv->reserved -= ticket->bytes;
987 remove_ticket(space_info, ticket);
988 ticket->bytes = 0;
989 wake_up(&ticket->wait);
1006 * order, so if there is a large ticket first and then smaller ones we could
1011 * other tickets, or if it stumbles across a ticket that was smaller than the
1012 * first ticket.
1017 struct reserve_ticket *ticket;
1030 ticket = list_first_entry(&space_info->tickets,
1033 if (!aborted && steal_from_global_rsv(fs_info, space_info, ticket))
1037 btrfs_info(fs_info, "failing ticket with %llu bytes",
1038 ticket->bytes);
1040 remove_ticket(space_info, ticket);
1042 ticket->error = -EIO;
1044 ticket->error = -ENOSPC;
1045 wake_up(&ticket->wait);
1050 * here to see if we can make progress with the next ticket in
1389 struct reserve_ticket *ticket,
1404 if (ticket->bytes == 0) {
1415 if (ticket->bytes == 0) {
1430 ticket->error = BTRFS_FS_ERROR(fs_info);
1431 remove_ticket(space_info, ticket);
1432 } else if (!steal_from_global_rsv(fs_info, space_info, ticket)) {
1433 ticket->error = -ENOSPC;
1434 remove_ticket(space_info, ticket);
1439 * ticket in front of a smaller ticket that can now be satisfied with
1448 struct reserve_ticket *ticket)
1453 if (ticket->bytes == 0) {
1462 if (ticket->bytes == 0) {
1468 ticket->error = -ENOSPC;
1469 remove_ticket(space_info, ticket);
1476 struct reserve_ticket *ticket)
1483 while (ticket->bytes > 0 && ticket->error == 0) {
1484 ret = prepare_to_wait_event(&ticket->wait, &wait, TASK_KILLABLE);
1489 * space for this ticket. If that would happen, then the
1490 * ticket's task would not known that space was reserved
1494 remove_ticket(space_info, ticket);
1495 ticket->error = -EINTR;
1502 finish_wait(&ticket->wait, &wait);
1509 * Do the appropriate flushing and waiting for a ticket.
1513 * @ticket: ticket for the reservation
1518 * This does the work of figuring out how to flush for the ticket, waiting for
1523 struct reserve_ticket *ticket,
1533 wait_reserve_ticket(fs_info, space_info, ticket);
1536 priority_reclaim_metadata_space(fs_info, space_info, ticket,
1541 priority_reclaim_metadata_space(fs_info, space_info, ticket,
1546 priority_reclaim_data_space(fs_info, space_info, ticket);
1553 ret = ticket->error;
1554 ASSERT(list_empty(&ticket->list));
1561 ASSERT(!(ticket->bytes == 0 && ticket->error));
1563 start_ns, flush, ticket->error);
1602 * NO_FLUSH and FLUSH_EMERGENCY don't want to create a ticket, they just want to
1631 struct reserve_ticket ticket;
1697 * If we couldn't make a reservation then setup our reservation ticket
1700 * If we are a priority flusher then we just need to add our ticket to
1704 ticket.bytes = orig_bytes;
1705 ticket.error = 0;
1706 space_info->reclaim_size += ticket.bytes;
1707 init_waitqueue_head(&ticket.wait);
1708 ticket.steal = can_steal(flush);
1715 list_add_tail(&ticket.list, &space_info->tickets);
1718 * We were forced to add a reserve ticket, so
1734 list_add_tail(&ticket.list,
1756 return handle_reserve_ticket(fs_info, space_info, &ticket, start_ns,