Lines Matching refs:balance

54 #define	LF_CALLED_BACK          0x1000	/* callback was called for balance in deficit */
55 #define LF_WARNED 0x2000 /* callback was called for balance warning */
56 #define LF_TRACKING_MAX 0x4000 /* track max balance over user-specfied time */
128 * Use 2 "tocks" to track the rolling maximum balance of a ledger entry.
151 uint32_t le_max; /* Lower 32-bits of observed max balance */
463 ledger_amount_t balance;
471 balance = le->le_credit - le->le_debit;
472 if ((le->le_warn_level != LEDGER_LIMIT_INFINITY) && (balance > le->le_warn_level))
483 ledger_amount_t balance;
487 balance = le->le_credit - le->le_debit;
488 if ((le->le_limit <= 0) && (balance < le->le_limit))
491 if ((le->le_limit > 0) && (balance > le->le_limit))
535 ledger_amount_t balance, due;
587 balance = le->le_credit - le->le_debit;
589 if (balance - due < 0)
590 due = balance;
603 if (balance == due)
610 lprintf(("Refill %lld %lld->%lld\n", periods, balance, balance - due));
662 ledger_amount_t balance = le->le_credit - le->le_debit;
666 if (!TOCKSTAMP_IS_STALE(now, p->le_time) || (balance > p->le_max)) {
668 * The current balance is greater than the previously
673 * (We only track the lower 32-bits of a balance for rolling
676 p->le_max = (uint32_t)balance;
706 * The balance on the account is below the limit.
717 * the ledger's balance crosses into or out of the warning
722 * This ledger's balance is above the warning level.
735 * This ledger's balance is below the warning level.
742 * know the ledger balance is now back below
753 panic("ledger_check_new_balance(%p,%d): negative ledger %p balance:%lld\n",
789 * otherwise synchronized) may see a bogus balance.
812 * Zero the balance of a ledger by adding to its credit or debit, whichever is smaller.
858 * current balance, so the change doesn't affect the thread until the
862 * the balance exceeds this level. Specified as a percentage [of the limit].
918 * Start with the current balance; if neither of the recorded peaks are
928 * is greater than the current balance -- so use it.
1101 * we're resetting the balance to zero here, we consider this
1102 * moment the starting time for accumulating a balance that
1322 * This needs to happen both when the balance rises above
1462 ledger_get_balance(ledger_t ledger, int entry, ledger_amount_t *balance)
1473 *balance = le->le_credit - le->le_debit;