diff options
author | Mark Tinguely <tinguely@sgi.com> | 2012-06-14 10:22:15 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-06-21 14:49:39 -0400 |
commit | ad223e6030be017470e46f153de27a43979759e0 (patch) | |
tree | 60bc1ae6af1cdfb9460b3e8913f159adc9eab989 /fs/xfs | |
parent | 11159a0500c1eb7a8a2de37b7dceb53373c75350 (diff) |
xfs: rename log structure to xlog
Rename the XFS log structure to xlog to help crash distinquish it from the
other logs in Linux.
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')
-rw-r--r-- | fs/xfs/xfs_log.c | 76 | ||||
-rw-r--r-- | fs/xfs/xfs_log_cil.c | 22 | ||||
-rw-r--r-- | fs/xfs/xfs_log_priv.h | 46 | ||||
-rw-r--r-- | fs/xfs/xfs_log_recover.c | 38 | ||||
-rw-r--r-- | fs/xfs/xfs_mount.h | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_trace.h | 18 |
6 files changed, 116 insertions, 88 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 0e1a64f0439c..d90d4a388609 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -38,13 +38,21 @@ | |||
38 | kmem_zone_t *xfs_log_ticket_zone; | 38 | kmem_zone_t *xfs_log_ticket_zone; |
39 | 39 | ||
40 | /* Local miscellaneous function prototypes */ | 40 | /* Local miscellaneous function prototypes */ |
41 | STATIC int xlog_commit_record(struct log *log, struct xlog_ticket *ticket, | 41 | STATIC int |
42 | xlog_in_core_t **, xfs_lsn_t *); | 42 | xlog_commit_record( |
43 | struct xlog *log, | ||
44 | struct xlog_ticket *ticket, | ||
45 | struct xlog_in_core **iclog, | ||
46 | xfs_lsn_t *commitlsnp); | ||
47 | |||
43 | STATIC xlog_t * xlog_alloc_log(xfs_mount_t *mp, | 48 | STATIC xlog_t * xlog_alloc_log(xfs_mount_t *mp, |
44 | xfs_buftarg_t *log_target, | 49 | xfs_buftarg_t *log_target, |
45 | xfs_daddr_t blk_offset, | 50 | xfs_daddr_t blk_offset, |
46 | int num_bblks); | 51 | int num_bblks); |
47 | STATIC int xlog_space_left(struct log *log, atomic64_t *head); | 52 | STATIC int |
53 | xlog_space_left( | ||
54 | struct xlog *log, | ||
55 | atomic64_t *head); | ||
48 | STATIC int xlog_sync(xlog_t *log, xlog_in_core_t *iclog); | 56 | STATIC int xlog_sync(xlog_t *log, xlog_in_core_t *iclog); |
49 | STATIC void xlog_dealloc_log(xlog_t *log); | 57 | STATIC void xlog_dealloc_log(xlog_t *log); |
50 | 58 | ||
@@ -64,8 +72,10 @@ STATIC void xlog_state_switch_iclogs(xlog_t *log, | |||
64 | int eventual_size); | 72 | int eventual_size); |
65 | STATIC void xlog_state_want_sync(xlog_t *log, xlog_in_core_t *iclog); | 73 | STATIC void xlog_state_want_sync(xlog_t *log, xlog_in_core_t *iclog); |
66 | 74 | ||
67 | STATIC void xlog_grant_push_ail(struct log *log, | 75 | STATIC void |
68 | int need_bytes); | 76 | xlog_grant_push_ail( |
77 | struct xlog *log, | ||
78 | int need_bytes); | ||
69 | STATIC void xlog_regrant_reserve_log_space(xlog_t *log, | 79 | STATIC void xlog_regrant_reserve_log_space(xlog_t *log, |
70 | xlog_ticket_t *ticket); | 80 | xlog_ticket_t *ticket); |
71 | STATIC void xlog_ungrant_log_space(xlog_t *log, | 81 | STATIC void xlog_ungrant_log_space(xlog_t *log, |
@@ -73,7 +83,9 @@ STATIC void xlog_ungrant_log_space(xlog_t *log, | |||
73 | 83 | ||
74 | #if defined(DEBUG) | 84 | #if defined(DEBUG) |
75 | STATIC void xlog_verify_dest_ptr(xlog_t *log, char *ptr); | 85 | STATIC void xlog_verify_dest_ptr(xlog_t *log, char *ptr); |
76 | STATIC void xlog_verify_grant_tail(struct log *log); | 86 | STATIC void |
87 | xlog_verify_grant_tail( | ||
88 | struct xlog *log); | ||
77 | STATIC void xlog_verify_iclog(xlog_t *log, xlog_in_core_t *iclog, | 89 | STATIC void xlog_verify_iclog(xlog_t *log, xlog_in_core_t *iclog, |
78 | int count, boolean_t syncing); | 90 | int count, boolean_t syncing); |
79 | STATIC void xlog_verify_tail_lsn(xlog_t *log, xlog_in_core_t *iclog, | 91 | STATIC void xlog_verify_tail_lsn(xlog_t *log, xlog_in_core_t *iclog, |
@@ -89,9 +101,9 @@ STATIC int xlog_iclogs_empty(xlog_t *log); | |||
89 | 101 | ||
90 | static void | 102 | static void |
91 | xlog_grant_sub_space( | 103 | xlog_grant_sub_space( |
92 | struct log *log, | 104 | struct xlog *log, |
93 | atomic64_t *head, | 105 | atomic64_t *head, |
94 | int bytes) | 106 | int bytes) |
95 | { | 107 | { |
96 | int64_t head_val = atomic64_read(head); | 108 | int64_t head_val = atomic64_read(head); |
97 | int64_t new, old; | 109 | int64_t new, old; |
@@ -115,9 +127,9 @@ xlog_grant_sub_space( | |||
115 | 127 | ||
116 | static void | 128 | static void |
117 | xlog_grant_add_space( | 129 | xlog_grant_add_space( |
118 | struct log *log, | 130 | struct xlog *log, |
119 | atomic64_t *head, | 131 | atomic64_t *head, |
120 | int bytes) | 132 | int bytes) |
121 | { | 133 | { |
122 | int64_t head_val = atomic64_read(head); | 134 | int64_t head_val = atomic64_read(head); |
123 | int64_t new, old; | 135 | int64_t new, old; |
@@ -165,7 +177,7 @@ xlog_grant_head_wake_all( | |||
165 | 177 | ||
166 | static inline int | 178 | static inline int |
167 | xlog_ticket_reservation( | 179 | xlog_ticket_reservation( |
168 | struct log *log, | 180 | struct xlog *log, |
169 | struct xlog_grant_head *head, | 181 | struct xlog_grant_head *head, |
170 | struct xlog_ticket *tic) | 182 | struct xlog_ticket *tic) |
171 | { | 183 | { |
@@ -182,7 +194,7 @@ xlog_ticket_reservation( | |||
182 | 194 | ||
183 | STATIC bool | 195 | STATIC bool |
184 | xlog_grant_head_wake( | 196 | xlog_grant_head_wake( |
185 | struct log *log, | 197 | struct xlog *log, |
186 | struct xlog_grant_head *head, | 198 | struct xlog_grant_head *head, |
187 | int *free_bytes) | 199 | int *free_bytes) |
188 | { | 200 | { |
@@ -204,7 +216,7 @@ xlog_grant_head_wake( | |||
204 | 216 | ||
205 | STATIC int | 217 | STATIC int |
206 | xlog_grant_head_wait( | 218 | xlog_grant_head_wait( |
207 | struct log *log, | 219 | struct xlog *log, |
208 | struct xlog_grant_head *head, | 220 | struct xlog_grant_head *head, |
209 | struct xlog_ticket *tic, | 221 | struct xlog_ticket *tic, |
210 | int need_bytes) | 222 | int need_bytes) |
@@ -256,7 +268,7 @@ shutdown: | |||
256 | */ | 268 | */ |
257 | STATIC int | 269 | STATIC int |
258 | xlog_grant_head_check( | 270 | xlog_grant_head_check( |
259 | struct log *log, | 271 | struct xlog *log, |
260 | struct xlog_grant_head *head, | 272 | struct xlog_grant_head *head, |
261 | struct xlog_ticket *tic, | 273 | struct xlog_ticket *tic, |
262 | int *need_bytes) | 274 | int *need_bytes) |
@@ -323,7 +335,7 @@ xfs_log_regrant( | |||
323 | struct xfs_mount *mp, | 335 | struct xfs_mount *mp, |
324 | struct xlog_ticket *tic) | 336 | struct xlog_ticket *tic) |
325 | { | 337 | { |
326 | struct log *log = mp->m_log; | 338 | struct xlog *log = mp->m_log; |
327 | int need_bytes; | 339 | int need_bytes; |
328 | int error = 0; | 340 | int error = 0; |
329 | 341 | ||
@@ -389,7 +401,7 @@ xfs_log_reserve( | |||
389 | bool permanent, | 401 | bool permanent, |
390 | uint t_type) | 402 | uint t_type) |
391 | { | 403 | { |
392 | struct log *log = mp->m_log; | 404 | struct xlog *log = mp->m_log; |
393 | struct xlog_ticket *tic; | 405 | struct xlog_ticket *tic; |
394 | int need_bytes; | 406 | int need_bytes; |
395 | int error = 0; | 407 | int error = 0; |
@@ -465,7 +477,7 @@ xfs_log_done( | |||
465 | struct xlog_in_core **iclog, | 477 | struct xlog_in_core **iclog, |
466 | uint flags) | 478 | uint flags) |
467 | { | 479 | { |
468 | struct log *log = mp->m_log; | 480 | struct xlog *log = mp->m_log; |
469 | xfs_lsn_t lsn = 0; | 481 | xfs_lsn_t lsn = 0; |
470 | 482 | ||
471 | if (XLOG_FORCED_SHUTDOWN(log) || | 483 | if (XLOG_FORCED_SHUTDOWN(log) || |
@@ -839,7 +851,7 @@ void | |||
839 | xfs_log_space_wake( | 851 | xfs_log_space_wake( |
840 | struct xfs_mount *mp) | 852 | struct xfs_mount *mp) |
841 | { | 853 | { |
842 | struct log *log = mp->m_log; | 854 | struct xlog *log = mp->m_log; |
843 | int free_bytes; | 855 | int free_bytes; |
844 | 856 | ||
845 | if (XLOG_FORCED_SHUTDOWN(log)) | 857 | if (XLOG_FORCED_SHUTDOWN(log)) |
@@ -917,7 +929,7 @@ xfs_lsn_t | |||
917 | xlog_assign_tail_lsn_locked( | 929 | xlog_assign_tail_lsn_locked( |
918 | struct xfs_mount *mp) | 930 | struct xfs_mount *mp) |
919 | { | 931 | { |
920 | struct log *log = mp->m_log; | 932 | struct xlog *log = mp->m_log; |
921 | struct xfs_log_item *lip; | 933 | struct xfs_log_item *lip; |
922 | xfs_lsn_t tail_lsn; | 934 | xfs_lsn_t tail_lsn; |
923 | 935 | ||
@@ -966,7 +978,7 @@ xlog_assign_tail_lsn( | |||
966 | */ | 978 | */ |
967 | STATIC int | 979 | STATIC int |
968 | xlog_space_left( | 980 | xlog_space_left( |
969 | struct log *log, | 981 | struct xlog *log, |
970 | atomic64_t *head) | 982 | atomic64_t *head) |
971 | { | 983 | { |
972 | int free_bytes; | 984 | int free_bytes; |
@@ -1278,7 +1290,7 @@ out: | |||
1278 | */ | 1290 | */ |
1279 | STATIC int | 1291 | STATIC int |
1280 | xlog_commit_record( | 1292 | xlog_commit_record( |
1281 | struct log *log, | 1293 | struct xlog *log, |
1282 | struct xlog_ticket *ticket, | 1294 | struct xlog_ticket *ticket, |
1283 | struct xlog_in_core **iclog, | 1295 | struct xlog_in_core **iclog, |
1284 | xfs_lsn_t *commitlsnp) | 1296 | xfs_lsn_t *commitlsnp) |
@@ -1312,7 +1324,7 @@ xlog_commit_record( | |||
1312 | */ | 1324 | */ |
1313 | STATIC void | 1325 | STATIC void |
1314 | xlog_grant_push_ail( | 1326 | xlog_grant_push_ail( |
1315 | struct log *log, | 1327 | struct xlog *log, |
1316 | int need_bytes) | 1328 | int need_bytes) |
1317 | { | 1329 | { |
1318 | xfs_lsn_t threshold_lsn = 0; | 1330 | xfs_lsn_t threshold_lsn = 0; |
@@ -1791,7 +1803,7 @@ xlog_write_start_rec( | |||
1791 | 1803 | ||
1792 | static xlog_op_header_t * | 1804 | static xlog_op_header_t * |
1793 | xlog_write_setup_ophdr( | 1805 | xlog_write_setup_ophdr( |
1794 | struct log *log, | 1806 | struct xlog *log, |
1795 | struct xlog_op_header *ophdr, | 1807 | struct xlog_op_header *ophdr, |
1796 | struct xlog_ticket *ticket, | 1808 | struct xlog_ticket *ticket, |
1797 | uint flags) | 1809 | uint flags) |
@@ -1874,7 +1886,7 @@ xlog_write_setup_copy( | |||
1874 | 1886 | ||
1875 | static int | 1887 | static int |
1876 | xlog_write_copy_finish( | 1888 | xlog_write_copy_finish( |
1877 | struct log *log, | 1889 | struct xlog *log, |
1878 | struct xlog_in_core *iclog, | 1890 | struct xlog_in_core *iclog, |
1879 | uint flags, | 1891 | uint flags, |
1880 | int *record_cnt, | 1892 | int *record_cnt, |
@@ -1959,7 +1971,7 @@ xlog_write_copy_finish( | |||
1959 | */ | 1971 | */ |
1960 | int | 1972 | int |
1961 | xlog_write( | 1973 | xlog_write( |
1962 | struct log *log, | 1974 | struct xlog *log, |
1963 | struct xfs_log_vec *log_vector, | 1975 | struct xfs_log_vec *log_vector, |
1964 | struct xlog_ticket *ticket, | 1976 | struct xlog_ticket *ticket, |
1965 | xfs_lsn_t *start_lsn, | 1977 | xfs_lsn_t *start_lsn, |
@@ -2822,7 +2834,7 @@ _xfs_log_force( | |||
2822 | uint flags, | 2834 | uint flags, |
2823 | int *log_flushed) | 2835 | int *log_flushed) |
2824 | { | 2836 | { |
2825 | struct log *log = mp->m_log; | 2837 | struct xlog *log = mp->m_log; |
2826 | struct xlog_in_core *iclog; | 2838 | struct xlog_in_core *iclog; |
2827 | xfs_lsn_t lsn; | 2839 | xfs_lsn_t lsn; |
2828 | 2840 | ||
@@ -2970,7 +2982,7 @@ _xfs_log_force_lsn( | |||
2970 | uint flags, | 2982 | uint flags, |
2971 | int *log_flushed) | 2983 | int *log_flushed) |
2972 | { | 2984 | { |
2973 | struct log *log = mp->m_log; | 2985 | struct xlog *log = mp->m_log; |
2974 | struct xlog_in_core *iclog; | 2986 | struct xlog_in_core *iclog; |
2975 | int already_slept = 0; | 2987 | int already_slept = 0; |
2976 | 2988 | ||
@@ -3148,7 +3160,7 @@ xfs_log_ticket_get( | |||
3148 | */ | 3160 | */ |
3149 | xlog_ticket_t * | 3161 | xlog_ticket_t * |
3150 | xlog_ticket_alloc( | 3162 | xlog_ticket_alloc( |
3151 | struct log *log, | 3163 | struct xlog *log, |
3152 | int unit_bytes, | 3164 | int unit_bytes, |
3153 | int cnt, | 3165 | int cnt, |
3154 | char client, | 3166 | char client, |
@@ -3279,7 +3291,7 @@ xlog_ticket_alloc( | |||
3279 | */ | 3291 | */ |
3280 | void | 3292 | void |
3281 | xlog_verify_dest_ptr( | 3293 | xlog_verify_dest_ptr( |
3282 | struct log *log, | 3294 | struct xlog *log, |
3283 | char *ptr) | 3295 | char *ptr) |
3284 | { | 3296 | { |
3285 | int i; | 3297 | int i; |
@@ -3308,7 +3320,7 @@ xlog_verify_dest_ptr( | |||
3308 | */ | 3320 | */ |
3309 | STATIC void | 3321 | STATIC void |
3310 | xlog_verify_grant_tail( | 3322 | xlog_verify_grant_tail( |
3311 | struct log *log) | 3323 | struct xlog *log) |
3312 | { | 3324 | { |
3313 | int tail_cycle, tail_blocks; | 3325 | int tail_cycle, tail_blocks; |
3314 | int cycle, space; | 3326 | int cycle, space; |
diff --git a/fs/xfs/xfs_log_cil.c b/fs/xfs/xfs_log_cil.c index 7d6197c58493..ddc4529d07d3 100644 --- a/fs/xfs/xfs_log_cil.c +++ b/fs/xfs/xfs_log_cil.c | |||
@@ -44,7 +44,7 @@ | |||
44 | */ | 44 | */ |
45 | static struct xlog_ticket * | 45 | static struct xlog_ticket * |
46 | xlog_cil_ticket_alloc( | 46 | xlog_cil_ticket_alloc( |
47 | struct log *log) | 47 | struct xlog *log) |
48 | { | 48 | { |
49 | struct xlog_ticket *tic; | 49 | struct xlog_ticket *tic; |
50 | 50 | ||
@@ -72,7 +72,7 @@ xlog_cil_ticket_alloc( | |||
72 | */ | 72 | */ |
73 | void | 73 | void |
74 | xlog_cil_init_post_recovery( | 74 | xlog_cil_init_post_recovery( |
75 | struct log *log) | 75 | struct xlog *log) |
76 | { | 76 | { |
77 | log->l_cilp->xc_ctx->ticket = xlog_cil_ticket_alloc(log); | 77 | log->l_cilp->xc_ctx->ticket = xlog_cil_ticket_alloc(log); |
78 | log->l_cilp->xc_ctx->sequence = 1; | 78 | log->l_cilp->xc_ctx->sequence = 1; |
@@ -182,7 +182,7 @@ xlog_cil_prepare_log_vecs( | |||
182 | */ | 182 | */ |
183 | STATIC void | 183 | STATIC void |
184 | xfs_cil_prepare_item( | 184 | xfs_cil_prepare_item( |
185 | struct log *log, | 185 | struct xlog *log, |
186 | struct xfs_log_vec *lv, | 186 | struct xfs_log_vec *lv, |
187 | int *len, | 187 | int *len, |
188 | int *diff_iovecs) | 188 | int *diff_iovecs) |
@@ -231,7 +231,7 @@ xfs_cil_prepare_item( | |||
231 | */ | 231 | */ |
232 | static void | 232 | static void |
233 | xlog_cil_insert_items( | 233 | xlog_cil_insert_items( |
234 | struct log *log, | 234 | struct xlog *log, |
235 | struct xfs_log_vec *log_vector, | 235 | struct xfs_log_vec *log_vector, |
236 | struct xlog_ticket *ticket) | 236 | struct xlog_ticket *ticket) |
237 | { | 237 | { |
@@ -373,7 +373,7 @@ xlog_cil_committed( | |||
373 | */ | 373 | */ |
374 | STATIC int | 374 | STATIC int |
375 | xlog_cil_push( | 375 | xlog_cil_push( |
376 | struct log *log) | 376 | struct xlog *log) |
377 | { | 377 | { |
378 | struct xfs_cil *cil = log->l_cilp; | 378 | struct xfs_cil *cil = log->l_cilp; |
379 | struct xfs_log_vec *lv; | 379 | struct xfs_log_vec *lv; |
@@ -601,7 +601,7 @@ xlog_cil_push_work( | |||
601 | */ | 601 | */ |
602 | static void | 602 | static void |
603 | xlog_cil_push_background( | 603 | xlog_cil_push_background( |
604 | struct log *log) | 604 | struct xlog *log) |
605 | { | 605 | { |
606 | struct xfs_cil *cil = log->l_cilp; | 606 | struct xfs_cil *cil = log->l_cilp; |
607 | 607 | ||
@@ -629,7 +629,7 @@ xlog_cil_push_background( | |||
629 | 629 | ||
630 | static void | 630 | static void |
631 | xlog_cil_push_foreground( | 631 | xlog_cil_push_foreground( |
632 | struct log *log, | 632 | struct xlog *log, |
633 | xfs_lsn_t push_seq) | 633 | xfs_lsn_t push_seq) |
634 | { | 634 | { |
635 | struct xfs_cil *cil = log->l_cilp; | 635 | struct xfs_cil *cil = log->l_cilp; |
@@ -683,7 +683,7 @@ xfs_log_commit_cil( | |||
683 | xfs_lsn_t *commit_lsn, | 683 | xfs_lsn_t *commit_lsn, |
684 | int flags) | 684 | int flags) |
685 | { | 685 | { |
686 | struct log *log = mp->m_log; | 686 | struct xlog *log = mp->m_log; |
687 | int log_flags = 0; | 687 | int log_flags = 0; |
688 | struct xfs_log_vec *log_vector; | 688 | struct xfs_log_vec *log_vector; |
689 | 689 | ||
@@ -754,7 +754,7 @@ xfs_log_commit_cil( | |||
754 | */ | 754 | */ |
755 | xfs_lsn_t | 755 | xfs_lsn_t |
756 | xlog_cil_force_lsn( | 756 | xlog_cil_force_lsn( |
757 | struct log *log, | 757 | struct xlog *log, |
758 | xfs_lsn_t sequence) | 758 | xfs_lsn_t sequence) |
759 | { | 759 | { |
760 | struct xfs_cil *cil = log->l_cilp; | 760 | struct xfs_cil *cil = log->l_cilp; |
@@ -833,7 +833,7 @@ xfs_log_item_in_current_chkpt( | |||
833 | */ | 833 | */ |
834 | int | 834 | int |
835 | xlog_cil_init( | 835 | xlog_cil_init( |
836 | struct log *log) | 836 | struct xlog *log) |
837 | { | 837 | { |
838 | struct xfs_cil *cil; | 838 | struct xfs_cil *cil; |
839 | struct xfs_cil_ctx *ctx; | 839 | struct xfs_cil_ctx *ctx; |
@@ -869,7 +869,7 @@ xlog_cil_init( | |||
869 | 869 | ||
870 | void | 870 | void |
871 | xlog_cil_destroy( | 871 | xlog_cil_destroy( |
872 | struct log *log) | 872 | struct xlog *log) |
873 | { | 873 | { |
874 | if (log->l_cilp->xc_ctx) { | 874 | if (log->l_cilp->xc_ctx) { |
875 | if (log->l_cilp->xc_ctx->ticket) | 875 | if (log->l_cilp->xc_ctx->ticket) |
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h index 5bc33261f5be..72eba2201b14 100644 --- a/fs/xfs/xfs_log_priv.h +++ b/fs/xfs/xfs_log_priv.h | |||
@@ -19,7 +19,7 @@ | |||
19 | #define __XFS_LOG_PRIV_H__ | 19 | #define __XFS_LOG_PRIV_H__ |
20 | 20 | ||
21 | struct xfs_buf; | 21 | struct xfs_buf; |
22 | struct log; | 22 | struct xlog; |
23 | struct xlog_ticket; | 23 | struct xlog_ticket; |
24 | struct xfs_mount; | 24 | struct xfs_mount; |
25 | 25 | ||
@@ -352,7 +352,7 @@ typedef struct xlog_in_core { | |||
352 | struct xlog_in_core *ic_next; | 352 | struct xlog_in_core *ic_next; |
353 | struct xlog_in_core *ic_prev; | 353 | struct xlog_in_core *ic_prev; |
354 | struct xfs_buf *ic_bp; | 354 | struct xfs_buf *ic_bp; |
355 | struct log *ic_log; | 355 | struct xlog *ic_log; |
356 | int ic_size; | 356 | int ic_size; |
357 | int ic_offset; | 357 | int ic_offset; |
358 | int ic_bwritecnt; | 358 | int ic_bwritecnt; |
@@ -409,7 +409,7 @@ struct xfs_cil_ctx { | |||
409 | * operations almost as efficient as the old logging methods. | 409 | * operations almost as efficient as the old logging methods. |
410 | */ | 410 | */ |
411 | struct xfs_cil { | 411 | struct xfs_cil { |
412 | struct log *xc_log; | 412 | struct xlog *xc_log; |
413 | struct list_head xc_cil; | 413 | struct list_head xc_cil; |
414 | spinlock_t xc_cil_lock; | 414 | spinlock_t xc_cil_lock; |
415 | struct xfs_cil_ctx *xc_ctx; | 415 | struct xfs_cil_ctx *xc_ctx; |
@@ -487,7 +487,7 @@ struct xlog_grant_head { | |||
487 | * overflow 31 bits worth of byte offset, so using a byte number will mean | 487 | * overflow 31 bits worth of byte offset, so using a byte number will mean |
488 | * that round off problems won't occur when releasing partial reservations. | 488 | * that round off problems won't occur when releasing partial reservations. |
489 | */ | 489 | */ |
490 | typedef struct log { | 490 | typedef struct xlog { |
491 | /* The following fields don't need locking */ | 491 | /* The following fields don't need locking */ |
492 | struct xfs_mount *l_mp; /* mount point */ | 492 | struct xfs_mount *l_mp; /* mount point */ |
493 | struct xfs_ail *l_ailp; /* AIL log is working with */ | 493 | struct xfs_ail *l_ailp; /* AIL log is working with */ |
@@ -553,9 +553,14 @@ extern int xlog_recover_finish(xlog_t *log); | |||
553 | extern void xlog_pack_data(xlog_t *log, xlog_in_core_t *iclog, int); | 553 | extern void xlog_pack_data(xlog_t *log, xlog_in_core_t *iclog, int); |
554 | 554 | ||
555 | extern kmem_zone_t *xfs_log_ticket_zone; | 555 | extern kmem_zone_t *xfs_log_ticket_zone; |
556 | struct xlog_ticket *xlog_ticket_alloc(struct log *log, int unit_bytes, | 556 | struct xlog_ticket * |
557 | int count, char client, bool permanent, | 557 | xlog_ticket_alloc( |
558 | xfs_km_flags_t alloc_flags); | 558 | struct xlog *log, |
559 | int unit_bytes, | ||
560 | int count, | ||
561 | char client, | ||
562 | bool permanent, | ||
563 | xfs_km_flags_t alloc_flags); | ||
559 | 564 | ||
560 | 565 | ||
561 | static inline void | 566 | static inline void |
@@ -567,9 +572,14 @@ xlog_write_adv_cnt(void **ptr, int *len, int *off, size_t bytes) | |||
567 | } | 572 | } |
568 | 573 | ||
569 | void xlog_print_tic_res(struct xfs_mount *mp, struct xlog_ticket *ticket); | 574 | void xlog_print_tic_res(struct xfs_mount *mp, struct xlog_ticket *ticket); |
570 | int xlog_write(struct log *log, struct xfs_log_vec *log_vector, | 575 | int |
571 | struct xlog_ticket *tic, xfs_lsn_t *start_lsn, | 576 | xlog_write( |
572 | xlog_in_core_t **commit_iclog, uint flags); | 577 | struct xlog *log, |
578 | struct xfs_log_vec *log_vector, | ||
579 | struct xlog_ticket *tic, | ||
580 | xfs_lsn_t *start_lsn, | ||
581 | struct xlog_in_core **commit_iclog, | ||
582 | uint flags); | ||
573 | 583 | ||
574 | /* | 584 | /* |
575 | * When we crack an atomic LSN, we sample it first so that the value will not | 585 | * When we crack an atomic LSN, we sample it first so that the value will not |
@@ -629,17 +639,23 @@ xlog_assign_grant_head(atomic64_t *head, int cycle, int space) | |||
629 | /* | 639 | /* |
630 | * Committed Item List interfaces | 640 | * Committed Item List interfaces |
631 | */ | 641 | */ |
632 | int xlog_cil_init(struct log *log); | 642 | int |
633 | void xlog_cil_init_post_recovery(struct log *log); | 643 | xlog_cil_init(struct xlog *log); |
634 | void xlog_cil_destroy(struct log *log); | 644 | void |
645 | xlog_cil_init_post_recovery(struct xlog *log); | ||
646 | void | ||
647 | xlog_cil_destroy(struct xlog *log); | ||
635 | 648 | ||
636 | /* | 649 | /* |
637 | * CIL force routines | 650 | * CIL force routines |
638 | */ | 651 | */ |
639 | xfs_lsn_t xlog_cil_force_lsn(struct log *log, xfs_lsn_t sequence); | 652 | xfs_lsn_t |
653 | xlog_cil_force_lsn( | ||
654 | struct xlog *log, | ||
655 | xfs_lsn_t sequence); | ||
640 | 656 | ||
641 | static inline void | 657 | static inline void |
642 | xlog_cil_force(struct log *log) | 658 | xlog_cil_force(struct xlog *log) |
643 | { | 659 | { |
644 | xlog_cil_force_lsn(log, log->l_cilp->xc_current_sequence); | 660 | xlog_cil_force_lsn(log, log->l_cilp->xc_current_sequence); |
645 | } | 661 | } |
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index ca386909131a..a7be98abd6a9 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c | |||
@@ -1471,8 +1471,8 @@ xlog_recover_add_item( | |||
1471 | 1471 | ||
1472 | STATIC int | 1472 | STATIC int |
1473 | xlog_recover_add_to_cont_trans( | 1473 | xlog_recover_add_to_cont_trans( |
1474 | struct log *log, | 1474 | struct xlog *log, |
1475 | xlog_recover_t *trans, | 1475 | struct xlog_recover *trans, |
1476 | xfs_caddr_t dp, | 1476 | xfs_caddr_t dp, |
1477 | int len) | 1477 | int len) |
1478 | { | 1478 | { |
@@ -1517,8 +1517,8 @@ xlog_recover_add_to_cont_trans( | |||
1517 | */ | 1517 | */ |
1518 | STATIC int | 1518 | STATIC int |
1519 | xlog_recover_add_to_trans( | 1519 | xlog_recover_add_to_trans( |
1520 | struct log *log, | 1520 | struct xlog *log, |
1521 | xlog_recover_t *trans, | 1521 | struct xlog_recover *trans, |
1522 | xfs_caddr_t dp, | 1522 | xfs_caddr_t dp, |
1523 | int len) | 1523 | int len) |
1524 | { | 1524 | { |
@@ -1588,8 +1588,8 @@ xlog_recover_add_to_trans( | |||
1588 | */ | 1588 | */ |
1589 | STATIC int | 1589 | STATIC int |
1590 | xlog_recover_reorder_trans( | 1590 | xlog_recover_reorder_trans( |
1591 | struct log *log, | 1591 | struct xlog *log, |
1592 | xlog_recover_t *trans, | 1592 | struct xlog_recover *trans, |
1593 | int pass) | 1593 | int pass) |
1594 | { | 1594 | { |
1595 | xlog_recover_item_t *item, *n; | 1595 | xlog_recover_item_t *item, *n; |
@@ -1642,8 +1642,8 @@ xlog_recover_reorder_trans( | |||
1642 | */ | 1642 | */ |
1643 | STATIC int | 1643 | STATIC int |
1644 | xlog_recover_buffer_pass1( | 1644 | xlog_recover_buffer_pass1( |
1645 | struct log *log, | 1645 | struct xlog *log, |
1646 | xlog_recover_item_t *item) | 1646 | struct xlog_recover_item *item) |
1647 | { | 1647 | { |
1648 | xfs_buf_log_format_t *buf_f = item->ri_buf[0].i_addr; | 1648 | xfs_buf_log_format_t *buf_f = item->ri_buf[0].i_addr; |
1649 | struct list_head *bucket; | 1649 | struct list_head *bucket; |
@@ -1696,7 +1696,7 @@ xlog_recover_buffer_pass1( | |||
1696 | */ | 1696 | */ |
1697 | STATIC int | 1697 | STATIC int |
1698 | xlog_check_buffer_cancelled( | 1698 | xlog_check_buffer_cancelled( |
1699 | struct log *log, | 1699 | struct xlog *log, |
1700 | xfs_daddr_t blkno, | 1700 | xfs_daddr_t blkno, |
1701 | uint len, | 1701 | uint len, |
1702 | ushort flags) | 1702 | ushort flags) |
@@ -2689,9 +2689,9 @@ xlog_recover_free_trans( | |||
2689 | 2689 | ||
2690 | STATIC int | 2690 | STATIC int |
2691 | xlog_recover_commit_pass1( | 2691 | xlog_recover_commit_pass1( |
2692 | struct log *log, | 2692 | struct xlog *log, |
2693 | struct xlog_recover *trans, | 2693 | struct xlog_recover *trans, |
2694 | xlog_recover_item_t *item) | 2694 | struct xlog_recover_item *item) |
2695 | { | 2695 | { |
2696 | trace_xfs_log_recover_item_recover(log, trans, item, XLOG_RECOVER_PASS1); | 2696 | trace_xfs_log_recover_item_recover(log, trans, item, XLOG_RECOVER_PASS1); |
2697 | 2697 | ||
@@ -2716,10 +2716,10 @@ xlog_recover_commit_pass1( | |||
2716 | 2716 | ||
2717 | STATIC int | 2717 | STATIC int |
2718 | xlog_recover_commit_pass2( | 2718 | xlog_recover_commit_pass2( |
2719 | struct log *log, | 2719 | struct xlog *log, |
2720 | struct xlog_recover *trans, | 2720 | struct xlog_recover *trans, |
2721 | struct list_head *buffer_list, | 2721 | struct list_head *buffer_list, |
2722 | xlog_recover_item_t *item) | 2722 | struct xlog_recover_item *item) |
2723 | { | 2723 | { |
2724 | trace_xfs_log_recover_item_recover(log, trans, item, XLOG_RECOVER_PASS2); | 2724 | trace_xfs_log_recover_item_recover(log, trans, item, XLOG_RECOVER_PASS2); |
2725 | 2725 | ||
@@ -2753,7 +2753,7 @@ xlog_recover_commit_pass2( | |||
2753 | */ | 2753 | */ |
2754 | STATIC int | 2754 | STATIC int |
2755 | xlog_recover_commit_trans( | 2755 | xlog_recover_commit_trans( |
2756 | struct log *log, | 2756 | struct xlog *log, |
2757 | struct xlog_recover *trans, | 2757 | struct xlog_recover *trans, |
2758 | int pass) | 2758 | int pass) |
2759 | { | 2759 | { |
@@ -2793,8 +2793,8 @@ out: | |||
2793 | 2793 | ||
2794 | STATIC int | 2794 | STATIC int |
2795 | xlog_recover_unmount_trans( | 2795 | xlog_recover_unmount_trans( |
2796 | struct log *log, | 2796 | struct xlog *log, |
2797 | xlog_recover_t *trans) | 2797 | struct xlog_recover *trans) |
2798 | { | 2798 | { |
2799 | /* Do nothing now */ | 2799 | /* Do nothing now */ |
2800 | xfs_warn(log->l_mp, "%s: Unmount LR", __func__); | 2800 | xfs_warn(log->l_mp, "%s: Unmount LR", __func__); |
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 90a45305407d..8724336a9a08 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h | |||
@@ -53,7 +53,7 @@ typedef struct xfs_trans_reservations { | |||
53 | 53 | ||
54 | #include "xfs_sync.h" | 54 | #include "xfs_sync.h" |
55 | 55 | ||
56 | struct log; | 56 | struct xlog; |
57 | struct xfs_mount_args; | 57 | struct xfs_mount_args; |
58 | struct xfs_inode; | 58 | struct xfs_inode; |
59 | struct xfs_bmbt_irec; | 59 | struct xfs_bmbt_irec; |
@@ -133,7 +133,7 @@ typedef struct xfs_mount { | |||
133 | uint m_readio_blocks; /* min read size blocks */ | 133 | uint m_readio_blocks; /* min read size blocks */ |
134 | uint m_writeio_log; /* min write size log bytes */ | 134 | uint m_writeio_log; /* min write size log bytes */ |
135 | uint m_writeio_blocks; /* min write size blocks */ | 135 | uint m_writeio_blocks; /* min write size blocks */ |
136 | struct log *m_log; /* log specific stuff */ | 136 | struct xlog *m_log; /* log specific stuff */ |
137 | int m_logbufs; /* number of log buffers */ | 137 | int m_logbufs; /* number of log buffers */ |
138 | int m_logbsize; /* size of each log buffer */ | 138 | int m_logbsize; /* size of each log buffer */ |
139 | uint m_rsumlevels; /* rt summary levels */ | 139 | uint m_rsumlevels; /* rt summary levels */ |
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h index 7cf9d3529e51..caf5dabfd553 100644 --- a/fs/xfs/xfs_trace.h +++ b/fs/xfs/xfs_trace.h | |||
@@ -32,7 +32,7 @@ struct xfs_da_node_entry; | |||
32 | struct xfs_dquot; | 32 | struct xfs_dquot; |
33 | struct xfs_log_item; | 33 | struct xfs_log_item; |
34 | struct xlog_ticket; | 34 | struct xlog_ticket; |
35 | struct log; | 35 | struct xlog; |
36 | struct xlog_recover; | 36 | struct xlog_recover; |
37 | struct xlog_recover_item; | 37 | struct xlog_recover_item; |
38 | struct xfs_buf_log_format; | 38 | struct xfs_buf_log_format; |
@@ -762,7 +762,7 @@ DEFINE_DQUOT_EVENT(xfs_dqflush_force); | |||
762 | DEFINE_DQUOT_EVENT(xfs_dqflush_done); | 762 | DEFINE_DQUOT_EVENT(xfs_dqflush_done); |
763 | 763 | ||
764 | DECLARE_EVENT_CLASS(xfs_loggrant_class, | 764 | DECLARE_EVENT_CLASS(xfs_loggrant_class, |
765 | TP_PROTO(struct log *log, struct xlog_ticket *tic), | 765 | TP_PROTO(struct xlog *log, struct xlog_ticket *tic), |
766 | TP_ARGS(log, tic), | 766 | TP_ARGS(log, tic), |
767 | TP_STRUCT__entry( | 767 | TP_STRUCT__entry( |
768 | __field(dev_t, dev) | 768 | __field(dev_t, dev) |
@@ -830,7 +830,7 @@ DECLARE_EVENT_CLASS(xfs_loggrant_class, | |||
830 | 830 | ||
831 | #define DEFINE_LOGGRANT_EVENT(name) \ | 831 | #define DEFINE_LOGGRANT_EVENT(name) \ |
832 | DEFINE_EVENT(xfs_loggrant_class, name, \ | 832 | DEFINE_EVENT(xfs_loggrant_class, name, \ |
833 | TP_PROTO(struct log *log, struct xlog_ticket *tic), \ | 833 | TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \ |
834 | TP_ARGS(log, tic)) | 834 | TP_ARGS(log, tic)) |
835 | DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm); | 835 | DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm); |
836 | DEFINE_LOGGRANT_EVENT(xfs_log_done_perm); | 836 | DEFINE_LOGGRANT_EVENT(xfs_log_done_perm); |
@@ -1664,7 +1664,7 @@ DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before); | |||
1664 | DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after); | 1664 | DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after); |
1665 | 1665 | ||
1666 | DECLARE_EVENT_CLASS(xfs_log_recover_item_class, | 1666 | DECLARE_EVENT_CLASS(xfs_log_recover_item_class, |
1667 | TP_PROTO(struct log *log, struct xlog_recover *trans, | 1667 | TP_PROTO(struct xlog *log, struct xlog_recover *trans, |
1668 | struct xlog_recover_item *item, int pass), | 1668 | struct xlog_recover_item *item, int pass), |
1669 | TP_ARGS(log, trans, item, pass), | 1669 | TP_ARGS(log, trans, item, pass), |
1670 | TP_STRUCT__entry( | 1670 | TP_STRUCT__entry( |
@@ -1698,7 +1698,7 @@ DECLARE_EVENT_CLASS(xfs_log_recover_item_class, | |||
1698 | 1698 | ||
1699 | #define DEFINE_LOG_RECOVER_ITEM(name) \ | 1699 | #define DEFINE_LOG_RECOVER_ITEM(name) \ |
1700 | DEFINE_EVENT(xfs_log_recover_item_class, name, \ | 1700 | DEFINE_EVENT(xfs_log_recover_item_class, name, \ |
1701 | TP_PROTO(struct log *log, struct xlog_recover *trans, \ | 1701 | TP_PROTO(struct xlog *log, struct xlog_recover *trans, \ |
1702 | struct xlog_recover_item *item, int pass), \ | 1702 | struct xlog_recover_item *item, int pass), \ |
1703 | TP_ARGS(log, trans, item, pass)) | 1703 | TP_ARGS(log, trans, item, pass)) |
1704 | 1704 | ||
@@ -1709,7 +1709,7 @@ DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail); | |||
1709 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover); | 1709 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover); |
1710 | 1710 | ||
1711 | DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class, | 1711 | DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class, |
1712 | TP_PROTO(struct log *log, struct xfs_buf_log_format *buf_f), | 1712 | TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), |
1713 | TP_ARGS(log, buf_f), | 1713 | TP_ARGS(log, buf_f), |
1714 | TP_STRUCT__entry( | 1714 | TP_STRUCT__entry( |
1715 | __field(dev_t, dev) | 1715 | __field(dev_t, dev) |
@@ -1739,7 +1739,7 @@ DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class, | |||
1739 | 1739 | ||
1740 | #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \ | 1740 | #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \ |
1741 | DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \ | 1741 | DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \ |
1742 | TP_PROTO(struct log *log, struct xfs_buf_log_format *buf_f), \ | 1742 | TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \ |
1743 | TP_ARGS(log, buf_f)) | 1743 | TP_ARGS(log, buf_f)) |
1744 | 1744 | ||
1745 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel); | 1745 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel); |
@@ -1752,7 +1752,7 @@ DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf); | |||
1752 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf); | 1752 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf); |
1753 | 1753 | ||
1754 | DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class, | 1754 | DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class, |
1755 | TP_PROTO(struct log *log, struct xfs_inode_log_format *in_f), | 1755 | TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), |
1756 | TP_ARGS(log, in_f), | 1756 | TP_ARGS(log, in_f), |
1757 | TP_STRUCT__entry( | 1757 | TP_STRUCT__entry( |
1758 | __field(dev_t, dev) | 1758 | __field(dev_t, dev) |
@@ -1790,7 +1790,7 @@ DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class, | |||
1790 | ) | 1790 | ) |
1791 | #define DEFINE_LOG_RECOVER_INO_ITEM(name) \ | 1791 | #define DEFINE_LOG_RECOVER_INO_ITEM(name) \ |
1792 | DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \ | 1792 | DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \ |
1793 | TP_PROTO(struct log *log, struct xfs_inode_log_format *in_f), \ | 1793 | TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \ |
1794 | TP_ARGS(log, in_f)) | 1794 | TP_ARGS(log, in_f)) |
1795 | 1795 | ||
1796 | DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover); | 1796 | DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover); |