diff options
Diffstat (limited to 'fs/xfs/xfs_log_recover.c')
-rw-r--r-- | fs/xfs/xfs_log_recover.c | 63 |
1 files changed, 31 insertions, 32 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 299fbaff1f2c..01dd228ca05e 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c | |||
@@ -147,7 +147,7 @@ xlog_put_bp( | |||
147 | * Return the address of the start of the given block number's data | 147 | * Return the address of the start of the given block number's data |
148 | * in a log buffer. The buffer covers a log sector-aligned region. | 148 | * in a log buffer. The buffer covers a log sector-aligned region. |
149 | */ | 149 | */ |
150 | STATIC xfs_caddr_t | 150 | STATIC char * |
151 | xlog_align( | 151 | xlog_align( |
152 | struct xlog *log, | 152 | struct xlog *log, |
153 | xfs_daddr_t blk_no, | 153 | xfs_daddr_t blk_no, |
@@ -203,7 +203,7 @@ xlog_bread( | |||
203 | xfs_daddr_t blk_no, | 203 | xfs_daddr_t blk_no, |
204 | int nbblks, | 204 | int nbblks, |
205 | struct xfs_buf *bp, | 205 | struct xfs_buf *bp, |
206 | xfs_caddr_t *offset) | 206 | char **offset) |
207 | { | 207 | { |
208 | int error; | 208 | int error; |
209 | 209 | ||
@@ -225,9 +225,9 @@ xlog_bread_offset( | |||
225 | xfs_daddr_t blk_no, /* block to read from */ | 225 | xfs_daddr_t blk_no, /* block to read from */ |
226 | int nbblks, /* blocks to read */ | 226 | int nbblks, /* blocks to read */ |
227 | struct xfs_buf *bp, | 227 | struct xfs_buf *bp, |
228 | xfs_caddr_t offset) | 228 | char *offset) |
229 | { | 229 | { |
230 | xfs_caddr_t orig_offset = bp->b_addr; | 230 | char *orig_offset = bp->b_addr; |
231 | int orig_len = BBTOB(bp->b_length); | 231 | int orig_len = BBTOB(bp->b_length); |
232 | int error, error2; | 232 | int error, error2; |
233 | 233 | ||
@@ -396,7 +396,7 @@ xlog_find_cycle_start( | |||
396 | xfs_daddr_t *last_blk, | 396 | xfs_daddr_t *last_blk, |
397 | uint cycle) | 397 | uint cycle) |
398 | { | 398 | { |
399 | xfs_caddr_t offset; | 399 | char *offset; |
400 | xfs_daddr_t mid_blk; | 400 | xfs_daddr_t mid_blk; |
401 | xfs_daddr_t end_blk; | 401 | xfs_daddr_t end_blk; |
402 | uint mid_cycle; | 402 | uint mid_cycle; |
@@ -443,7 +443,7 @@ xlog_find_verify_cycle( | |||
443 | uint cycle; | 443 | uint cycle; |
444 | xfs_buf_t *bp; | 444 | xfs_buf_t *bp; |
445 | xfs_daddr_t bufblks; | 445 | xfs_daddr_t bufblks; |
446 | xfs_caddr_t buf = NULL; | 446 | char *buf = NULL; |
447 | int error = 0; | 447 | int error = 0; |
448 | 448 | ||
449 | /* | 449 | /* |
@@ -509,7 +509,7 @@ xlog_find_verify_log_record( | |||
509 | { | 509 | { |
510 | xfs_daddr_t i; | 510 | xfs_daddr_t i; |
511 | xfs_buf_t *bp; | 511 | xfs_buf_t *bp; |
512 | xfs_caddr_t offset = NULL; | 512 | char *offset = NULL; |
513 | xlog_rec_header_t *head = NULL; | 513 | xlog_rec_header_t *head = NULL; |
514 | int error = 0; | 514 | int error = 0; |
515 | int smallmem = 0; | 515 | int smallmem = 0; |
@@ -616,7 +616,7 @@ xlog_find_head( | |||
616 | xfs_daddr_t *return_head_blk) | 616 | xfs_daddr_t *return_head_blk) |
617 | { | 617 | { |
618 | xfs_buf_t *bp; | 618 | xfs_buf_t *bp; |
619 | xfs_caddr_t offset; | 619 | char *offset; |
620 | xfs_daddr_t new_blk, first_blk, start_blk, last_blk, head_blk; | 620 | xfs_daddr_t new_blk, first_blk, start_blk, last_blk, head_blk; |
621 | int num_scan_bblks; | 621 | int num_scan_bblks; |
622 | uint first_half_cycle, last_half_cycle; | 622 | uint first_half_cycle, last_half_cycle; |
@@ -891,7 +891,7 @@ xlog_find_tail( | |||
891 | { | 891 | { |
892 | xlog_rec_header_t *rhead; | 892 | xlog_rec_header_t *rhead; |
893 | xlog_op_header_t *op_head; | 893 | xlog_op_header_t *op_head; |
894 | xfs_caddr_t offset = NULL; | 894 | char *offset = NULL; |
895 | xfs_buf_t *bp; | 895 | xfs_buf_t *bp; |
896 | int error, i, found; | 896 | int error, i, found; |
897 | xfs_daddr_t umount_data_blk; | 897 | xfs_daddr_t umount_data_blk; |
@@ -1099,7 +1099,7 @@ xlog_find_zeroed( | |||
1099 | xfs_daddr_t *blk_no) | 1099 | xfs_daddr_t *blk_no) |
1100 | { | 1100 | { |
1101 | xfs_buf_t *bp; | 1101 | xfs_buf_t *bp; |
1102 | xfs_caddr_t offset; | 1102 | char *offset; |
1103 | uint first_cycle, last_cycle; | 1103 | uint first_cycle, last_cycle; |
1104 | xfs_daddr_t new_blk, last_blk, start_blk; | 1104 | xfs_daddr_t new_blk, last_blk, start_blk; |
1105 | xfs_daddr_t num_scan_bblks; | 1105 | xfs_daddr_t num_scan_bblks; |
@@ -1199,7 +1199,7 @@ bp_err: | |||
1199 | STATIC void | 1199 | STATIC void |
1200 | xlog_add_record( | 1200 | xlog_add_record( |
1201 | struct xlog *log, | 1201 | struct xlog *log, |
1202 | xfs_caddr_t buf, | 1202 | char *buf, |
1203 | int cycle, | 1203 | int cycle, |
1204 | int block, | 1204 | int block, |
1205 | int tail_cycle, | 1205 | int tail_cycle, |
@@ -1227,7 +1227,7 @@ xlog_write_log_records( | |||
1227 | int tail_cycle, | 1227 | int tail_cycle, |
1228 | int tail_block) | 1228 | int tail_block) |
1229 | { | 1229 | { |
1230 | xfs_caddr_t offset; | 1230 | char *offset; |
1231 | xfs_buf_t *bp; | 1231 | xfs_buf_t *bp; |
1232 | int balign, ealign; | 1232 | int balign, ealign; |
1233 | int sectbb = log->l_sectBBsize; | 1233 | int sectbb = log->l_sectBBsize; |
@@ -1789,8 +1789,7 @@ xlog_recover_do_inode_buffer( | |||
1789 | return -EFSCORRUPTED; | 1789 | return -EFSCORRUPTED; |
1790 | } | 1790 | } |
1791 | 1791 | ||
1792 | buffer_nextp = (xfs_agino_t *)xfs_buf_offset(bp, | 1792 | buffer_nextp = xfs_buf_offset(bp, next_unlinked_offset); |
1793 | next_unlinked_offset); | ||
1794 | *buffer_nextp = *logged_nextp; | 1793 | *buffer_nextp = *logged_nextp; |
1795 | 1794 | ||
1796 | /* | 1795 | /* |
@@ -1798,7 +1797,7 @@ xlog_recover_do_inode_buffer( | |||
1798 | * have to leave the inode in a consistent state for whoever | 1797 | * have to leave the inode in a consistent state for whoever |
1799 | * reads it next.... | 1798 | * reads it next.... |
1800 | */ | 1799 | */ |
1801 | xfs_dinode_calc_crc(mp, (struct xfs_dinode *) | 1800 | xfs_dinode_calc_crc(mp, |
1802 | xfs_buf_offset(bp, i * mp->m_sb.sb_inodesize)); | 1801 | xfs_buf_offset(bp, i * mp->m_sb.sb_inodesize)); |
1803 | 1802 | ||
1804 | } | 1803 | } |
@@ -2503,8 +2502,8 @@ xlog_recover_inode_pass2( | |||
2503 | xfs_buf_t *bp; | 2502 | xfs_buf_t *bp; |
2504 | xfs_dinode_t *dip; | 2503 | xfs_dinode_t *dip; |
2505 | int len; | 2504 | int len; |
2506 | xfs_caddr_t src; | 2505 | char *src; |
2507 | xfs_caddr_t dest; | 2506 | char *dest; |
2508 | int error; | 2507 | int error; |
2509 | int attr_index; | 2508 | int attr_index; |
2510 | uint fields; | 2509 | uint fields; |
@@ -2546,7 +2545,7 @@ xlog_recover_inode_pass2( | |||
2546 | goto out_release; | 2545 | goto out_release; |
2547 | } | 2546 | } |
2548 | ASSERT(in_f->ilf_fields & XFS_ILOG_CORE); | 2547 | ASSERT(in_f->ilf_fields & XFS_ILOG_CORE); |
2549 | dip = (xfs_dinode_t *)xfs_buf_offset(bp, in_f->ilf_boffset); | 2548 | dip = xfs_buf_offset(bp, in_f->ilf_boffset); |
2550 | 2549 | ||
2551 | /* | 2550 | /* |
2552 | * Make sure the place we're flushing out to really looks | 2551 | * Make sure the place we're flushing out to really looks |
@@ -2885,7 +2884,7 @@ xlog_recover_dquot_pass2( | |||
2885 | return error; | 2884 | return error; |
2886 | 2885 | ||
2887 | ASSERT(bp); | 2886 | ASSERT(bp); |
2888 | ddq = (xfs_disk_dquot_t *)xfs_buf_offset(bp, dq_f->qlf_boffset); | 2887 | ddq = xfs_buf_offset(bp, dq_f->qlf_boffset); |
2889 | 2888 | ||
2890 | /* | 2889 | /* |
2891 | * If the dquot has an LSN in it, recover the dquot only if it's less | 2890 | * If the dquot has an LSN in it, recover the dquot only if it's less |
@@ -3374,17 +3373,17 @@ STATIC int | |||
3374 | xlog_recover_add_to_cont_trans( | 3373 | xlog_recover_add_to_cont_trans( |
3375 | struct xlog *log, | 3374 | struct xlog *log, |
3376 | struct xlog_recover *trans, | 3375 | struct xlog_recover *trans, |
3377 | xfs_caddr_t dp, | 3376 | char *dp, |
3378 | int len) | 3377 | int len) |
3379 | { | 3378 | { |
3380 | xlog_recover_item_t *item; | 3379 | xlog_recover_item_t *item; |
3381 | xfs_caddr_t ptr, old_ptr; | 3380 | char *ptr, *old_ptr; |
3382 | int old_len; | 3381 | int old_len; |
3383 | 3382 | ||
3384 | if (list_empty(&trans->r_itemq)) { | 3383 | if (list_empty(&trans->r_itemq)) { |
3385 | /* finish copying rest of trans header */ | 3384 | /* finish copying rest of trans header */ |
3386 | xlog_recover_add_item(&trans->r_itemq); | 3385 | xlog_recover_add_item(&trans->r_itemq); |
3387 | ptr = (xfs_caddr_t) &trans->r_theader + | 3386 | ptr = (char *)&trans->r_theader + |
3388 | sizeof(xfs_trans_header_t) - len; | 3387 | sizeof(xfs_trans_header_t) - len; |
3389 | memcpy(ptr, dp, len); | 3388 | memcpy(ptr, dp, len); |
3390 | return 0; | 3389 | return 0; |
@@ -3420,12 +3419,12 @@ STATIC int | |||
3420 | xlog_recover_add_to_trans( | 3419 | xlog_recover_add_to_trans( |
3421 | struct xlog *log, | 3420 | struct xlog *log, |
3422 | struct xlog_recover *trans, | 3421 | struct xlog_recover *trans, |
3423 | xfs_caddr_t dp, | 3422 | char *dp, |
3424 | int len) | 3423 | int len) |
3425 | { | 3424 | { |
3426 | xfs_inode_log_format_t *in_f; /* any will do */ | 3425 | xfs_inode_log_format_t *in_f; /* any will do */ |
3427 | xlog_recover_item_t *item; | 3426 | xlog_recover_item_t *item; |
3428 | xfs_caddr_t ptr; | 3427 | char *ptr; |
3429 | 3428 | ||
3430 | if (!len) | 3429 | if (!len) |
3431 | return 0; | 3430 | return 0; |
@@ -3514,7 +3513,7 @@ STATIC int | |||
3514 | xlog_recovery_process_trans( | 3513 | xlog_recovery_process_trans( |
3515 | struct xlog *log, | 3514 | struct xlog *log, |
3516 | struct xlog_recover *trans, | 3515 | struct xlog_recover *trans, |
3517 | xfs_caddr_t dp, | 3516 | char *dp, |
3518 | unsigned int len, | 3517 | unsigned int len, |
3519 | unsigned int flags, | 3518 | unsigned int flags, |
3520 | int pass) | 3519 | int pass) |
@@ -3621,8 +3620,8 @@ xlog_recover_process_ophdr( | |||
3621 | struct hlist_head rhash[], | 3620 | struct hlist_head rhash[], |
3622 | struct xlog_rec_header *rhead, | 3621 | struct xlog_rec_header *rhead, |
3623 | struct xlog_op_header *ohead, | 3622 | struct xlog_op_header *ohead, |
3624 | xfs_caddr_t dp, | 3623 | char *dp, |
3625 | xfs_caddr_t end, | 3624 | char *end, |
3626 | int pass) | 3625 | int pass) |
3627 | { | 3626 | { |
3628 | struct xlog_recover *trans; | 3627 | struct xlog_recover *trans; |
@@ -3671,11 +3670,11 @@ xlog_recover_process_data( | |||
3671 | struct xlog *log, | 3670 | struct xlog *log, |
3672 | struct hlist_head rhash[], | 3671 | struct hlist_head rhash[], |
3673 | struct xlog_rec_header *rhead, | 3672 | struct xlog_rec_header *rhead, |
3674 | xfs_caddr_t dp, | 3673 | char *dp, |
3675 | int pass) | 3674 | int pass) |
3676 | { | 3675 | { |
3677 | struct xlog_op_header *ohead; | 3676 | struct xlog_op_header *ohead; |
3678 | xfs_caddr_t end; | 3677 | char *end; |
3679 | int num_logops; | 3678 | int num_logops; |
3680 | int error; | 3679 | int error; |
3681 | 3680 | ||
@@ -4020,7 +4019,7 @@ xlog_recover_process_iunlinks( | |||
4020 | STATIC int | 4019 | STATIC int |
4021 | xlog_unpack_data_crc( | 4020 | xlog_unpack_data_crc( |
4022 | struct xlog_rec_header *rhead, | 4021 | struct xlog_rec_header *rhead, |
4023 | xfs_caddr_t dp, | 4022 | char *dp, |
4024 | struct xlog *log) | 4023 | struct xlog *log) |
4025 | { | 4024 | { |
4026 | __le32 crc; | 4025 | __le32 crc; |
@@ -4050,7 +4049,7 @@ xlog_unpack_data_crc( | |||
4050 | STATIC int | 4049 | STATIC int |
4051 | xlog_unpack_data( | 4050 | xlog_unpack_data( |
4052 | struct xlog_rec_header *rhead, | 4051 | struct xlog_rec_header *rhead, |
4053 | xfs_caddr_t dp, | 4052 | char *dp, |
4054 | struct xlog *log) | 4053 | struct xlog *log) |
4055 | { | 4054 | { |
4056 | int i, j, k; | 4055 | int i, j, k; |
@@ -4132,7 +4131,7 @@ xlog_do_recovery_pass( | |||
4132 | { | 4131 | { |
4133 | xlog_rec_header_t *rhead; | 4132 | xlog_rec_header_t *rhead; |
4134 | xfs_daddr_t blk_no; | 4133 | xfs_daddr_t blk_no; |
4135 | xfs_caddr_t offset; | 4134 | char *offset; |
4136 | xfs_buf_t *hbp, *dbp; | 4135 | xfs_buf_t *hbp, *dbp; |
4137 | int error = 0, h_size; | 4136 | int error = 0, h_size; |
4138 | int bblks, split_bblks; | 4137 | int bblks, split_bblks; |