Diff for /xfs-linux/xfs_log_recover.c between versions 1.326 and 1.327

version 1.326, 2007/10/01 06:09:11 version 1.327, 2007/10/02 06:14:02
Line 311  xlog_find_cycle_start( Line 311  xlog_find_cycle_start(
                 if ((error = xlog_bread(log, mid_blk, 1, bp)))                  if ((error = xlog_bread(log, mid_blk, 1, bp)))
                         return error;                          return error;
                 offset = xlog_align(log, mid_blk, 1, bp);                  offset = xlog_align(log, mid_blk, 1, bp);
                 mid_cycle = GET_CYCLE(offset, ARCH_CONVERT);                  mid_cycle = xlog_get_cycle(offset);
                 if (mid_cycle == cycle) {                  if (mid_cycle == cycle) {
                         *last_blk = mid_blk;                          *last_blk = mid_blk;
                         /* last_half_cycle == mid_cycle */                          /* last_half_cycle == mid_cycle */
Line 371  xlog_find_verify_cycle( Line 371  xlog_find_verify_cycle(
   
                 buf = xlog_align(log, i, bcount, bp);                  buf = xlog_align(log, i, bcount, bp);
                 for (j = 0; j < bcount; j++) {                  for (j = 0; j < bcount; j++) {
                         cycle = GET_CYCLE(buf, ARCH_CONVERT);                          cycle = xlog_get_cycle(buf);
                         if (cycle == stop_on_cycle_no) {                          if (cycle == stop_on_cycle_no) {
                                 *new_blk = i+j;                                  *new_blk = i+j;
                                 goto out;                                  goto out;
Line 550  xlog_find_head( Line 550  xlog_find_head(
         if ((error = xlog_bread(log, 0, 1, bp)))          if ((error = xlog_bread(log, 0, 1, bp)))
                 goto bp_err;                  goto bp_err;
         offset = xlog_align(log, 0, 1, bp);          offset = xlog_align(log, 0, 1, bp);
         first_half_cycle = GET_CYCLE(offset, ARCH_CONVERT);          first_half_cycle = xlog_get_cycle(offset);
   
         last_blk = head_blk = log_bbnum - 1;    /* get cycle # of last block */          last_blk = head_blk = log_bbnum - 1;    /* get cycle # of last block */
         if ((error = xlog_bread(log, last_blk, 1, bp)))          if ((error = xlog_bread(log, last_blk, 1, bp)))
                 goto bp_err;                  goto bp_err;
         offset = xlog_align(log, last_blk, 1, bp);          offset = xlog_align(log, last_blk, 1, bp);
         last_half_cycle = GET_CYCLE(offset, ARCH_CONVERT);          last_half_cycle = xlog_get_cycle(offset);
         ASSERT(last_half_cycle != 0);          ASSERT(last_half_cycle != 0);
   
         /*          /*
Line 808  xlog_find_tail( Line 808  xlog_find_tail(
                 if ((error = xlog_bread(log, 0, 1, bp)))                  if ((error = xlog_bread(log, 0, 1, bp)))
                         goto bread_err;                          goto bread_err;
                 offset = xlog_align(log, 0, 1, bp);                  offset = xlog_align(log, 0, 1, bp);
                 if (GET_CYCLE(offset, ARCH_CONVERT) == 0) {                  if (xlog_get_cycle(offset) == 0) {
                         *tail_blk = 0;                          *tail_blk = 0;
                         /* leave all other log inited values alone */                          /* leave all other log inited values alone */
                         goto exit;                          goto exit;
Line 922  xlog_find_tail( Line 922  xlog_find_tail(
                          * log records will point recovery to after the                           * log records will point recovery to after the
                          * current unmount record.                           * current unmount record.
                          */                           */
                         ASSIGN_ANY_LSN_HOST(log->l_tail_lsn, log->l_curr_cycle,                          log->l_tail_lsn =
                                         after_umount_blk);                                  xlog_assign_lsn(log->l_curr_cycle,
                         ASSIGN_ANY_LSN_HOST(log->l_last_sync_lsn, log->l_curr_cycle,                                                  after_umount_blk);
                                         after_umount_blk);                          log->l_last_sync_lsn =
                                   xlog_assign_lsn(log->l_curr_cycle,
                                                   after_umount_blk);
                         *tail_blk = after_umount_blk;                          *tail_blk = after_umount_blk;
   
                         /*                          /*
Line 1007  xlog_find_zeroed( Line 1009  xlog_find_zeroed(
         if ((error = xlog_bread(log, 0, 1, bp)))          if ((error = xlog_bread(log, 0, 1, bp)))
                 goto bp_err;                  goto bp_err;
         offset = xlog_align(log, 0, 1, bp);          offset = xlog_align(log, 0, 1, bp);
         first_cycle = GET_CYCLE(offset, ARCH_CONVERT);          first_cycle = xlog_get_cycle(offset);
         if (first_cycle == 0) {         /* completely zeroed log */          if (first_cycle == 0) {         /* completely zeroed log */
                 *blk_no = 0;                  *blk_no = 0;
                 xlog_put_bp(bp);                  xlog_put_bp(bp);
Line 1018  xlog_find_zeroed( Line 1020  xlog_find_zeroed(
         if ((error = xlog_bread(log, log_bbnum-1, 1, bp)))          if ((error = xlog_bread(log, log_bbnum-1, 1, bp)))
                 goto bp_err;                  goto bp_err;
         offset = xlog_align(log, log_bbnum-1, 1, bp);          offset = xlog_align(log, log_bbnum-1, 1, bp);
         last_cycle = GET_CYCLE(offset, ARCH_CONVERT);          last_cycle = xlog_get_cycle(offset);
         if (last_cycle != 0) {          /* log completely written to */          if (last_cycle != 0) {          /* log completely written to */
                 xlog_put_bp(bp);                  xlog_put_bp(bp);
                 return 0;                  return 0;
Line 1102  xlog_add_record( Line 1104  xlog_add_record(
         INT_SET(recp->h_cycle, ARCH_CONVERT, cycle);          INT_SET(recp->h_cycle, ARCH_CONVERT, cycle);
         INT_SET(recp->h_version, ARCH_CONVERT,          INT_SET(recp->h_version, ARCH_CONVERT,
                         XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb) ? 2 : 1);                          XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb) ? 2 : 1);
         ASSIGN_ANY_LSN_DISK(recp->h_lsn, cycle, block);          INT_SET(recp->h_lsn, ARCH_CONVERT, xlog_assign_lsn(cycle, block));
         ASSIGN_ANY_LSN_DISK(recp->h_tail_lsn, tail_cycle, tail_block);          INT_SET(recp->h_tail_lsn, ARCH_CONVERT,
                   xlog_assign_lsn(tail_cycle, tail_block));
         INT_SET(recp->h_fmt, ARCH_CONVERT, XLOG_FMT);          INT_SET(recp->h_fmt, ARCH_CONVERT, XLOG_FMT);
         memcpy(&recp->h_fs_uuid, &log->l_mp->m_sb.sb_uuid, sizeof(uuid_t));          memcpy(&recp->h_fs_uuid, &log->l_mp->m_sb.sb_uuid, sizeof(uuid_t));
 }  }

Removed from v.1.326  
changed lines
  Added in v.1.327


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>