Lines Matching +full:p +full:- +full:states

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
73 * Below are states for covering allocation transactions.
74 * By covering, we mean changing the h_tail_lsn in the last on-disk
75 * log write such that no allocation transactions will be re-done during
76 * recovery after a system crash. Recovery starts at the last on-disk
79 * These states are used to insert dummy log entries to cover
80 * space allocation transactions which can undo non-transactional changes
93 * non-dummy transaction. The first dummy changes the h_tail_lsn to
100 * There are 5 states used to control this.
102 * IDLE -- no logging has been done on the file system or
104 * NEED -- logging has occurred and we need a dummy transaction
106 * DONE -- we were in the NEED state and have committed a dummy
108 * NEED2 -- we detected that a dummy transaction has gone to the
110 * DONE2 -- we committed a dummy transaction when in the NEED2 state.
112 * There are two places where we switch states:
116 * respectively. In all other states, we don't do anything.
118 * 2.) When we finish writing the on-disk log (xlog_state_clean_log).
122 * So, if we aren't in the DONE or DONE2 states, the next state
136 * This is why we have the NEED2 and DONE2 states before going idle.
161 * In-core log structure.
163 * - ic_forcewait is used to implement synchronous forcing of the iclog to disk.
164 * - ic_next is the pointer to the next iclog in the ring.
165 * - ic_log is a pointer back to the global log structure.
166 * - ic_size is the full size of the log buffer, minus the cycle headers.
167 * - ic_offset is the current number of bytes written to in this iclog.
168 * - ic_refcnt is bumped when someone is writing to the log.
169 * - ic_state is the state of the iclog.
176 * - ic_callbacks
177 * - ic_refcnt
178 * - fields protected by the global l_icloglock
181 * We'll put all the read-only and l_icloglock fields in the first cacheline,
210 * The CIL context is used to aggregate per-transaction details as well be
211 * passed to the iclog for checkpoint post-commit processing. After being
241 * Per-cpu CIL tracking items
333 * CIL is large enough to maintain sufficient in-memory relogging to avoid
337 * issues when we are running low on memory - pinned memory cannot be reclaimed,
344 * - a threshold large enough that it allows CIL to be pushed and progress to be
346 * defined to be 12.5% of the log space - half the 25% push threshold of the
348 * - small enough that it doesn't pin excessive amounts of memory but maintains
364 * Note: this is not a -hard- limit as blocking is applied after the transaction
375 min_t(int, (log)->l_logsize >> 3, BBTOB(XLOG_TOTAL_REC_SHIFT(log)) << 4)
462 return test_bit(XLOG_RECOVERY_NEEDED, &log->l_opstate);
468 return test_bit(XLOG_ACTIVE_RECOVERY, &log->l_opstate);
474 return test_bit(XLOG_IO_ERROR, &log->l_opstate);
485 wait_var_event(&log->l_opstate, xlog_is_shutdown(log));
565 xlog_cil_force_seq(log, log->l_cilp->xc_current_sequence);
589 __releases(iclog->ic_log->l_icloglock);
604 return BBTOB(hi_block - lo_block);
606 return (uint64_t)log->l_logsize - BBTOB(lo_block - hi_block);
639 cur_cycle = READ_ONCE(log->l_curr_cycle);
641 cur_block = READ_ONCE(log->l_curr_block);
650 spin_lock(&log->l_icloglock);
651 cur_cycle = log->l_curr_cycle;
652 cur_block = log->l_curr_block;
653 spin_unlock(&log->l_icloglock);
684 void *p;
689 p = kmalloc(buf_size, flags);
690 if (!p)
691 p = vmalloc(buf_size);
692 } while (!p);
694 return p;
721 return &rhead->h_ext[j - 1].xh_cycle_data[k];
724 return &rhead->h_cycle_data[i];