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 */
127 * Use 2 "tocks" to track the rolling maximum balance of a ledger entry.
150 uint32_t le_max; /* Lower 32-bits of observed max balance */
462 ledger_amount_t balance;
470 balance = le->le_credit - le->le_debit;
471 if ((le->le_warn_level != LEDGER_LIMIT_INFINITY) && (balance > le->le_warn_level))
482 ledger_amount_t balance;
486 balance = le->le_credit - le->le_debit;
487 if ((le->le_limit <= 0) && (balance < le->le_limit))
490 if ((le->le_limit > 0) && (balance > le->le_limit))
534 ledger_amount_t balance, due;
586 balance = le->le_credit - le->le_debit;
588 if (balance - due < 0)
589 due = balance;
602 if (balance == due)
609 lprintf(("Refill %lld %lld->%lld\n", periods, balance, balance - due));
661 ledger_amount_t balance = le->le_credit - le->le_debit;
665 if (!TOCKSTAMP_IS_STALE(now, p->le_time) || (balance > p->le_max)) {
667 * The current balance is greater than the previously
672 * (We only track the lower 32-bits of a balance for rolling
675 p->le_max = (uint32_t)balance;
705 * The balance on the account is below the limit.
716 * the ledger's balance crosses into or out of the warning
721 * This ledger's balance is above the warning level.
734 * This ledger's balance is below the warning level.
741 * know the ledger balance is now back below
777 * Zero the balance of a ledger by adding to its credit or debit, whichever is smaller.
823 * current balance, so the change doesn't affect the thread until the
827 * the balance exceeds this level. Specified as a percentage [of the limit].
883 * Start with the current balance; if neither of the recorded peaks are
893 * is greater than the current balance -- so use it.
1050 * we're resetting the balance to zero here, we consider this
1051 * moment the starting time for accumulating a balance that
1271 * This needs to happen both when the balance rises above
1381 ledger_get_balance(ledger_t ledger, int entry, ledger_amount_t *balance)
1392 *balance = le->le_credit - le->le_debit;