aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2009-06-15 21:08:07 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-06-15 21:08:07 -0400
commit7eef4091a653c243a87e5375c54504cc03bec4d8 (patch)
treef65b77f830b2c8f7d014512badfef5df0d591ee9 /fs/jbd
parent0a93a47f042c459f0f46942c3a920e3c81878031 (diff)
parent07a2039b8eb0af4ff464efd3dfd95de5c02648c6 (diff)
Merge commit 'v2.6.30' into for-2.6.31
Diffstat (limited to 'fs/jbd')
-rw-r--r--fs/jbd/commit.c8
-rw-r--r--fs/jbd/revoke.c20
2 files changed, 16 insertions, 12 deletions
diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c
index a8e8513a78a..618e21c0b7a 100644
--- a/fs/jbd/commit.c
+++ b/fs/jbd/commit.c
@@ -241,7 +241,7 @@ write_out_data:
241 spin_lock(&journal->j_list_lock); 241 spin_lock(&journal->j_list_lock);
242 } 242 }
243 /* Someone already cleaned up the buffer? */ 243 /* Someone already cleaned up the buffer? */
244 if (!buffer_jbd(bh) 244 if (!buffer_jbd(bh) || bh2jh(bh) != jh
245 || jh->b_transaction != commit_transaction 245 || jh->b_transaction != commit_transaction
246 || jh->b_jlist != BJ_SyncData) { 246 || jh->b_jlist != BJ_SyncData) {
247 jbd_unlock_bh_state(bh); 247 jbd_unlock_bh_state(bh);
@@ -478,7 +478,9 @@ void journal_commit_transaction(journal_t *journal)
478 spin_lock(&journal->j_list_lock); 478 spin_lock(&journal->j_list_lock);
479 continue; 479 continue;
480 } 480 }
481 if (buffer_jbd(bh) && jh->b_jlist == BJ_Locked) { 481 if (buffer_jbd(bh) && bh2jh(bh) == jh &&
482 jh->b_transaction == commit_transaction &&
483 jh->b_jlist == BJ_Locked) {
482 __journal_unfile_buffer(jh); 484 __journal_unfile_buffer(jh);
483 jbd_unlock_bh_state(bh); 485 jbd_unlock_bh_state(bh);
484 journal_remove_journal_head(bh); 486 journal_remove_journal_head(bh);
@@ -502,7 +504,7 @@ void journal_commit_transaction(journal_t *journal)
502 err = 0; 504 err = 0;
503 } 505 }
504 506
505 journal_write_revoke_records(journal, commit_transaction); 507 journal_write_revoke_records(journal, commit_transaction, write_op);
506 508
507 /* 509 /*
508 * If we found any dirty or locked buffers, then we should have 510 * If we found any dirty or locked buffers, then we should have
diff --git a/fs/jbd/revoke.c b/fs/jbd/revoke.c
index 3e9afc2a91d..da6cd9bdaab 100644
--- a/fs/jbd/revoke.c
+++ b/fs/jbd/revoke.c
@@ -86,6 +86,7 @@
86#include <linux/slab.h> 86#include <linux/slab.h>
87#include <linux/list.h> 87#include <linux/list.h>
88#include <linux/init.h> 88#include <linux/init.h>
89#include <linux/bio.h>
89#endif 90#endif
90#include <linux/log2.h> 91#include <linux/log2.h>
91 92
@@ -118,8 +119,8 @@ struct jbd_revoke_table_s
118#ifdef __KERNEL__ 119#ifdef __KERNEL__
119static void write_one_revoke_record(journal_t *, transaction_t *, 120static void write_one_revoke_record(journal_t *, transaction_t *,
120 struct journal_head **, int *, 121 struct journal_head **, int *,
121 struct jbd_revoke_record_s *); 122 struct jbd_revoke_record_s *, int);
122static void flush_descriptor(journal_t *, struct journal_head *, int); 123static void flush_descriptor(journal_t *, struct journal_head *, int, int);
123#endif 124#endif
124 125
125/* Utility functions to maintain the revoke table */ 126/* Utility functions to maintain the revoke table */
@@ -500,7 +501,7 @@ void journal_switch_revoke_table(journal_t *journal)
500 * revoke hash, deleting the entries as we go. 501 * revoke hash, deleting the entries as we go.
501 */ 502 */
502void journal_write_revoke_records(journal_t *journal, 503void journal_write_revoke_records(journal_t *journal,
503 transaction_t *transaction) 504 transaction_t *transaction, int write_op)
504{ 505{
505 struct journal_head *descriptor; 506 struct journal_head *descriptor;
506 struct jbd_revoke_record_s *record; 507 struct jbd_revoke_record_s *record;
@@ -524,14 +525,14 @@ void journal_write_revoke_records(journal_t *journal,
524 hash_list->next; 525 hash_list->next;
525 write_one_revoke_record(journal, transaction, 526 write_one_revoke_record(journal, transaction,
526 &descriptor, &offset, 527 &descriptor, &offset,
527 record); 528 record, write_op);
528 count++; 529 count++;
529 list_del(&record->hash); 530 list_del(&record->hash);
530 kmem_cache_free(revoke_record_cache, record); 531 kmem_cache_free(revoke_record_cache, record);
531 } 532 }
532 } 533 }
533 if (descriptor) 534 if (descriptor)
534 flush_descriptor(journal, descriptor, offset); 535 flush_descriptor(journal, descriptor, offset, write_op);
535 jbd_debug(1, "Wrote %d revoke records\n", count); 536 jbd_debug(1, "Wrote %d revoke records\n", count);
536} 537}
537 538
@@ -544,7 +545,8 @@ static void write_one_revoke_record(journal_t *journal,
544 transaction_t *transaction, 545 transaction_t *transaction,
545 struct journal_head **descriptorp, 546 struct journal_head **descriptorp,
546 int *offsetp, 547 int *offsetp,
547 struct jbd_revoke_record_s *record) 548 struct jbd_revoke_record_s *record,
549 int write_op)
548{ 550{
549 struct journal_head *descriptor; 551 struct journal_head *descriptor;
550 int offset; 552 int offset;
@@ -563,7 +565,7 @@ static void write_one_revoke_record(journal_t *journal,
563 /* Make sure we have a descriptor with space left for the record */ 565 /* Make sure we have a descriptor with space left for the record */
564 if (descriptor) { 566 if (descriptor) {
565 if (offset == journal->j_blocksize) { 567 if (offset == journal->j_blocksize) {
566 flush_descriptor(journal, descriptor, offset); 568 flush_descriptor(journal, descriptor, offset, write_op);
567 descriptor = NULL; 569 descriptor = NULL;
568 } 570 }
569 } 571 }
@@ -600,7 +602,7 @@ static void write_one_revoke_record(journal_t *journal,
600 602
601static void flush_descriptor(journal_t *journal, 603static void flush_descriptor(journal_t *journal,
602 struct journal_head *descriptor, 604 struct journal_head *descriptor,
603 int offset) 605 int offset, int write_op)
604{ 606{
605 journal_revoke_header_t *header; 607 journal_revoke_header_t *header;
606 struct buffer_head *bh = jh2bh(descriptor); 608 struct buffer_head *bh = jh2bh(descriptor);
@@ -615,7 +617,7 @@ static void flush_descriptor(journal_t *journal,
615 set_buffer_jwrite(bh); 617 set_buffer_jwrite(bh);
616 BUFFER_TRACE(bh, "write"); 618 BUFFER_TRACE(bh, "write");
617 set_buffer_dirty(bh); 619 set_buffer_dirty(bh);
618 ll_rw_block(SWRITE, 1, &bh); 620 ll_rw_block((write_op == WRITE) ? SWRITE : SWRITE_SYNC_PLUG, 1, &bh);
619} 621}
620#endif 622#endif
621 623