diff options
Diffstat (limited to 'fs/jbd2/commit.c')
-rw-r--r-- | fs/jbd2/commit.c | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index 10be51290a27..b1a4eafc1541 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/fs/jbd/commit.c | 2 | * linux/fs/jbd2/commit.c |
3 | * | 3 | * |
4 | * Written by Stephen C. Tweedie <sct@redhat.com>, 1998 | 4 | * Written by Stephen C. Tweedie <sct@redhat.com>, 1998 |
5 | * | 5 | * |
@@ -15,7 +15,7 @@ | |||
15 | 15 | ||
16 | #include <linux/time.h> | 16 | #include <linux/time.h> |
17 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
18 | #include <linux/jbd.h> | 18 | #include <linux/jbd2.h> |
19 | #include <linux/errno.h> | 19 | #include <linux/errno.h> |
20 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
21 | #include <linux/mm.h> | 21 | #include <linux/mm.h> |
@@ -111,7 +111,7 @@ static int journal_write_commit_record(journal_t *journal, | |||
111 | if (is_journal_aborted(journal)) | 111 | if (is_journal_aborted(journal)) |
112 | return 0; | 112 | return 0; |
113 | 113 | ||
114 | descriptor = journal_get_descriptor_buffer(journal); | 114 | descriptor = jbd2_journal_get_descriptor_buffer(journal); |
115 | if (!descriptor) | 115 | if (!descriptor) |
116 | return 1; | 116 | return 1; |
117 | 117 | ||
@@ -120,14 +120,14 @@ static int journal_write_commit_record(journal_t *journal, | |||
120 | /* AKPM: buglet - add `i' to tmp! */ | 120 | /* AKPM: buglet - add `i' to tmp! */ |
121 | for (i = 0; i < bh->b_size; i += 512) { | 121 | for (i = 0; i < bh->b_size; i += 512) { |
122 | journal_header_t *tmp = (journal_header_t*)bh->b_data; | 122 | journal_header_t *tmp = (journal_header_t*)bh->b_data; |
123 | tmp->h_magic = cpu_to_be32(JFS_MAGIC_NUMBER); | 123 | tmp->h_magic = cpu_to_be32(JBD2_MAGIC_NUMBER); |
124 | tmp->h_blocktype = cpu_to_be32(JFS_COMMIT_BLOCK); | 124 | tmp->h_blocktype = cpu_to_be32(JBD2_COMMIT_BLOCK); |
125 | tmp->h_sequence = cpu_to_be32(commit_transaction->t_tid); | 125 | tmp->h_sequence = cpu_to_be32(commit_transaction->t_tid); |
126 | } | 126 | } |
127 | 127 | ||
128 | JBUFFER_TRACE(descriptor, "write commit block"); | 128 | JBUFFER_TRACE(descriptor, "write commit block"); |
129 | set_buffer_dirty(bh); | 129 | set_buffer_dirty(bh); |
130 | if (journal->j_flags & JFS_BARRIER) { | 130 | if (journal->j_flags & JBD2_BARRIER) { |
131 | set_buffer_ordered(bh); | 131 | set_buffer_ordered(bh); |
132 | barrier_done = 1; | 132 | barrier_done = 1; |
133 | } | 133 | } |
@@ -145,7 +145,7 @@ static int journal_write_commit_record(journal_t *journal, | |||
145 | "disabling barriers\n", | 145 | "disabling barriers\n", |
146 | bdevname(journal->j_dev, b)); | 146 | bdevname(journal->j_dev, b)); |
147 | spin_lock(&journal->j_state_lock); | 147 | spin_lock(&journal->j_state_lock); |
148 | journal->j_flags &= ~JFS_BARRIER; | 148 | journal->j_flags &= ~JBD2_BARRIER; |
149 | spin_unlock(&journal->j_state_lock); | 149 | spin_unlock(&journal->j_state_lock); |
150 | 150 | ||
151 | /* And try again, without the barrier */ | 151 | /* And try again, without the barrier */ |
@@ -155,7 +155,7 @@ static int journal_write_commit_record(journal_t *journal, | |||
155 | ret = sync_dirty_buffer(bh); | 155 | ret = sync_dirty_buffer(bh); |
156 | } | 156 | } |
157 | put_bh(bh); /* One for getblk() */ | 157 | put_bh(bh); /* One for getblk() */ |
158 | journal_put_journal_head(descriptor); | 158 | jbd2_journal_put_journal_head(descriptor); |
159 | 159 | ||
160 | return (ret == -EIO); | 160 | return (ret == -EIO); |
161 | } | 161 | } |
@@ -239,7 +239,7 @@ write_out_data: | |||
239 | if (locked && test_clear_buffer_dirty(bh)) { | 239 | if (locked && test_clear_buffer_dirty(bh)) { |
240 | BUFFER_TRACE(bh, "needs writeout, adding to array"); | 240 | BUFFER_TRACE(bh, "needs writeout, adding to array"); |
241 | wbuf[bufs++] = bh; | 241 | wbuf[bufs++] = bh; |
242 | __journal_file_buffer(jh, commit_transaction, | 242 | __jbd2_journal_file_buffer(jh, commit_transaction, |
243 | BJ_Locked); | 243 | BJ_Locked); |
244 | jbd_unlock_bh_state(bh); | 244 | jbd_unlock_bh_state(bh); |
245 | if (bufs == journal->j_wbufsize) { | 245 | if (bufs == journal->j_wbufsize) { |
@@ -251,13 +251,13 @@ write_out_data: | |||
251 | } | 251 | } |
252 | else { | 252 | else { |
253 | BUFFER_TRACE(bh, "writeout complete: unfile"); | 253 | BUFFER_TRACE(bh, "writeout complete: unfile"); |
254 | __journal_unfile_buffer(jh); | 254 | __jbd2_journal_unfile_buffer(jh); |
255 | jbd_unlock_bh_state(bh); | 255 | jbd_unlock_bh_state(bh); |
256 | if (locked) | 256 | if (locked) |
257 | unlock_buffer(bh); | 257 | unlock_buffer(bh); |
258 | journal_remove_journal_head(bh); | 258 | jbd2_journal_remove_journal_head(bh); |
259 | /* Once for our safety reference, once for | 259 | /* Once for our safety reference, once for |
260 | * journal_remove_journal_head() */ | 260 | * jbd2_journal_remove_journal_head() */ |
261 | put_bh(bh); | 261 | put_bh(bh); |
262 | put_bh(bh); | 262 | put_bh(bh); |
263 | } | 263 | } |
@@ -272,12 +272,12 @@ write_out_data: | |||
272 | } | 272 | } |
273 | 273 | ||
274 | /* | 274 | /* |
275 | * journal_commit_transaction | 275 | * jbd2_journal_commit_transaction |
276 | * | 276 | * |
277 | * The primary function for committing a transaction to the log. This | 277 | * The primary function for committing a transaction to the log. This |
278 | * function is called by the journal thread to begin a complete commit. | 278 | * function is called by the journal thread to begin a complete commit. |
279 | */ | 279 | */ |
280 | void journal_commit_transaction(journal_t *journal) | 280 | void jbd2_journal_commit_transaction(journal_t *journal) |
281 | { | 281 | { |
282 | transaction_t *commit_transaction; | 282 | transaction_t *commit_transaction; |
283 | struct journal_head *jh, *new_jh, *descriptor; | 283 | struct journal_head *jh, *new_jh, *descriptor; |
@@ -305,10 +305,10 @@ void journal_commit_transaction(journal_t *journal) | |||
305 | spin_unlock(&journal->j_list_lock); | 305 | spin_unlock(&journal->j_list_lock); |
306 | #endif | 306 | #endif |
307 | 307 | ||
308 | /* Do we need to erase the effects of a prior journal_flush? */ | 308 | /* Do we need to erase the effects of a prior jbd2_journal_flush? */ |
309 | if (journal->j_flags & JFS_FLUSHED) { | 309 | if (journal->j_flags & JBD2_FLUSHED) { |
310 | jbd_debug(3, "super block updated\n"); | 310 | jbd_debug(3, "super block updated\n"); |
311 | journal_update_superblock(journal, 1); | 311 | jbd2_journal_update_superblock(journal, 1); |
312 | } else { | 312 | } else { |
313 | jbd_debug(3, "superblock not updated\n"); | 313 | jbd_debug(3, "superblock not updated\n"); |
314 | } | 314 | } |
@@ -350,7 +350,7 @@ void journal_commit_transaction(journal_t *journal) | |||
350 | * BJ_Reserved buffers. Note, it is _not_ permissible to assume | 350 | * BJ_Reserved buffers. Note, it is _not_ permissible to assume |
351 | * that there are no such buffers: if a large filesystem | 351 | * that there are no such buffers: if a large filesystem |
352 | * operation like a truncate needs to split itself over multiple | 352 | * operation like a truncate needs to split itself over multiple |
353 | * transactions, then it may try to do a journal_restart() while | 353 | * transactions, then it may try to do a jbd2_journal_restart() while |
354 | * there are still BJ_Reserved buffers outstanding. These must | 354 | * there are still BJ_Reserved buffers outstanding. These must |
355 | * be released cleanly from the current transaction. | 355 | * be released cleanly from the current transaction. |
356 | * | 356 | * |
@@ -358,25 +358,25 @@ void journal_commit_transaction(journal_t *journal) | |||
358 | * again before modifying the buffer in the new transaction, but | 358 | * again before modifying the buffer in the new transaction, but |
359 | * we do not require it to remember exactly which old buffers it | 359 | * we do not require it to remember exactly which old buffers it |
360 | * has reserved. This is consistent with the existing behaviour | 360 | * has reserved. This is consistent with the existing behaviour |
361 | * that multiple journal_get_write_access() calls to the same | 361 | * that multiple jbd2_journal_get_write_access() calls to the same |
362 | * buffer are perfectly permissable. | 362 | * buffer are perfectly permissable. |
363 | */ | 363 | */ |
364 | while (commit_transaction->t_reserved_list) { | 364 | while (commit_transaction->t_reserved_list) { |
365 | jh = commit_transaction->t_reserved_list; | 365 | jh = commit_transaction->t_reserved_list; |
366 | JBUFFER_TRACE(jh, "reserved, unused: refile"); | 366 | JBUFFER_TRACE(jh, "reserved, unused: refile"); |
367 | /* | 367 | /* |
368 | * A journal_get_undo_access()+journal_release_buffer() may | 368 | * A jbd2_journal_get_undo_access()+jbd2_journal_release_buffer() may |
369 | * leave undo-committed data. | 369 | * leave undo-committed data. |
370 | */ | 370 | */ |
371 | if (jh->b_committed_data) { | 371 | if (jh->b_committed_data) { |
372 | struct buffer_head *bh = jh2bh(jh); | 372 | struct buffer_head *bh = jh2bh(jh); |
373 | 373 | ||
374 | jbd_lock_bh_state(bh); | 374 | jbd_lock_bh_state(bh); |
375 | jbd_slab_free(jh->b_committed_data, bh->b_size); | 375 | jbd2_slab_free(jh->b_committed_data, bh->b_size); |
376 | jh->b_committed_data = NULL; | 376 | jh->b_committed_data = NULL; |
377 | jbd_unlock_bh_state(bh); | 377 | jbd_unlock_bh_state(bh); |
378 | } | 378 | } |
379 | journal_refile_buffer(journal, jh); | 379 | jbd2_journal_refile_buffer(journal, jh); |
380 | } | 380 | } |
381 | 381 | ||
382 | /* | 382 | /* |
@@ -385,7 +385,7 @@ void journal_commit_transaction(journal_t *journal) | |||
385 | * frees some memory | 385 | * frees some memory |
386 | */ | 386 | */ |
387 | spin_lock(&journal->j_list_lock); | 387 | spin_lock(&journal->j_list_lock); |
388 | __journal_clean_checkpoint_list(journal); | 388 | __jbd2_journal_clean_checkpoint_list(journal); |
389 | spin_unlock(&journal->j_list_lock); | 389 | spin_unlock(&journal->j_list_lock); |
390 | 390 | ||
391 | jbd_debug (3, "JBD: commit phase 1\n"); | 391 | jbd_debug (3, "JBD: commit phase 1\n"); |
@@ -393,7 +393,7 @@ void journal_commit_transaction(journal_t *journal) | |||
393 | /* | 393 | /* |
394 | * Switch to a new revoke table. | 394 | * Switch to a new revoke table. |
395 | */ | 395 | */ |
396 | journal_switch_revoke_table(journal); | 396 | jbd2_journal_switch_revoke_table(journal); |
397 | 397 | ||
398 | commit_transaction->t_state = T_FLUSH; | 398 | commit_transaction->t_state = T_FLUSH; |
399 | journal->j_committing_transaction = commit_transaction; | 399 | journal->j_committing_transaction = commit_transaction; |
@@ -450,9 +450,9 @@ void journal_commit_transaction(journal_t *journal) | |||
450 | continue; | 450 | continue; |
451 | } | 451 | } |
452 | if (buffer_jbd(bh) && jh->b_jlist == BJ_Locked) { | 452 | if (buffer_jbd(bh) && jh->b_jlist == BJ_Locked) { |
453 | __journal_unfile_buffer(jh); | 453 | __jbd2_journal_unfile_buffer(jh); |
454 | jbd_unlock_bh_state(bh); | 454 | jbd_unlock_bh_state(bh); |
455 | journal_remove_journal_head(bh); | 455 | jbd2_journal_remove_journal_head(bh); |
456 | put_bh(bh); | 456 | put_bh(bh); |
457 | } else { | 457 | } else { |
458 | jbd_unlock_bh_state(bh); | 458 | jbd_unlock_bh_state(bh); |
@@ -463,9 +463,9 @@ void journal_commit_transaction(journal_t *journal) | |||
463 | spin_unlock(&journal->j_list_lock); | 463 | spin_unlock(&journal->j_list_lock); |
464 | 464 | ||
465 | if (err) | 465 | if (err) |
466 | __journal_abort_hard(journal); | 466 | __jbd2_journal_abort_hard(journal); |
467 | 467 | ||
468 | journal_write_revoke_records(journal, commit_transaction); | 468 | jbd2_journal_write_revoke_records(journal, commit_transaction); |
469 | 469 | ||
470 | jbd_debug(3, "JBD: commit phase 2\n"); | 470 | jbd_debug(3, "JBD: commit phase 2\n"); |
471 | 471 | ||
@@ -499,7 +499,7 @@ void journal_commit_transaction(journal_t *journal) | |||
499 | 499 | ||
500 | if (is_journal_aborted(journal)) { | 500 | if (is_journal_aborted(journal)) { |
501 | JBUFFER_TRACE(jh, "journal is aborting: refile"); | 501 | JBUFFER_TRACE(jh, "journal is aborting: refile"); |
502 | journal_refile_buffer(journal, jh); | 502 | jbd2_journal_refile_buffer(journal, jh); |
503 | /* If that was the last one, we need to clean up | 503 | /* If that was the last one, we need to clean up |
504 | * any descriptor buffers which may have been | 504 | * any descriptor buffers which may have been |
505 | * already allocated, even if we are now | 505 | * already allocated, even if we are now |
@@ -519,9 +519,9 @@ void journal_commit_transaction(journal_t *journal) | |||
519 | 519 | ||
520 | jbd_debug(4, "JBD: get descriptor\n"); | 520 | jbd_debug(4, "JBD: get descriptor\n"); |
521 | 521 | ||
522 | descriptor = journal_get_descriptor_buffer(journal); | 522 | descriptor = jbd2_journal_get_descriptor_buffer(journal); |
523 | if (!descriptor) { | 523 | if (!descriptor) { |
524 | __journal_abort_hard(journal); | 524 | __jbd2_journal_abort_hard(journal); |
525 | continue; | 525 | continue; |
526 | } | 526 | } |
527 | 527 | ||
@@ -529,8 +529,8 @@ void journal_commit_transaction(journal_t *journal) | |||
529 | jbd_debug(4, "JBD: got buffer %llu (%p)\n", | 529 | jbd_debug(4, "JBD: got buffer %llu (%p)\n", |
530 | (unsigned long long)bh->b_blocknr, bh->b_data); | 530 | (unsigned long long)bh->b_blocknr, bh->b_data); |
531 | header = (journal_header_t *)&bh->b_data[0]; | 531 | header = (journal_header_t *)&bh->b_data[0]; |
532 | header->h_magic = cpu_to_be32(JFS_MAGIC_NUMBER); | 532 | header->h_magic = cpu_to_be32(JBD2_MAGIC_NUMBER); |
533 | header->h_blocktype = cpu_to_be32(JFS_DESCRIPTOR_BLOCK); | 533 | header->h_blocktype = cpu_to_be32(JBD2_DESCRIPTOR_BLOCK); |
534 | header->h_sequence = cpu_to_be32(commit_transaction->t_tid); | 534 | header->h_sequence = cpu_to_be32(commit_transaction->t_tid); |
535 | 535 | ||
536 | tagp = &bh->b_data[sizeof(journal_header_t)]; | 536 | tagp = &bh->b_data[sizeof(journal_header_t)]; |
@@ -543,25 +543,25 @@ void journal_commit_transaction(journal_t *journal) | |||
543 | /* Record it so that we can wait for IO | 543 | /* Record it so that we can wait for IO |
544 | completion later */ | 544 | completion later */ |
545 | BUFFER_TRACE(bh, "ph3: file as descriptor"); | 545 | BUFFER_TRACE(bh, "ph3: file as descriptor"); |
546 | journal_file_buffer(descriptor, commit_transaction, | 546 | jbd2_journal_file_buffer(descriptor, commit_transaction, |
547 | BJ_LogCtl); | 547 | BJ_LogCtl); |
548 | } | 548 | } |
549 | 549 | ||
550 | /* Where is the buffer to be written? */ | 550 | /* Where is the buffer to be written? */ |
551 | 551 | ||
552 | err = journal_next_log_block(journal, &blocknr); | 552 | err = jbd2_journal_next_log_block(journal, &blocknr); |
553 | /* If the block mapping failed, just abandon the buffer | 553 | /* If the block mapping failed, just abandon the buffer |
554 | and repeat this loop: we'll fall into the | 554 | and repeat this loop: we'll fall into the |
555 | refile-on-abort condition above. */ | 555 | refile-on-abort condition above. */ |
556 | if (err) { | 556 | if (err) { |
557 | __journal_abort_hard(journal); | 557 | __jbd2_journal_abort_hard(journal); |
558 | continue; | 558 | continue; |
559 | } | 559 | } |
560 | 560 | ||
561 | /* | 561 | /* |
562 | * start_this_handle() uses t_outstanding_credits to determine | 562 | * start_this_handle() uses t_outstanding_credits to determine |
563 | * the free space in the log, but this counter is changed | 563 | * the free space in the log, but this counter is changed |
564 | * by journal_next_log_block() also. | 564 | * by jbd2_journal_next_log_block() also. |
565 | */ | 565 | */ |
566 | commit_transaction->t_outstanding_credits--; | 566 | commit_transaction->t_outstanding_credits--; |
567 | 567 | ||
@@ -576,13 +576,13 @@ void journal_commit_transaction(journal_t *journal) | |||
576 | 576 | ||
577 | set_bit(BH_JWrite, &jh2bh(jh)->b_state); | 577 | set_bit(BH_JWrite, &jh2bh(jh)->b_state); |
578 | /* | 578 | /* |
579 | * akpm: journal_write_metadata_buffer() sets | 579 | * akpm: jbd2_journal_write_metadata_buffer() sets |
580 | * new_bh->b_transaction to commit_transaction. | 580 | * new_bh->b_transaction to commit_transaction. |
581 | * We need to clean this up before we release new_bh | 581 | * We need to clean this up before we release new_bh |
582 | * (which is of type BJ_IO) | 582 | * (which is of type BJ_IO) |
583 | */ | 583 | */ |
584 | JBUFFER_TRACE(jh, "ph3: write metadata"); | 584 | JBUFFER_TRACE(jh, "ph3: write metadata"); |
585 | flags = journal_write_metadata_buffer(commit_transaction, | 585 | flags = jbd2_journal_write_metadata_buffer(commit_transaction, |
586 | jh, &new_jh, blocknr); | 586 | jh, &new_jh, blocknr); |
587 | set_bit(BH_JWrite, &jh2bh(new_jh)->b_state); | 587 | set_bit(BH_JWrite, &jh2bh(new_jh)->b_state); |
588 | wbuf[bufs++] = jh2bh(new_jh); | 588 | wbuf[bufs++] = jh2bh(new_jh); |
@@ -592,9 +592,9 @@ void journal_commit_transaction(journal_t *journal) | |||
592 | 592 | ||
593 | tag_flag = 0; | 593 | tag_flag = 0; |
594 | if (flags & 1) | 594 | if (flags & 1) |
595 | tag_flag |= JFS_FLAG_ESCAPE; | 595 | tag_flag |= JBD2_FLAG_ESCAPE; |
596 | if (!first_tag) | 596 | if (!first_tag) |
597 | tag_flag |= JFS_FLAG_SAME_UUID; | 597 | tag_flag |= JBD2_FLAG_SAME_UUID; |
598 | 598 | ||
599 | tag = (journal_block_tag_t *) tagp; | 599 | tag = (journal_block_tag_t *) tagp; |
600 | tag->t_blocknr = cpu_to_be32(jh2bh(jh)->b_blocknr); | 600 | tag->t_blocknr = cpu_to_be32(jh2bh(jh)->b_blocknr); |
@@ -622,7 +622,7 @@ void journal_commit_transaction(journal_t *journal) | |||
622 | submitting the IOs. "tag" still points to | 622 | submitting the IOs. "tag" still points to |
623 | the last tag we set up. */ | 623 | the last tag we set up. */ |
624 | 624 | ||
625 | tag->t_flags |= cpu_to_be32(JFS_FLAG_LAST_TAG); | 625 | tag->t_flags |= cpu_to_be32(JBD2_FLAG_LAST_TAG); |
626 | 626 | ||
627 | start_journal_io: | 627 | start_journal_io: |
628 | for (i = 0; i < bufs; i++) { | 628 | for (i = 0; i < bufs; i++) { |
@@ -678,14 +678,14 @@ wait_for_iobuf: | |||
678 | clear_buffer_jwrite(bh); | 678 | clear_buffer_jwrite(bh); |
679 | 679 | ||
680 | JBUFFER_TRACE(jh, "ph4: unfile after journal write"); | 680 | JBUFFER_TRACE(jh, "ph4: unfile after journal write"); |
681 | journal_unfile_buffer(journal, jh); | 681 | jbd2_journal_unfile_buffer(journal, jh); |
682 | 682 | ||
683 | /* | 683 | /* |
684 | * ->t_iobuf_list should contain only dummy buffer_heads | 684 | * ->t_iobuf_list should contain only dummy buffer_heads |
685 | * which were created by journal_write_metadata_buffer(). | 685 | * which were created by jbd2_journal_write_metadata_buffer(). |
686 | */ | 686 | */ |
687 | BUFFER_TRACE(bh, "dumping temporary bh"); | 687 | BUFFER_TRACE(bh, "dumping temporary bh"); |
688 | journal_put_journal_head(jh); | 688 | jbd2_journal_put_journal_head(jh); |
689 | __brelse(bh); | 689 | __brelse(bh); |
690 | J_ASSERT_BH(bh, atomic_read(&bh->b_count) == 0); | 690 | J_ASSERT_BH(bh, atomic_read(&bh->b_count) == 0); |
691 | free_buffer_head(bh); | 691 | free_buffer_head(bh); |
@@ -702,7 +702,7 @@ wait_for_iobuf: | |||
702 | we finally commit, we can do any checkpointing | 702 | we finally commit, we can do any checkpointing |
703 | required. */ | 703 | required. */ |
704 | JBUFFER_TRACE(jh, "file as BJ_Forget"); | 704 | JBUFFER_TRACE(jh, "file as BJ_Forget"); |
705 | journal_file_buffer(jh, commit_transaction, BJ_Forget); | 705 | jbd2_journal_file_buffer(jh, commit_transaction, BJ_Forget); |
706 | /* Wake up any transactions which were waiting for this | 706 | /* Wake up any transactions which were waiting for this |
707 | IO to complete */ | 707 | IO to complete */ |
708 | wake_up_bit(&bh->b_state, BH_Unshadow); | 708 | wake_up_bit(&bh->b_state, BH_Unshadow); |
@@ -733,8 +733,8 @@ wait_for_iobuf: | |||
733 | 733 | ||
734 | BUFFER_TRACE(bh, "ph5: control buffer writeout done: unfile"); | 734 | BUFFER_TRACE(bh, "ph5: control buffer writeout done: unfile"); |
735 | clear_buffer_jwrite(bh); | 735 | clear_buffer_jwrite(bh); |
736 | journal_unfile_buffer(journal, jh); | 736 | jbd2_journal_unfile_buffer(journal, jh); |
737 | journal_put_journal_head(jh); | 737 | jbd2_journal_put_journal_head(jh); |
738 | __brelse(bh); /* One for getblk */ | 738 | __brelse(bh); /* One for getblk */ |
739 | /* AKPM: bforget here */ | 739 | /* AKPM: bforget here */ |
740 | } | 740 | } |
@@ -745,7 +745,7 @@ wait_for_iobuf: | |||
745 | err = -EIO; | 745 | err = -EIO; |
746 | 746 | ||
747 | if (err) | 747 | if (err) |
748 | __journal_abort_hard(journal); | 748 | __jbd2_journal_abort_hard(journal); |
749 | 749 | ||
750 | /* End of a transaction! Finally, we can do checkpoint | 750 | /* End of a transaction! Finally, we can do checkpoint |
751 | processing: any buffers committed as a result of this | 751 | processing: any buffers committed as a result of this |
@@ -789,14 +789,14 @@ restart_loop: | |||
789 | * Otherwise, we can just throw away the frozen data now. | 789 | * Otherwise, we can just throw away the frozen data now. |
790 | */ | 790 | */ |
791 | if (jh->b_committed_data) { | 791 | if (jh->b_committed_data) { |
792 | jbd_slab_free(jh->b_committed_data, bh->b_size); | 792 | jbd2_slab_free(jh->b_committed_data, bh->b_size); |
793 | jh->b_committed_data = NULL; | 793 | jh->b_committed_data = NULL; |
794 | if (jh->b_frozen_data) { | 794 | if (jh->b_frozen_data) { |
795 | jh->b_committed_data = jh->b_frozen_data; | 795 | jh->b_committed_data = jh->b_frozen_data; |
796 | jh->b_frozen_data = NULL; | 796 | jh->b_frozen_data = NULL; |
797 | } | 797 | } |
798 | } else if (jh->b_frozen_data) { | 798 | } else if (jh->b_frozen_data) { |
799 | jbd_slab_free(jh->b_frozen_data, bh->b_size); | 799 | jbd2_slab_free(jh->b_frozen_data, bh->b_size); |
800 | jh->b_frozen_data = NULL; | 800 | jh->b_frozen_data = NULL; |
801 | } | 801 | } |
802 | 802 | ||
@@ -804,12 +804,12 @@ restart_loop: | |||
804 | cp_transaction = jh->b_cp_transaction; | 804 | cp_transaction = jh->b_cp_transaction; |
805 | if (cp_transaction) { | 805 | if (cp_transaction) { |
806 | JBUFFER_TRACE(jh, "remove from old cp transaction"); | 806 | JBUFFER_TRACE(jh, "remove from old cp transaction"); |
807 | __journal_remove_checkpoint(jh); | 807 | __jbd2_journal_remove_checkpoint(jh); |
808 | } | 808 | } |
809 | 809 | ||
810 | /* Only re-checkpoint the buffer_head if it is marked | 810 | /* Only re-checkpoint the buffer_head if it is marked |
811 | * dirty. If the buffer was added to the BJ_Forget list | 811 | * dirty. If the buffer was added to the BJ_Forget list |
812 | * by journal_forget, it may no longer be dirty and | 812 | * by jbd2_journal_forget, it may no longer be dirty and |
813 | * there's no point in keeping a checkpoint record for | 813 | * there's no point in keeping a checkpoint record for |
814 | * it. */ | 814 | * it. */ |
815 | 815 | ||
@@ -828,9 +828,9 @@ restart_loop: | |||
828 | 828 | ||
829 | if (buffer_jbddirty(bh)) { | 829 | if (buffer_jbddirty(bh)) { |
830 | JBUFFER_TRACE(jh, "add to new checkpointing trans"); | 830 | JBUFFER_TRACE(jh, "add to new checkpointing trans"); |
831 | __journal_insert_checkpoint(jh, commit_transaction); | 831 | __jbd2_journal_insert_checkpoint(jh, commit_transaction); |
832 | JBUFFER_TRACE(jh, "refile for checkpoint writeback"); | 832 | JBUFFER_TRACE(jh, "refile for checkpoint writeback"); |
833 | __journal_refile_buffer(jh); | 833 | __jbd2_journal_refile_buffer(jh); |
834 | jbd_unlock_bh_state(bh); | 834 | jbd_unlock_bh_state(bh); |
835 | } else { | 835 | } else { |
836 | J_ASSERT_BH(bh, !buffer_dirty(bh)); | 836 | J_ASSERT_BH(bh, !buffer_dirty(bh)); |
@@ -842,11 +842,11 @@ restart_loop: | |||
842 | * disk and before we process the buffer on BJ_Forget | 842 | * disk and before we process the buffer on BJ_Forget |
843 | * list. */ | 843 | * list. */ |
844 | JBUFFER_TRACE(jh, "refile or unfile freed buffer"); | 844 | JBUFFER_TRACE(jh, "refile or unfile freed buffer"); |
845 | __journal_refile_buffer(jh); | 845 | __jbd2_journal_refile_buffer(jh); |
846 | if (!jh->b_transaction) { | 846 | if (!jh->b_transaction) { |
847 | jbd_unlock_bh_state(bh); | 847 | jbd_unlock_bh_state(bh); |
848 | /* needs a brelse */ | 848 | /* needs a brelse */ |
849 | journal_remove_journal_head(bh); | 849 | jbd2_journal_remove_journal_head(bh); |
850 | release_buffer_page(bh); | 850 | release_buffer_page(bh); |
851 | } else | 851 | } else |
852 | jbd_unlock_bh_state(bh); | 852 | jbd_unlock_bh_state(bh); |
@@ -856,9 +856,9 @@ restart_loop: | |||
856 | spin_unlock(&journal->j_list_lock); | 856 | spin_unlock(&journal->j_list_lock); |
857 | /* | 857 | /* |
858 | * This is a bit sleazy. We borrow j_list_lock to protect | 858 | * This is a bit sleazy. We borrow j_list_lock to protect |
859 | * journal->j_committing_transaction in __journal_remove_checkpoint. | 859 | * journal->j_committing_transaction in __jbd2_journal_remove_checkpoint. |
860 | * Really, __journal_remove_checkpoint should be using j_state_lock but | 860 | * Really, __jbd2_journal_remove_checkpoint should be using j_state_lock but |
861 | * it's a bit hassle to hold that across __journal_remove_checkpoint | 861 | * it's a bit hassle to hold that across __jbd2_journal_remove_checkpoint |
862 | */ | 862 | */ |
863 | spin_lock(&journal->j_state_lock); | 863 | spin_lock(&journal->j_state_lock); |
864 | spin_lock(&journal->j_list_lock); | 864 | spin_lock(&journal->j_list_lock); |
@@ -885,7 +885,7 @@ restart_loop: | |||
885 | spin_unlock(&journal->j_state_lock); | 885 | spin_unlock(&journal->j_state_lock); |
886 | 886 | ||
887 | if (commit_transaction->t_checkpoint_list == NULL) { | 887 | if (commit_transaction->t_checkpoint_list == NULL) { |
888 | __journal_drop_transaction(journal, commit_transaction); | 888 | __jbd2_journal_drop_transaction(journal, commit_transaction); |
889 | } else { | 889 | } else { |
890 | if (journal->j_checkpoint_transactions == NULL) { | 890 | if (journal->j_checkpoint_transactions == NULL) { |
891 | journal->j_checkpoint_transactions = commit_transaction; | 891 | journal->j_checkpoint_transactions = commit_transaction; |