Lines Matching defs:log
15 * Flags for log structure
18 #define XLOG_RECOVERY_NEEDED 0x4 /* log was recovered */
19 #define XLOG_IO_ERROR 0x8 /* log hit an I/O error, and being
21 #define XLOG_TAIL_WARN 0x10 /* log tail verify warning issued */
41 * In core log state
44 XLOG_STATE_ACTIVE, /* Current IC log being written to */
46 XLOG_STATE_SYNCING, /* This IC log is syncing */
49 XLOG_STATE_DIRTY, /* Dirty IC log, not ready for ACTIVE status */
50 XLOG_STATE_IOERROR, /* IO error happened in sync'ing log */
64 * log write such that no allocation transactions will be re-done during
66 * log write.
68 * These states are used to insert dummy log entries to cover
81 * in the log record header needs to point beyond the last possible
94 * when the log becomes idle.
98 * on disk log with no other transactions.
103 * 1.) In xfs_sync, when we detect an idle log and are in NEED or NEED2.
107 * 2.) When we finish writing the on-disk log (xlog_state_clean_log).
123 * one file space allocation. When this happens, the log recovery
170 * - A log record header is 512 bytes. There is plenty of room to grow the
176 * - ic_log is a pointer back to the global log structure.
177 * - ic_size is the full size of the log buffer, minus the cycle headers.
179 * - ic_refcnt is bumped when someone is writing to the log.
249 * This structure is used to track log items that have been committed but not
250 * yet written into the log. It is used only when the delayed logging mount
280 * The amount of log space we allow the CIL to aggregate is difficult to size.
282 * log space effectively, that it is large enough to capture sufficient
283 * relogging to reduce log buffer IO significantly, but it is not too large for
284 * the log or induces too much latency when writing out through the iclogs. We
288 * Every log buffer we write out during a push needs a header reserved, which
290 * at least 512 bytes per 32k of log space just for the LR headers. That means
295 * limit space consumed in the log rather than by the number of objects being
298 * Further, use of static reservations through the log grant mechanism is
301 * can block on log pushes. Hence if we have to regrant log space during a log
315 * Recovery imposes a rule that no transaction exceed half the log, so we are
316 * limited by that. Furthermore, the log transaction reservation subsystem
317 * tries to keep 25% of the log free, so we need to keep below that limit or we
318 * risk running out of free log space to start any new transactions.
323 * to grow to a substantial fraction of the log, then we may be pinning hundreds
334 * defined to be 12.5% of the log space - half the 25% push threshold of the
362 #define XLOG_CIL_SPACE_LIMIT(log) \
363 min_t(int, (log)->l_logsize >> 3, BBTOB(XLOG_TOTAL_REC_SHIFT(log)) << 4)
365 #define XLOG_CIL_BLOCKING_SPACE_LIMIT(log) \
366 (XLOG_CIL_SPACE_LIMIT(log) * 2)
387 struct xfs_ail *l_ailp; /* AIL log is working with */
388 struct xfs_cil *l_cilp; /* CIL log is working with */
389 struct xfs_buftarg *l_targ; /* buftarg of log */
398 int l_iclog_size; /* size of log in bytes */
400 xfs_daddr_t l_logBBstart; /* start block of log */
401 int l_logsize; /* size of log in bytes */
402 int l_logBBsize; /* size of log in BB chunks */
408 * log entries" */
409 xlog_in_core_t *l_iclog; /* head log queue */
411 int l_curr_cycle; /* Cycle number of log writes */
414 int l_curr_block; /* current logical log block */
415 int l_prev_block; /* previous logical log block */
437 /* log recovery lsn tracking (for buffer submission */
441 #define XLOG_BUF_CANCEL_BUCKET(log, blkno) \
442 ((log)->l_buf_cancel_table + ((uint64_t)blkno % XLOG_BC_TABLE_SIZE))
444 #define XLOG_FORCED_SHUTDOWN(log) \
445 (unlikely((log)->l_flags & XLOG_IO_ERROR))
450 struct xlog *log);
453 struct xlog *log);
457 extern __le32 xlog_cksum(struct xlog *log, struct xlog_rec_header *rhead,
463 struct xlog *log,
479 int xlog_write(struct xlog *log, struct xfs_log_vec *log_vector,
483 int xlog_commit_record(struct xlog *log, struct xlog_ticket *ticket,
485 void xfs_log_ticket_ungrant(struct xlog *log, struct xlog_ticket *ticket);
486 void xfs_log_ticket_regrant(struct xlog *log, struct xlog_ticket *ticket);
546 int xlog_cil_init(struct xlog *log);
547 void xlog_cil_init_post_recovery(struct xlog *log);
548 void xlog_cil_destroy(struct xlog *log);
549 bool xlog_cil_empty(struct xlog *log);
550 void xlog_cil_commit(struct xlog *log, struct xfs_trans *tp,
556 xfs_lsn_t xlog_cil_force_seq(struct xlog *log, xfs_csn_t sequence);
559 xlog_cil_force(struct xlog *log)
561 xlog_cil_force_seq(log, log->l_cilp->xc_current_sequence);
567 * log code.
586 * means that the next log record that includes this metadata could have a
587 * smaller LSN. In turn, this means that the modification in the log would not
592 struct xlog *log,
611 cur_cycle = READ_ONCE(log->l_curr_cycle);
613 cur_block = READ_ONCE(log->l_curr_block);
619 * above raced with a wrap to the next log cycle. Grab the lock
622 spin_lock(&log->l_icloglock);
623 cur_cycle = log->l_curr_cycle;
624 cur_block = log->l_curr_block;
625 spin_unlock(&log->l_icloglock);