aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_log_recover.c
diff options
context:
space:
mode:
authorMark Tinguely <tinguely@sgi.com>2012-06-14 10:22:16 -0400
committerBen Myers <bpm@sgi.com>2012-06-21 15:22:27 -0400
commit9a8d2fdbb47aaa1eaa136b89da5e5e6b60015c78 (patch)
tree32feb9af749ef07606189c93c751585efab09150 /fs/xfs/xfs_log_recover.c
parentad223e6030be017470e46f153de27a43979759e0 (diff)
xfs: remove xlog_t typedef
Remove the xlog_t type definitions. Signed-off-by: Mark Tinguely <tinguely@sgi.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_log_recover.c')
-rw-r--r--fs/xfs/xfs_log_recover.c140
1 files changed, 74 insertions, 66 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index a7be98abd6a9..a76ba886e738 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -43,10 +43,18 @@
43#include "xfs_utils.h" 43#include "xfs_utils.h"
44#include "xfs_trace.h" 44#include "xfs_trace.h"
45 45
46STATIC int xlog_find_zeroed(xlog_t *, xfs_daddr_t *); 46STATIC int
47STATIC int xlog_clear_stale_blocks(xlog_t *, xfs_lsn_t); 47xlog_find_zeroed(
48 struct xlog *,
49 xfs_daddr_t *);
50STATIC int
51xlog_clear_stale_blocks(
52 struct xlog *,
53 xfs_lsn_t);
48#if defined(DEBUG) 54#if defined(DEBUG)
49STATIC void xlog_recover_check_summary(xlog_t *); 55STATIC void
56xlog_recover_check_summary(
57 struct xlog *);
50#else 58#else
51#define xlog_recover_check_summary(log) 59#define xlog_recover_check_summary(log)
52#endif 60#endif
@@ -74,7 +82,7 @@ struct xfs_buf_cancel {
74 82
75static inline int 83static inline int
76xlog_buf_bbcount_valid( 84xlog_buf_bbcount_valid(
77 xlog_t *log, 85 struct xlog *log,
78 int bbcount) 86 int bbcount)
79{ 87{
80 return bbcount > 0 && bbcount <= log->l_logBBsize; 88 return bbcount > 0 && bbcount <= log->l_logBBsize;
@@ -87,7 +95,7 @@ xlog_buf_bbcount_valid(
87 */ 95 */
88STATIC xfs_buf_t * 96STATIC xfs_buf_t *
89xlog_get_bp( 97xlog_get_bp(
90 xlog_t *log, 98 struct xlog *log,
91 int nbblks) 99 int nbblks)
92{ 100{
93 struct xfs_buf *bp; 101 struct xfs_buf *bp;
@@ -138,10 +146,10 @@ xlog_put_bp(
138 */ 146 */
139STATIC xfs_caddr_t 147STATIC xfs_caddr_t
140xlog_align( 148xlog_align(
141 xlog_t *log, 149 struct xlog *log,
142 xfs_daddr_t blk_no, 150 xfs_daddr_t blk_no,
143 int nbblks, 151 int nbblks,
144 xfs_buf_t *bp) 152 struct xfs_buf *bp)
145{ 153{
146 xfs_daddr_t offset = blk_no & ((xfs_daddr_t)log->l_sectBBsize - 1); 154 xfs_daddr_t offset = blk_no & ((xfs_daddr_t)log->l_sectBBsize - 1);
147 155
@@ -155,10 +163,10 @@ xlog_align(
155 */ 163 */
156STATIC int 164STATIC int
157xlog_bread_noalign( 165xlog_bread_noalign(
158 xlog_t *log, 166 struct xlog *log,
159 xfs_daddr_t blk_no, 167 xfs_daddr_t blk_no,
160 int nbblks, 168 int nbblks,
161 xfs_buf_t *bp) 169 struct xfs_buf *bp)
162{ 170{
163 int error; 171 int error;
164 172
@@ -189,10 +197,10 @@ xlog_bread_noalign(
189 197
190STATIC int 198STATIC int
191xlog_bread( 199xlog_bread(
192 xlog_t *log, 200 struct xlog *log,
193 xfs_daddr_t blk_no, 201 xfs_daddr_t blk_no,
194 int nbblks, 202 int nbblks,
195 xfs_buf_t *bp, 203 struct xfs_buf *bp,
196 xfs_caddr_t *offset) 204 xfs_caddr_t *offset)
197{ 205{
198 int error; 206 int error;
@@ -211,10 +219,10 @@ xlog_bread(
211 */ 219 */
212STATIC int 220STATIC int
213xlog_bread_offset( 221xlog_bread_offset(
214 xlog_t *log, 222 struct xlog *log,
215 xfs_daddr_t blk_no, /* block to read from */ 223 xfs_daddr_t blk_no, /* block to read from */
216 int nbblks, /* blocks to read */ 224 int nbblks, /* blocks to read */
217 xfs_buf_t *bp, 225 struct xfs_buf *bp,
218 xfs_caddr_t offset) 226 xfs_caddr_t offset)
219{ 227{
220 xfs_caddr_t orig_offset = bp->b_addr; 228 xfs_caddr_t orig_offset = bp->b_addr;
@@ -241,10 +249,10 @@ xlog_bread_offset(
241 */ 249 */
242STATIC int 250STATIC int
243xlog_bwrite( 251xlog_bwrite(
244 xlog_t *log, 252 struct xlog *log,
245 xfs_daddr_t blk_no, 253 xfs_daddr_t blk_no,
246 int nbblks, 254 int nbblks,
247 xfs_buf_t *bp) 255 struct xfs_buf *bp)
248{ 256{
249 int error; 257 int error;
250 258
@@ -378,8 +386,8 @@ xlog_recover_iodone(
378 */ 386 */
379STATIC int 387STATIC int
380xlog_find_cycle_start( 388xlog_find_cycle_start(
381 xlog_t *log, 389 struct xlog *log,
382 xfs_buf_t *bp, 390 struct xfs_buf *bp,
383 xfs_daddr_t first_blk, 391 xfs_daddr_t first_blk,
384 xfs_daddr_t *last_blk, 392 xfs_daddr_t *last_blk,
385 uint cycle) 393 uint cycle)
@@ -421,7 +429,7 @@ xlog_find_cycle_start(
421 */ 429 */
422STATIC int 430STATIC int
423xlog_find_verify_cycle( 431xlog_find_verify_cycle(
424 xlog_t *log, 432 struct xlog *log,
425 xfs_daddr_t start_blk, 433 xfs_daddr_t start_blk,
426 int nbblks, 434 int nbblks,
427 uint stop_on_cycle_no, 435 uint stop_on_cycle_no,
@@ -490,7 +498,7 @@ out:
490 */ 498 */
491STATIC int 499STATIC int
492xlog_find_verify_log_record( 500xlog_find_verify_log_record(
493 xlog_t *log, 501 struct xlog *log,
494 xfs_daddr_t start_blk, 502 xfs_daddr_t start_blk,
495 xfs_daddr_t *last_blk, 503 xfs_daddr_t *last_blk,
496 int extra_bblks) 504 int extra_bblks)
@@ -600,7 +608,7 @@ out:
600 */ 608 */
601STATIC int 609STATIC int
602xlog_find_head( 610xlog_find_head(
603 xlog_t *log, 611 struct xlog *log,
604 xfs_daddr_t *return_head_blk) 612 xfs_daddr_t *return_head_blk)
605{ 613{
606 xfs_buf_t *bp; 614 xfs_buf_t *bp;
@@ -871,7 +879,7 @@ validate_head:
871 */ 879 */
872STATIC int 880STATIC int
873xlog_find_tail( 881xlog_find_tail(
874 xlog_t *log, 882 struct xlog *log,
875 xfs_daddr_t *head_blk, 883 xfs_daddr_t *head_blk,
876 xfs_daddr_t *tail_blk) 884 xfs_daddr_t *tail_blk)
877{ 885{
@@ -1080,7 +1088,7 @@ done:
1080 */ 1088 */
1081STATIC int 1089STATIC int
1082xlog_find_zeroed( 1090xlog_find_zeroed(
1083 xlog_t *log, 1091 struct xlog *log,
1084 xfs_daddr_t *blk_no) 1092 xfs_daddr_t *blk_no)
1085{ 1093{
1086 xfs_buf_t *bp; 1094 xfs_buf_t *bp;
@@ -1183,7 +1191,7 @@ bp_err:
1183 */ 1191 */
1184STATIC void 1192STATIC void
1185xlog_add_record( 1193xlog_add_record(
1186 xlog_t *log, 1194 struct xlog *log,
1187 xfs_caddr_t buf, 1195 xfs_caddr_t buf,
1188 int cycle, 1196 int cycle,
1189 int block, 1197 int block,
@@ -1205,7 +1213,7 @@ xlog_add_record(
1205 1213
1206STATIC int 1214STATIC int
1207xlog_write_log_records( 1215xlog_write_log_records(
1208 xlog_t *log, 1216 struct xlog *log,
1209 int cycle, 1217 int cycle,
1210 int start_block, 1218 int start_block,
1211 int blocks, 1219 int blocks,
@@ -1305,7 +1313,7 @@ xlog_write_log_records(
1305 */ 1313 */
1306STATIC int 1314STATIC int
1307xlog_clear_stale_blocks( 1315xlog_clear_stale_blocks(
1308 xlog_t *log, 1316 struct xlog *log,
1309 xfs_lsn_t tail_lsn) 1317 xfs_lsn_t tail_lsn)
1310{ 1318{
1311 int tail_cycle, head_cycle; 1319 int tail_cycle, head_cycle;
@@ -2050,11 +2058,11 @@ xfs_qm_dqcheck(
2050 */ 2058 */
2051STATIC void 2059STATIC void
2052xlog_recover_do_dquot_buffer( 2060xlog_recover_do_dquot_buffer(
2053 xfs_mount_t *mp, 2061 struct xfs_mount *mp,
2054 xlog_t *log, 2062 struct xlog *log,
2055 xlog_recover_item_t *item, 2063 struct xlog_recover_item *item,
2056 xfs_buf_t *bp, 2064 struct xfs_buf *bp,
2057 xfs_buf_log_format_t *buf_f) 2065 struct xfs_buf_log_format *buf_f)
2058{ 2066{
2059 uint type; 2067 uint type;
2060 2068
@@ -2108,9 +2116,9 @@ xlog_recover_do_dquot_buffer(
2108 */ 2116 */
2109STATIC int 2117STATIC int
2110xlog_recover_buffer_pass2( 2118xlog_recover_buffer_pass2(
2111 xlog_t *log, 2119 struct xlog *log,
2112 struct list_head *buffer_list, 2120 struct list_head *buffer_list,
2113 xlog_recover_item_t *item) 2121 struct xlog_recover_item *item)
2114{ 2122{
2115 xfs_buf_log_format_t *buf_f = item->ri_buf[0].i_addr; 2123 xfs_buf_log_format_t *buf_f = item->ri_buf[0].i_addr;
2116 xfs_mount_t *mp = log->l_mp; 2124 xfs_mount_t *mp = log->l_mp;
@@ -2189,9 +2197,9 @@ xlog_recover_buffer_pass2(
2189 2197
2190STATIC int 2198STATIC int
2191xlog_recover_inode_pass2( 2199xlog_recover_inode_pass2(
2192 xlog_t *log, 2200 struct xlog *log,
2193 struct list_head *buffer_list, 2201 struct list_head *buffer_list,
2194 xlog_recover_item_t *item) 2202 struct xlog_recover_item *item)
2195{ 2203{
2196 xfs_inode_log_format_t *in_f; 2204 xfs_inode_log_format_t *in_f;
2197 xfs_mount_t *mp = log->l_mp; 2205 xfs_mount_t *mp = log->l_mp;
@@ -2452,14 +2460,14 @@ error:
2452} 2460}
2453 2461
2454/* 2462/*
2455 * Recover QUOTAOFF records. We simply make a note of it in the xlog_t 2463 * Recover QUOTAOFF records. We simply make a note of it in the xlog
2456 * structure, so that we know not to do any dquot item or dquot buffer recovery, 2464 * structure, so that we know not to do any dquot item or dquot buffer recovery,
2457 * of that type. 2465 * of that type.
2458 */ 2466 */
2459STATIC int 2467STATIC int
2460xlog_recover_quotaoff_pass1( 2468xlog_recover_quotaoff_pass1(
2461 xlog_t *log, 2469 struct xlog *log,
2462 xlog_recover_item_t *item) 2470 struct xlog_recover_item *item)
2463{ 2471{
2464 xfs_qoff_logformat_t *qoff_f = item->ri_buf[0].i_addr; 2472 xfs_qoff_logformat_t *qoff_f = item->ri_buf[0].i_addr;
2465 ASSERT(qoff_f); 2473 ASSERT(qoff_f);
@@ -2483,9 +2491,9 @@ xlog_recover_quotaoff_pass1(
2483 */ 2491 */
2484STATIC int 2492STATIC int
2485xlog_recover_dquot_pass2( 2493xlog_recover_dquot_pass2(
2486 xlog_t *log, 2494 struct xlog *log,
2487 struct list_head *buffer_list, 2495 struct list_head *buffer_list,
2488 xlog_recover_item_t *item) 2496 struct xlog_recover_item *item)
2489{ 2497{
2490 xfs_mount_t *mp = log->l_mp; 2498 xfs_mount_t *mp = log->l_mp;
2491 xfs_buf_t *bp; 2499 xfs_buf_t *bp;
@@ -2578,9 +2586,9 @@ xlog_recover_dquot_pass2(
2578 */ 2586 */
2579STATIC int 2587STATIC int
2580xlog_recover_efi_pass2( 2588xlog_recover_efi_pass2(
2581 xlog_t *log, 2589 struct xlog *log,
2582 xlog_recover_item_t *item, 2590 struct xlog_recover_item *item,
2583 xfs_lsn_t lsn) 2591 xfs_lsn_t lsn)
2584{ 2592{
2585 int error; 2593 int error;
2586 xfs_mount_t *mp = log->l_mp; 2594 xfs_mount_t *mp = log->l_mp;
@@ -2616,8 +2624,8 @@ xlog_recover_efi_pass2(
2616 */ 2624 */
2617STATIC int 2625STATIC int
2618xlog_recover_efd_pass2( 2626xlog_recover_efd_pass2(
2619 xlog_t *log, 2627 struct xlog *log,
2620 xlog_recover_item_t *item) 2628 struct xlog_recover_item *item)
2621{ 2629{
2622 xfs_efd_log_format_t *efd_formatp; 2630 xfs_efd_log_format_t *efd_formatp;
2623 xfs_efi_log_item_t *efip = NULL; 2631 xfs_efi_log_item_t *efip = NULL;
@@ -2812,9 +2820,9 @@ xlog_recover_unmount_trans(
2812 */ 2820 */
2813STATIC int 2821STATIC int
2814xlog_recover_process_data( 2822xlog_recover_process_data(
2815 xlog_t *log, 2823 struct xlog *log,
2816 struct hlist_head rhash[], 2824 struct hlist_head rhash[],
2817 xlog_rec_header_t *rhead, 2825 struct xlog_rec_header *rhead,
2818 xfs_caddr_t dp, 2826 xfs_caddr_t dp,
2819 int pass) 2827 int pass)
2820{ 2828{
@@ -2986,7 +2994,7 @@ abort_error:
2986 */ 2994 */
2987STATIC int 2995STATIC int
2988xlog_recover_process_efis( 2996xlog_recover_process_efis(
2989 xlog_t *log) 2997 struct xlog *log)
2990{ 2998{
2991 xfs_log_item_t *lip; 2999 xfs_log_item_t *lip;
2992 xfs_efi_log_item_t *efip; 3000 xfs_efi_log_item_t *efip;
@@ -3147,7 +3155,7 @@ xlog_recover_process_one_iunlink(
3147 */ 3155 */
3148STATIC void 3156STATIC void
3149xlog_recover_process_iunlinks( 3157xlog_recover_process_iunlinks(
3150 xlog_t *log) 3158 struct xlog *log)
3151{ 3159{
3152 xfs_mount_t *mp; 3160 xfs_mount_t *mp;
3153 xfs_agnumber_t agno; 3161 xfs_agnumber_t agno;
@@ -3209,9 +3217,9 @@ xlog_recover_process_iunlinks(
3209#ifdef DEBUG 3217#ifdef DEBUG
3210STATIC void 3218STATIC void
3211xlog_pack_data_checksum( 3219xlog_pack_data_checksum(
3212 xlog_t *log, 3220 struct xlog *log,
3213 xlog_in_core_t *iclog, 3221 struct xlog_in_core *iclog,
3214 int size) 3222 int size)
3215{ 3223{
3216 int i; 3224 int i;
3217 __be32 *up; 3225 __be32 *up;
@@ -3234,8 +3242,8 @@ xlog_pack_data_checksum(
3234 */ 3242 */
3235void 3243void
3236xlog_pack_data( 3244xlog_pack_data(
3237 xlog_t *log, 3245 struct xlog *log,
3238 xlog_in_core_t *iclog, 3246 struct xlog_in_core *iclog,
3239 int roundoff) 3247 int roundoff)
3240{ 3248{
3241 int i, j, k; 3249 int i, j, k;
@@ -3274,9 +3282,9 @@ xlog_pack_data(
3274 3282
3275STATIC void 3283STATIC void
3276xlog_unpack_data( 3284xlog_unpack_data(
3277 xlog_rec_header_t *rhead, 3285 struct xlog_rec_header *rhead,
3278 xfs_caddr_t dp, 3286 xfs_caddr_t dp,
3279 xlog_t *log) 3287 struct xlog *log)
3280{ 3288{
3281 int i, j, k; 3289 int i, j, k;
3282 3290
@@ -3299,8 +3307,8 @@ xlog_unpack_data(
3299 3307
3300STATIC int 3308STATIC int
3301xlog_valid_rec_header( 3309xlog_valid_rec_header(
3302 xlog_t *log, 3310 struct xlog *log,
3303 xlog_rec_header_t *rhead, 3311 struct xlog_rec_header *rhead,
3304 xfs_daddr_t blkno) 3312 xfs_daddr_t blkno)
3305{ 3313{
3306 int hlen; 3314 int hlen;
@@ -3343,7 +3351,7 @@ xlog_valid_rec_header(
3343 */ 3351 */
3344STATIC int 3352STATIC int
3345xlog_do_recovery_pass( 3353xlog_do_recovery_pass(
3346 xlog_t *log, 3354 struct xlog *log,
3347 xfs_daddr_t head_blk, 3355 xfs_daddr_t head_blk,
3348 xfs_daddr_t tail_blk, 3356 xfs_daddr_t tail_blk,
3349 int pass) 3357 int pass)
@@ -3595,7 +3603,7 @@ xlog_do_recovery_pass(
3595 */ 3603 */
3596STATIC int 3604STATIC int
3597xlog_do_log_recovery( 3605xlog_do_log_recovery(
3598 xlog_t *log, 3606 struct xlog *log,
3599 xfs_daddr_t head_blk, 3607 xfs_daddr_t head_blk,
3600 xfs_daddr_t tail_blk) 3608 xfs_daddr_t tail_blk)
3601{ 3609{
@@ -3646,7 +3654,7 @@ xlog_do_log_recovery(
3646 */ 3654 */
3647STATIC int 3655STATIC int
3648xlog_do_recover( 3656xlog_do_recover(
3649 xlog_t *log, 3657 struct xlog *log,
3650 xfs_daddr_t head_blk, 3658 xfs_daddr_t head_blk,
3651 xfs_daddr_t tail_blk) 3659 xfs_daddr_t tail_blk)
3652{ 3660{
@@ -3721,7 +3729,7 @@ xlog_do_recover(
3721 */ 3729 */
3722int 3730int
3723xlog_recover( 3731xlog_recover(
3724 xlog_t *log) 3732 struct xlog *log)
3725{ 3733{
3726 xfs_daddr_t head_blk, tail_blk; 3734 xfs_daddr_t head_blk, tail_blk;
3727 int error; 3735 int error;
@@ -3767,7 +3775,7 @@ xlog_recover(
3767 */ 3775 */
3768int 3776int
3769xlog_recover_finish( 3777xlog_recover_finish(
3770 xlog_t *log) 3778 struct xlog *log)
3771{ 3779{
3772 /* 3780 /*
3773 * Now we're ready to do the transactions needed for the 3781 * Now we're ready to do the transactions needed for the
@@ -3814,7 +3822,7 @@ xlog_recover_finish(
3814 */ 3822 */
3815void 3823void
3816xlog_recover_check_summary( 3824xlog_recover_check_summary(
3817 xlog_t *log) 3825 struct xlog *log)
3818{ 3826{
3819 xfs_mount_t *mp; 3827 xfs_mount_t *mp;
3820 xfs_agf_t *agfp; 3828 xfs_agf_t *agfp;