• 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

52 #define	xlog_recover_check_summary(log)
61 * to specify for an operation involving the given XFS log buffer.
67 xlog_t *log,
70 return bbcount > 0 && bbcount <= log->l_logBBsize;
74 * Allocate a buffer to hold log data. The buffer needs to be able
76 * block) offset within the log.
80 xlog_t *log,
83 if (!xlog_buf_bbcount_valid(log, nbblks)) {
86 XFS_ERROR_REPORT(__func__, XFS_ERRLEVEL_HIGH, log->l_mp);
91 * We do log I/O in units of log sectors (a power-of-2
94 * for complete log sectors.
101 * an issue. Nor will this be a problem if the log I/O is
103 * extend the buffer by one extra log sector to ensure
106 if (nbblks > 1 && log->l_sectBBsize > 1)
107 nbblks += log->l_sectBBsize;
108 nbblks = round_up(nbblks, log->l_sectBBsize);
110 return xfs_buf_get_noaddr(BBTOB(nbblks), log->l_mp->m_logdev_targp);
122 * in a log buffer. The buffer covers a log sector-aligned region.
126 xlog_t *log,
131 xfs_daddr_t offset = blk_no & ((xfs_daddr_t)log->l_sectBBsize - 1);
143 xlog_t *log,
150 if (!xlog_buf_bbcount_valid(log, nbblks)) {
153 XFS_ERROR_REPORT(__func__, XFS_ERRLEVEL_HIGH, log->l_mp);
157 blk_no = round_down(blk_no, log->l_sectBBsize);
158 nbblks = round_up(nbblks, log->l_sectBBsize);
163 XFS_BUF_SET_ADDR(bp, log->l_logBBstart + blk_no);
167 XFS_BUF_SET_TARGET(bp, log->l_mp->m_logdev_targp);
169 xfsbdstrat(log->l_mp, bp);
172 xfs_ioerror_alert("xlog_bread", log->l_mp,
179 xlog_t *log,
187 error = xlog_bread_noalign(log, blk_no, nbblks, bp);
191 *offset = xlog_align(log, blk_no, nbblks, bp);
198 * This can only be used for synchronous log writes.
202 xlog_t *log,
209 if (!xlog_buf_bbcount_valid(log, nbblks)) {
212 XFS_ERROR_REPORT(__func__, XFS_ERRLEVEL_HIGH, log->l_mp);
216 blk_no = round_down(blk_no, log->l_sectBBsize);
217 nbblks = round_up(nbblks, log->l_sectBBsize);
222 XFS_BUF_SET_ADDR(bp, log->l_logBBstart + blk_no);
228 XFS_BUF_SET_TARGET(bp, log->l_mp->m_logdev_targp);
230 if ((error = xfs_bwrite(log->l_mp, bp)))
231 xfs_ioerror_alert("xlog_bwrite", log->l_mp,
238 * dump debug superblock and log record information
247 cmn_err(CE_DEBUG, " log : uuid = %pU, fmt = %d\n",
255 * check log record header for recovery
267 * a dirty log created in IRIX.
271 "XFS: dirty log written in incompatible format - can't recover");
278 "XFS: dirty log entry has mismatched uuid - can't recover");
288 * read the head block of the log and check the header
300 * h_fs_uuid is nil, we assume this log was last mounted
303 xlog_warn("XFS: nil uuid in log - IRIX style log");
305 xlog_warn("XFS: log has mismatched uuid - can't recover");
334 * log which contains the given cycle. It uses a binary search algorithm.
340 xlog_t *log,
355 error = xlog_bread(log, mid_blk, 1, bp, &offset);
383 xlog_t *log,
400 * a log sector, or we're out of luck.
403 while (!(bp = xlog_get_bp(log, bufblks))) {
405 if (bufblks < log->l_sectBBsize)
414 error = xlog_bread(log, i, bcount, bp, &buf);
437 * Potentially backup over partial log record write.
440 * a good log record. Therefore, we subtract one to get the block number
443 * last log record is split over the end of the physical log.
450 xlog_t *log,
466 if (!(bp = xlog_get_bp(log, num_blks))) {
467 if (!(bp = xlog_get_bp(log, 1)))
471 error = xlog_bread(log, start_blk, num_blks, bp, &offset);
479 /* valid log record not found */
488 error = xlog_bread(log, i, 1, bp, &offset);
503 * We hit the beginning of the physical log & still no header. Return
505 * will be called again for the end of the physical log.
513 * We have the final block of the good log (the first block
514 * of the log record _before_ the head. So we check the uuid.
516 if ((error = xlog_header_check_mount(log->l_mp, head)))
520 * We may have found a log record header before we expected one.
522 * up reading an entire log record. In this case, we don't want to
523 * reset last_blk. Only when last_blk points in the middle of a log
526 if (xfs_sb_version_haslogv2(&log->l_mp->m_sb)) {
546 * Head is defined to be the point of the log where the next log write
550 * current cycle number -1 won't be present in the log if we start writing
560 xlog_t *log,
569 int error, log_bbnum = log->l_logBBsize;
571 /* Is the end of the log device zeroed? */
572 if ((error = xlog_find_zeroed(log, &first_blk)) == -1) {
579 * log so we can store the uuid in there
581 xlog_warn("XFS: totally zeroed log");
586 xlog_warn("XFS: empty log check failed");
591 bp = xlog_get_bp(log, 1);
595 error = xlog_bread(log, 0, 1, bp, &offset);
602 error = xlog_bread(log, last_blk, 1, bp, &offset);
611 * then the entire log is stamped with the same cycle number. In this
622 * In this case we believe that the entire log should have
632 * log, as one of the latest writes at the beginning was
638 * end of the log.
640 * In the 256k log case, we will read from the beginning to the
641 * end of the log and search for cycle numbers equal to x-1.
643 * because we know that they cannot be the head since the log
651 * number matching last_half_cycle. We expect the log to be
660 * the log, then we look for occurrences of last_half_cycle - 1
661 * at the end of the log. The cases we're looking for look
672 if ((error = xlog_find_cycle_start(log, bp, first_blk,
681 * in the in-core log. The following number can be made tighter if
684 num_scan_bblks = XLOG_TOTAL_REC_SHIFT(log);
691 if ((error = xlog_find_verify_cycle(log,
697 } else { /* need to read 2 parts of log */
699 * We are going to scan backwards in the log in two parts.
700 * First we scan the physical end of the log. In this part
701 * of the log, we are looking for blocks with cycle number
703 * If we find one, then we know that the log starts there, as
705 * the end of the physical log. The simple case for this is
708 * If all of the blocks at the end of the log have cycle number
710 * the log looking for occurrences of last_half_cycle. If we
720 * In a 256k log, the scan at the end of the log will see the
722 * certainly not the head of the log. By searching for
728 if ((error = xlog_find_verify_cycle(log, start_blk,
738 * Scan beginning of log now. The last part of the physical
739 * log is good. This scan needs to verify that it doesn't find
744 if ((error = xlog_find_verify_cycle(log,
755 * the middle of a log record.
757 num_scan_bblks = XLOG_REC_SHIFT(log);
762 if ((error = xlog_find_verify_log_record(log, start_blk,
771 if ((error = xlog_find_verify_log_record(log, start_blk,
773 /* We hit the beginning of the log during our search */
779 if ((error = xlog_find_verify_log_record(log,
809 xlog_warn("XFS: failed to find log head");
814 * Find the sync block number or the tail of the log.
817 * associated buffers synced to disk. Every log record header has
820 * log record header to believe.
822 * The following algorithm uses the log record header with the largest
823 * lsn. The entire log record does not need to be valid. We only care
831 xlog_t *log,
848 * Find previous log record
850 if ((error = xlog_find_head(log, head_blk)))
853 bp = xlog_get_bp(log, 1);
857 error = xlog_bread(log, 0, 1, bp, &offset);
863 /* leave all other log inited values alone */
869 * Search backwards looking for log record header block
873 error = xlog_bread(log, i, 1, bp, &offset);
883 * If we haven't found the log record header block, start looking
884 * again from the end of the physical log. XXXmiken: There should be
889 for (i = log->l_logBBsize - 1; i >= (int)(*head_blk); i--) {
890 error = xlog_bread(log, i, 1, bp, &offset);
907 /* find blk_no of tail of log */
912 * Reset log values according to the state of the log when we
915 * continuing the cycle of the last good log record. At this
916 * point we have guaranteed that all partial log records have been
917 * accounted for. Therefore, we know that the last good log record
919 * of the physical log.
921 log->l_prev_block = i;
922 log->l_curr_block = (int)*head_blk;
923 log->l_curr_cycle = be32_to_cpu(rhead->h_cycle);
925 log->l_curr_cycle++;
926 log->l_tail_lsn = be64_to_cpu(rhead->h_tail_lsn);
927 log->l_last_sync_lsn = be64_to_cpu(rhead->h_lsn);
928 log->l_grant_reserve_cycle = log->l_curr_cycle;
929 log->l_grant_reserve_bytes = BBTOB(log->l_curr_block);
930 log->l_grant_write_cycle = log->l_curr_cycle;
931 log->l_grant_write_bytes = BBTOB(log->l_curr_block);
936 * the physical log, we convert to a log block before comparing
944 if (xfs_sb_version_haslogv2(&log->l_mp->m_sb)) {
960 BTOBB(be32_to_cpu(rhead->h_len))) % log->l_logBBsize;
961 tail_lsn = log->l_tail_lsn;
964 umount_data_blk = (i + hblks) % log->l_logBBsize;
965 error = xlog_bread(log, umount_data_blk, 1, bp, &offset);
973 * log records will point recovery to after the
976 log->l_tail_lsn =
977 xlog_assign_lsn(log->l_curr_cycle,
979 log->l_last_sync_lsn =
980 xlog_assign_lsn(log->l_curr_cycle,
990 log->l_mp->m_flags |= XFS_MOUNT_WAS_CLEAN;
997 * because we allow multiple outstanding log writes concurrently,
1013 if (!xfs_readonly_buftarg(log->l_mp->m_logdev_targp))
1014 error = xlog_clear_stale_blocks(log, tail_lsn);
1020 xlog_warn("XFS: failed to locate log tail");
1025 * Is the log zeroed at all?
1031 * If the log is partially zeroed, this routine will pass back the blkno
1036 * 0 => the log is completely written to
1037 * -1 => use *blk_no as the first block of the log
1042 xlog_t *log,
1050 int error, log_bbnum = log->l_logBBsize;
1054 /* check totally zeroed log */
1055 bp = xlog_get_bp(log, 1);
1058 error = xlog_bread(log, 0, 1, bp, &offset);
1063 if (first_cycle == 0) { /* completely zeroed log */
1069 /* check partially zeroed log */
1070 error = xlog_bread(log, log_bbnum-1, 1, bp, &offset);
1075 if (last_cycle != 0) { /* log completely written to */
1082 * not looking at a log... Bail out.
1084 xlog_warn("XFS: Log inconsistent or not a log (last==0, first!=1)");
1088 /* we have a partially zeroed log */
1090 if ((error = xlog_find_cycle_start(log, bp, 0, &last_blk, 0)))
1095 * the entire log is made up of log records which are the same size,
1099 num_scan_bblks = XLOG_TOTAL_REC_SHIFT(log);
1112 if ((error = xlog_find_verify_cycle(log, start_blk,
1119 * Potentially backup over partial log record write. We don't need
1120 * to search the end of the log because we know it is zero.
1122 if ((error = xlog_find_verify_log_record(log, start_blk,
1139 * to initialize a buffer full of empty log record headers and write
1140 * them into the log.
1144 xlog_t *log,
1157 xfs_sb_version_haslogv2(&log->l_mp->m_sb) ? 2 : 1);
1161 memcpy(&recp->h_fs_uuid, &log->l_mp->m_sb.sb_uuid, sizeof(uuid_t));
1166 xlog_t *log,
1176 int sectbb = log->l_sectBBsize;
1186 * log sector, or we're out of luck.
1189 while (!(bp = xlog_get_bp(log, bufblks))) {
1201 error = xlog_bread_noalign(log, start_block, 1, bp);
1227 error = xlog_bread_noalign(log, ealign, sectbb, bp);
1236 offset = xlog_align(log, start_block, endcount, bp);
1238 xlog_add_record(log, offset, cycle, i+j,
1242 error = xlog_bwrite(log, start_block, endcount, bp);
1255 * This routine is called to blow away any incomplete log writes out
1256 * in front of the log head. We do this so that we won't become confused
1258 * If we leave the partial log records out there, this situation could
1261 * with empty log records with the old cycle number rather than the
1265 * the log so that we will not write over the unmount record after a
1266 * clean unmount in a 512 block log. Doing so would leave the log without
1267 * any valid log records in it until a new one was written. If we crashed
1272 xlog_t *log,
1283 head_cycle = log->l_curr_cycle;
1284 head_block = log->l_curr_block;
1287 * Figure out the distance between the new head of the log
1290 * we don't want to overwrite the tail of the log.
1294 * The tail is behind the head in the physical log,
1296 * distance from the head to the end of the log plus
1297 * the distance from the beginning of the log to the
1300 if (unlikely(head_block < tail_block || head_block >= log->l_logBBsize)) {
1302 XFS_ERRLEVEL_LOW, log->l_mp);
1305 tail_distance = tail_block + (log->l_logBBsize - head_block);
1308 * The head is behind the tail in the physical log,
1314 XFS_ERRLEVEL_LOW, log->l_mp);
1329 max_distance = XLOG_TOTAL_REC_SHIFT(log);
1339 if ((head_block + max_distance) <= log->l_logBBsize) {
1342 * wrapping around the end of the log. Just do it
1344 * current cycle minus one so that the log will look like:
1347 error = xlog_write_log_records(log, (head_cycle - 1),
1354 * We need to wrap around the end of the physical log in
1357 * end of the physical log, and it should use the current
1360 distance = log->l_logBBsize - head_block;
1361 error = xlog_write_log_records(log, (head_cycle - 1),
1369 * Now write the blocks at the start of the physical log.
1376 distance = max_distance - (log->l_logBBsize - head_block);
1377 error = xlog_write_log_records(log, head_cycle, 0, distance,
1438 struct log *log,
1465 trace_xfs_log_recover_item_add_cont(log, trans, item, 0);
1480 * will appear in the current log item.
1484 struct log *log,
1496 /* we need to catch log corruptions here */
1527 "XFS: bad number of regions (%d) in inode log format",
1543 trace_xfs_log_recover_item_add(log, trans, item, 0);
1548 * Sort the log items in the transaction. Cancelled buffers need
1555 struct log *log,
1569 trace_xfs_log_recover_item_reorder_head(log,
1579 trace_xfs_log_recover_item_reorder_tail(log,
1585 "XFS: xlog_recover_reorder_trans: unrecognized type of log operation");
1602 * last occurrence in the log, we keep a reference count in the cancel
1608 xlog_t *log,
1631 trace_xfs_log_recover_buf_not_cancel(log, buf_f);
1640 bucket = &log->l_buf_cancel_table[(__uint64_t)blkno %
1667 trace_xfs_log_recover_buf_cancel_ref_inc(log, buf_f);
1681 trace_xfs_log_recover_buf_cancel_add(log, buf_f);
1693 * last occurrence in the log so that if the same buffer is re-used
1699 xlog_t *log,
1708 if (log->l_buf_cancel_table == NULL) {
1717 bucket = &log->l_buf_cancel_table[(__uint64_t)blkno %
1740 * log item, then decrement the refcount on the
1770 xlog_t *log,
1785 return xlog_check_buffer_cancelled(log, blkno, len, flags);
1893 "bad inode buffer log record (ptr = 0x%p, bp = 0x%p). XFS trying to replay bad (0) inode di_next_unlinked field",
1911 * given buffer. The bitmap in the buf log format structure indicates
2121 xlog_t *log,
2128 trace_xfs_log_recover_buf_dquot_buf(log, buf_f);
2147 if (log->l_quotaoffs_flag & type)
2162 * When meta-data buffers are freed at run time we log a buffer item
2164 * of the buffer in the log should not be replayed at recovery time.
2169 * To handle the cancellation of buffer log items, we make two passes
2170 * over the log during recovery. During the first we build a table of
2178 xlog_t *log,
2197 xlog_recover_do_buffer_pass1(log, buf_f);
2207 cancel = xlog_recover_do_buffer_pass2(log, buf_f);
2209 trace_xfs_log_recover_buf_cancel(log, buf_f);
2213 trace_xfs_log_recover_buf_recover(log, buf_f);
2221 xfs_fs_cmn_err(CE_ALERT, log->l_mp,
2223 buf_f->blf_type, log->l_mp->m_logname ?
2224 log->l_mp->m_logname : "internal");
2226 XFS_ERRLEVEL_LOW, log->l_mp);
2230 mp = log->l_mp;
2237 xfs_ioerror_alert("xlog_recover_do..(read#1)", log->l_mp,
2249 xlog_recover_do_dquot_buffer(mp, log, item, bp, buf_f);
2263 * buffers in the log can be a different size if the log was generated
2273 (XFS_BUF_COUNT(bp) != MAX(log->l_mp->m_sb.sb_blocksize,
2274 (__uint32_t)XFS_INODE_CLUSTER_SIZE(log->l_mp)))) {
2289 xlog_t *log,
2321 mp = log->l_mp;
2327 if (xlog_check_buffer_cancelled(log, in_f->ilf_blkno,
2330 trace_xfs_log_recover_inode_cancel(log, in_f);
2333 trace_xfs_log_recover_inode_recover(log, in_f);
2366 "xfs_inode_recover: Bad inode log record, rec ptr 0x%p, ino %Ld",
2374 /* Skip replay when the on disk inode is newer than the log one */
2385 trace_xfs_log_recover_inode_skip(log, in_f);
2400 "xfs_inode_recover: Bad regular inode log record, rec ptr 0x%p, ino ptr = 0x%p, ino bp = 0x%p, ino %Ld",
2413 "xfs_inode_recover: Bad dir inode log record, rec ptr 0x%p, ino ptr = 0x%p, ino bp = 0x%p, ino %Ld",
2424 "xfs_inode_recover: Bad inode log record, rec ptr 0x%p, dino ptr 0x%p, dino bp 0x%p, ino %Ld, total extents = %d, nblocks = %Ld",
2436 "xfs_inode_recover: Bad inode log rec ptr 0x%p, dino ptr 0x%p, dino bp 0x%p, ino %Ld, forkoff 0x%x",
2446 "xfs_inode_recover: Bad inode log record length %d, rec ptr 0x%p",
2560 xlog_t *log,
2578 log->l_quotaoffs_flag |= XFS_DQ_USER;
2580 log->l_quotaoffs_flag |= XFS_DQ_PROJ;
2582 log->l_quotaoffs_flag |= XFS_DQ_GROUP;
2592 xlog_t *log,
2606 mp = log->l_mp;
2632 if (log->l_quotaoffs_flag & type)
2650 "xlog_recover_do_dquot_trans (log copy)"))) {
2698 xlog_t *log,
2714 mp = log->l_mp;
2724 spin_lock(&log->l_ailp->xa_lock);
2728 xfs_trans_ail_update(log->l_ailp, (xfs_log_item_t *)efip, lsn);
2735 * a committed transaction in the log. It's purpose is to cancel
2736 * the corresponding efi if it was still in the log. To do this
2743 xlog_t *log,
2752 struct xfs_ail *ailp = log->l_ailp;
2799 xlog_t *log,
2806 error = xlog_recover_reorder_trans(log, trans, pass);
2811 trace_xfs_log_recover_item_recover(log, trans, item, pass);
2814 error = xlog_recover_do_buffer_trans(log, item, pass);
2817 error = xlog_recover_do_inode_trans(log, item, pass);
2820 error = xlog_recover_do_efi_trans(log, item,
2824 xlog_recover_do_efd_trans(log, item, pass);
2828 error = xlog_recover_do_dquot_trans(log, item, pass);
2831 error = xlog_recover_do_quotaoff_trans(log, item,
2876 xlog_t *log,
2883 if ((error = xlog_recover_do_trans(log, trans, pass)))
2909 xlog_t *log,
2927 /* check the log format matches our own - else we can't recover */
2928 if (xlog_header_check_recover(log->l_mp, rhead))
2961 error = xlog_recover_commit_trans(log,
2968 error = xlog_recover_add_to_cont_trans(log,
2980 error = xlog_recover_add_to_trans(log, trans,
3001 * the log. We need to free the extents that it describes.
3083 xlog_t *log)
3091 ailp = log->l_ailp;
3117 error = xlog_recover_process_efi(log->l_mp, efip);
3245 xlog_t *log)
3256 mp = log->l_mp;
3318 xlog_t *log,
3335 #define xlog_pack_data_checksum(log, iclog, size)
3343 xlog_t *log,
3352 xlog_pack_data_checksum(log, iclog, size);
3364 if (xfs_sb_version_haslogv2(&log->l_mp->m_sb)) {
3375 for (i = 1; i < log->l_iclog_heads; i++) {
3385 xlog_t *log)
3395 if (xfs_sb_version_haslogv2(&log->l_mp->m_sb)) {
3408 xlog_t *log,
3416 XFS_ERRLEVEL_LOW, log->l_mp);
3422 xlog_warn("XFS: %s: unrecognised log version (%d).",
3431 XFS_ERRLEVEL_LOW, log->l_mp);
3434 if (unlikely( blkno > log->l_logBBsize || blkno > INT_MAX )) {
3436 XFS_ERRLEVEL_LOW, log->l_mp);
3443 * Read the log from tail to head and process the log records found.
3445 * and where the active portion of the log wraps around the end of
3446 * the physical log separately. The pass parameter is passed through
3452 xlog_t *log,
3470 * h_size. Use this to tell how many sectors make up the log header.
3472 if (xfs_sb_version_haslogv2(&log->l_mp->m_sb)) {
3478 hbp = xlog_get_bp(log, 1);
3482 error = xlog_bread(log, tail_blk, 1, hbp, &offset);
3487 error = xlog_valid_rec_header(log, rhead, tail_blk);
3497 hbp = xlog_get_bp(log, hblks);
3502 ASSERT(log->l_sectBBsize == 1);
3504 hbp = xlog_get_bp(log, 1);
3510 dbp = xlog_get_bp(log, BTOBB(h_size));
3519 error = xlog_bread(log, blk_no, hblks, hbp, &offset);
3524 error = xlog_valid_rec_header(log, rhead, blk_no);
3530 error = xlog_bread(log, blk_no + hblks, bblks, dbp,
3535 xlog_unpack_data(rhead, offset, log);
3536 if ((error = xlog_recover_process_data(log,
3543 * Perform recovery around the end of the physical log.
3548 while (blk_no < log->l_logBBsize) {
3550 * Check for header wrapping around physical end-of-log
3555 if (blk_no + hblks <= log->l_logBBsize) {
3557 error = xlog_bread(log, blk_no, hblks, hbp,
3562 /* This LR is split across physical log end */
3563 if (blk_no != log->l_logBBsize) {
3564 /* some data before physical log end */
3566 split_hblks = log->l_logBBsize - (int)blk_no;
3568 error = xlog_bread(log, blk_no,
3581 * - the log start is guaranteed to be sector
3583 * - we read the log end (LR header start)
3584 * _first_, then the log start (LR header end)
3594 error = xlog_bread_noalign(log, 0,
3605 error = xlog_valid_rec_header(log, rhead,
3613 /* Read in data for log record */
3614 if (blk_no + bblks <= log->l_logBBsize) {
3615 error = xlog_bread(log, blk_no, bblks, dbp,
3620 /* This log record is split across the
3621 * physical end of log */
3624 if (blk_no != log->l_logBBsize) {
3626 * end of log */
3630 log->l_logBBsize - (int)blk_no;
3632 error = xlog_bread(log, blk_no,
3645 * - the log start is guaranteed to be sector
3647 * - we read the log end (LR header start)
3648 * _first_, then the log start (LR header end)
3657 error = xlog_bread_noalign(log, wrapped_hblks,
3667 xlog_unpack_data(rhead, offset, log);
3668 if ((error = xlog_recover_process_data(log, rhash,
3674 ASSERT(blk_no >= log->l_logBBsize);
3675 blk_no -= log->l_logBBsize;
3677 /* read first part of physical log */
3679 error = xlog_bread(log, blk_no, hblks, hbp, &offset);
3684 error = xlog_valid_rec_header(log, rhead, blk_no);
3689 error = xlog_bread(log, blk_no+hblks, bblks, dbp,
3694 xlog_unpack_data(rhead, offset, log);
3695 if ((error = xlog_recover_process_data(log, rhash,
3710 * Do the recovery of the log. We actually do this in two phases.
3712 * of cancelling a record written into the log. The first pass
3714 * second pass replays log items normally except for those which
3716 * takes place in the log item type specific routines.
3718 * The table of items which have cancel records in the log is allocated
3720 * the log recovery has been completed.
3724 xlog_t *log,
3733 * First do a pass to find all of the cancelled buf log items.
3736 log->l_buf_cancel_table =
3740 error = xlog_do_recovery_pass(log, head_blk, tail_blk,
3743 kmem_free(log->l_buf_cancel_table);
3744 log->l_buf_cancel_table = NULL;
3748 * Then do a second pass to actually recover the items in the log.
3751 error = xlog_do_recovery_pass(log, head_blk, tail_blk,
3758 ASSERT(log->l_buf_cancel_table[i] == NULL);
3762 kmem_free(log->l_buf_cancel_table);
3763 log->l_buf_cancel_table = NULL;
3773 xlog_t *log,
3782 * First replay the images in the log.
3784 error = xlog_do_log_recovery(log, head_blk, tail_blk);
3789 XFS_bflush(log->l_mp->m_ddev_targp);
3794 if (XFS_FORCED_SHUTDOWN(log->l_mp)) {
3801 * or iunlinks, we can free up the entire log and set the tail_lsn to
3807 xlog_assign_tail_lsn(log->l_mp);
3813 bp = xfs_getsb(log->l_mp, 0);
3819 xfsbdstrat(log->l_mp, bp);
3823 log->l_mp, bp, XFS_BUF_ADDR(bp));
3830 sbp = &log->l_mp->m_sb;
3837 xfs_icsb_reinit_counters(log->l_mp);
3839 xlog_recover_check_summary(log);
3842 log->l_flags &= ~XLOG_ACTIVE_RECOVERY;
3847 * Perform recovery and re-initialize some log variables in xlog_find_tail.
3853 xlog_t *log)
3858 /* find the tail of the log */
3859 if ((error = xlog_find_tail(log, &head_blk, &tail_blk)))
3874 if ((error = xfs_dev_is_read_only(log->l_mp, "recovery"))) {
3880 log->l_mp->m_fsname, log->l_mp->m_logname ?
3881 log->l_mp->m_logname : "internal");
3883 error = xlog_do_recover(log, head_blk, tail_blk);
3884 log->l_flags |= XLOG_RECOVERY_NEEDED;
3900 xlog_t *log)
3910 if (log->l_flags & XLOG_RECOVERY_NEEDED) {
3912 error = xlog_recover_process_efis(log);
3916 log->l_mp->m_fsname);
3920 * Sync the log to get all the EFIs out of the AIL.
3925 xfs_log_force(log->l_mp, XFS_LOG_SYNC);
3927 xlog_recover_process_iunlinks(log);
3929 xlog_recover_check_summary(log);
3933 log->l_mp->m_fsname, log->l_mp->m_logname ?
3934 log->l_mp->m_logname : "internal");
3935 log->l_flags &= ~XLOG_RECOVERY_NEEDED;
3939 log->l_mp->m_fsname);
3952 xlog_t *log)
3964 mp = log->l_mp;