diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-24 11:37:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-24 11:37:40 -0400 |
commit | a4277bf122e907e4fec509fc0bd9bf5fde30b14e (patch) | |
tree | b359e8b0f7895acda1d6331332e69ea5b14d5f0d /fs/jbd | |
parent | 6ae85d6db4871d8dbcb5cc0e9056f97f1ca07061 (diff) | |
parent | b5451f7b2694b04d9f912f6cf09db1729f291996 (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
ext4: Fix potential inode allocation soft lockup in Orlov allocator
ext4: Make the extent validity check more paranoid
jbd: use SWRITE_SYNC_PLUG when writing synchronous revoke records
jbd2: use SWRITE_SYNC_PLUG when writing synchronous revoke records
ext4: really print the find_group_flex fallback warning only once
Diffstat (limited to 'fs/jbd')
-rw-r--r-- | fs/jbd/commit.c | 2 | ||||
-rw-r--r-- | fs/jbd/revoke.c | 20 |
2 files changed, 12 insertions, 10 deletions
diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c index a8e8513a78a9..06560c520f49 100644 --- a/fs/jbd/commit.c +++ b/fs/jbd/commit.c | |||
@@ -502,7 +502,7 @@ void journal_commit_transaction(journal_t *journal) | |||
502 | err = 0; | 502 | err = 0; |
503 | } | 503 | } |
504 | 504 | ||
505 | journal_write_revoke_records(journal, commit_transaction); | 505 | journal_write_revoke_records(journal, commit_transaction, write_op); |
506 | 506 | ||
507 | /* | 507 | /* |
508 | * If we found any dirty or locked buffers, then we should have | 508 | * 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 3e9afc2a91d2..da6cd9bdaabc 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__ |
119 | static void write_one_revoke_record(journal_t *, transaction_t *, | 120 | static 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); |
122 | static void flush_descriptor(journal_t *, struct journal_head *, int); | 123 | static 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 | */ |
502 | void journal_write_revoke_records(journal_t *journal, | 503 | void 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 | ||
601 | static void flush_descriptor(journal_t *journal, | 603 | static 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 | ||