Lines Matching refs:ticket

73  *     wait on ticket->wait for ->bytes to be reduced to 0, or ->error to be set
74 * on the ticket.
85 * the ticket is woken up.
87 * -> ticket wakeup
95 * space_info->priority_tickets, and we do not use ticket->wait, we simply
400 struct reserve_ticket *ticket)
402 if (!list_empty(&ticket->list)) {
403 list_del_init(&ticket->list);
404 ASSERT(space_info->reclaim_size >= ticket->bytes);
405 space_info->reclaim_size -= ticket->bytes;
424 struct reserve_ticket *ticket;
427 ticket = list_first_entry(head, struct reserve_ticket, list);
429 /* Check and see if our ticket can be satisfied now. */
430 if ((used + ticket->bytes <= space_info->total_bytes) ||
431 btrfs_can_overcommit(fs_info, space_info, ticket->bytes,
435 ticket->bytes);
436 remove_ticket(space_info, ticket);
437 ticket->bytes = 0;
439 wake_up(&ticket->wait);
951 struct reserve_ticket *ticket)
956 if (!ticket->steal)
964 if (global_rsv->reserved < min_bytes + ticket->bytes) {
968 global_rsv->reserved -= ticket->bytes;
969 remove_ticket(space_info, ticket);
970 ticket->bytes = 0;
971 wake_up(&ticket->wait);
987 * order, so if there is a large ticket first and then smaller ones we could
992 * other tickets, or if it stumbles across a ticket that was smaller than the
993 * first ticket.
998 struct reserve_ticket *ticket;
1011 ticket = list_first_entry(&space_info->tickets,
1014 if (!aborted && steal_from_global_rsv(fs_info, space_info, ticket))
1018 btrfs_info(fs_info, "failing ticket with %llu bytes",
1019 ticket->bytes);
1021 remove_ticket(space_info, ticket);
1023 ticket->error = -EIO;
1025 ticket->error = -ENOSPC;
1026 wake_up(&ticket->wait);
1031 * here to see if we can make progress with the next ticket in
1370 struct reserve_ticket *ticket,
1385 if (ticket->bytes == 0) {
1396 if (ticket->bytes == 0) {
1411 ticket->error = BTRFS_FS_ERROR(fs_info);
1412 remove_ticket(space_info, ticket);
1413 } else if (!steal_from_global_rsv(fs_info, space_info, ticket)) {
1414 ticket->error = -ENOSPC;
1415 remove_ticket(space_info, ticket);
1420 * ticket in front of a smaller ticket that can now be satisfied with
1429 struct reserve_ticket *ticket)
1434 if (ticket->bytes == 0) {
1443 if (ticket->bytes == 0) {
1449 ticket->error = -ENOSPC;
1450 remove_ticket(space_info, ticket);
1457 struct reserve_ticket *ticket)
1464 while (ticket->bytes > 0 && ticket->error == 0) {
1465 ret = prepare_to_wait_event(&ticket->wait, &wait, TASK_KILLABLE);
1470 * space for this ticket. If that would happen, then the
1471 * ticket's task would not known that space was reserved
1475 remove_ticket(space_info, ticket);
1476 ticket->error = -EINTR;
1483 finish_wait(&ticket->wait, &wait);
1490 * Do the appropriate flushing and waiting for a ticket.
1494 * @ticket: ticket for the reservation
1499 * This does the work of figuring out how to flush for the ticket, waiting for
1504 struct reserve_ticket *ticket,
1514 wait_reserve_ticket(fs_info, space_info, ticket);
1517 priority_reclaim_metadata_space(fs_info, space_info, ticket,
1522 priority_reclaim_metadata_space(fs_info, space_info, ticket,
1527 priority_reclaim_data_space(fs_info, space_info, ticket);
1534 ret = ticket->error;
1535 ASSERT(list_empty(&ticket->list));
1542 ASSERT(!(ticket->bytes == 0 && ticket->error));
1544 start_ns, flush, ticket->error);
1583 * NO_FLUSH and FLUSH_EMERGENCY don't want to create a ticket, they just want to
1612 struct reserve_ticket ticket;
1678 * If we couldn't make a reservation then setup our reservation ticket
1681 * If we are a priority flusher then we just need to add our ticket to
1685 ticket.bytes = orig_bytes;
1686 ticket.error = 0;
1687 space_info->reclaim_size += ticket.bytes;
1688 init_waitqueue_head(&ticket.wait);
1689 ticket.steal = can_steal(flush);
1696 list_add_tail(&ticket.list, &space_info->tickets);
1699 * We were forced to add a reserve ticket, so
1715 list_add_tail(&ticket.list,
1737 return handle_reserve_ticket(fs_info, space_info, &ticket, start_ns,