• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/fs/xfs/

Lines Matching defs:log

22 struct log;
28 * Macros, structures, prototypes for internal log manager use.
44 #define XLOG_BTOLSUNIT(log, b) (((b)+(log)->l_mp->m_sb.sb_logsunit-1) / \
45 (log)->l_mp->m_sb.sb_logsunit)
46 #define XLOG_LSUNITTOB(log, su) ((su) * (log)->l_mp->m_sb.sb_logsunit)
50 #define XLOG_REC_SHIFT(log) \
51 BTOBB(1 << (xfs_sb_version_haslogv2(&log->l_mp->m_sb) ? \
53 #define XLOG_TOTAL_REC_SHIFT(log) \
54 BTOBB(XLOG_MAX_ICLOGS << (xfs_sb_version_haslogv2(&log->l_mp->m_sb) ? \
97 * In core log state
99 #define XLOG_STATE_ACTIVE 0x0001 /* Current IC log being written to */
101 #define XLOG_STATE_SYNCING 0x0004 /* This IC log is syncing */
106 #define XLOG_STATE_DIRTY 0x0040 /* Dirty IC log, not ready for ACTIVE status*/
107 #define XLOG_STATE_IOERROR 0x0080 /* IO error happened in sync'ing log */
109 #define XLOG_STATE_NOTUSED 0x8000 /* This IC log not being used */
113 * Flags to log operation header
118 * the remainder of the current active in-core log, it is split up into
132 * Flags to log ticket
148 * Flags for log structure
152 #define XLOG_RECOVERY_NEEDED 0x4 /* log was recovered */
153 #define XLOG_IO_ERROR 0x8 /* log hit an I/O error, and being
160 * log write such that no allocation transactions will be re-done during
162 * log write.
164 * These states are used to insert dummy log entries to cover
177 * in the log record header needs to point beyond the last possible
190 * when the log becomes idle.
194 * on disk log with no other transactions.
199 * 1.) In xfs_sync, when we detect an idle log and are in NEED or NEED2.
203 * 2.) When we finish writing the on-disk log (xlog_state_clean_log).
219 * one file space allocation. When this happens, the log recovery
294 __be32 h_magicno; /* log record (LR) identifier : 4 */
295 __be32 h_cycle; /* write cycle of log : 4 */
302 __be32 h_num_logops; /* number of log operations in this LR : 4 */
305 __be32 h_fmt; /* format of log record : 4 */
311 __be32 xh_cycle; /* write cycle of log : 4 */
318 * Quite misnamed, because this union lays out the actual on-disk log buffer.
327 * - A log record header is 512 bytes. There is plenty of room to grow the
333 * - ic_bp is a pointer to the buffer used to write this incore log to disk.
334 * - ic_log is a pointer back to the global log structure.
339 * - ic_refcnt is bumped when someone is writing to the log.
361 struct log *ic_log;
404 * This structure is used to track log items that have been committed but not
405 * yet written into the log. It is used only when the delayed logging mount
418 struct log *xc_log;
429 * The amount of log space we allow the CIL to aggregate is difficult to size.
431 * log space effectively, that it is large enough to capture sufficient
432 * relogging to reduce log buffer IO significantly, but it is not too large for
433 * the log or induces too much latency when writing out through the iclogs. We
437 * Every log buffer we write out during a push needs a header reserved, which
439 * at least 512 bytes per 32k of log space just for the LR headers. That means
444 * limit space consumed in the log rather than by the number of objects being
447 * Further, use of static reservations through the log grant mechanism is
450 * can block on log pushes. Hence if we have to regrant log space during a log
464 * Recovery imposes a rule that no transaction exceed half the log, so we are
465 * limited by that. Furthermore, the log transaction reservation subsystem
466 * tries to keep 25% of the log free, so we need to keep below that limit or we
467 * risk running out of free log space to start any new transactions.
475 #define XLOG_CIL_SPACE_LIMIT(log) (log->l_logsize >> 3)
476 #define XLOG_CIL_HARD_SPACE_LIMIT(log) (3 * (log->l_logsize >> 4))
484 typedef struct log {
487 struct xfs_ail *l_ailp; /* AIL log is working with */
488 struct xfs_cil *l_cilp; /* CIL log is working with */
489 struct xfs_buf *l_xbuf; /* extra buffer for log
491 struct xfs_buftarg *l_targ; /* buftarg of log */
498 int l_iclog_size; /* size of log in bytes */
499 int l_iclog_size_log; /* log power size of log */
501 xfs_daddr_t l_logBBstart; /* start block of log */
502 int l_logsize; /* size of log in bytes */
503 int l_logBBsize; /* size of log in BB chunks */
509 * log entries" */
510 xlog_in_core_t *l_iclog; /* head log queue */
515 int l_curr_cycle; /* Cycle number of log writes */
518 int l_curr_block; /* current logical log block */
519 int l_prev_block; /* previous logical log block */
537 #define XLOG_FORCED_SHUTDOWN(log) ((log)->l_flags & XLOG_IO_ERROR)
541 extern int xlog_recover(xlog_t *log);
542 extern int xlog_recover_finish(xlog_t *log);
543 extern void xlog_pack_data(xlog_t *log, xlog_in_core_t *iclog, int);
546 struct xlog_ticket *xlog_ticket_alloc(struct log *log, int unit_bytes,
560 int xlog_write(struct log *log, struct xfs_log_vec *log_vector,
567 int xlog_cil_init(struct log *log);
568 void xlog_cil_init_post_recovery(struct log *log);
569 void xlog_cil_destroy(struct log *log);
574 xfs_lsn_t xlog_cil_force_lsn(struct log *log, xfs_lsn_t sequence);
577 xlog_cil_force(struct log *log)
579 xlog_cil_force_lsn(log, log->l_cilp->xc_current_sequence);