aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd2
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2016-02-22 23:07:30 -0500
committerTheodore Ts'o <tytso@mit.edu>2016-02-22 23:07:30 -0500
commit9bcf976cb8b86eb40e0c0b495a14e4cb967b9c6e (patch)
tree96a20bb05e28fc973bd8112720a668bdeb6428bf /fs/jbd2
parent29c6eaffc8868ef6fa71997d0ea507a02c52712c (diff)
jbd2: remove unnecessary arguments of jbd2_journal_write_revoke_records
jbd2_journal_write_revoke_records() takes journal pointer and write_op, although journal can be obtained from the passed transaction and write_op is always WRITE_SYNC. Remove these superfluous arguments. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/jbd2')
-rw-r--r--fs/jbd2/commit.c3
-rw-r--r--fs/jbd2/revoke.c33
2 files changed, 16 insertions, 20 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index 36345fefa3ff..ae4402d15d46 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -554,8 +554,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
554 jbd2_journal_abort(journal, err); 554 jbd2_journal_abort(journal, err);
555 555
556 blk_start_plug(&plug); 556 blk_start_plug(&plug);
557 jbd2_journal_write_revoke_records(journal, commit_transaction, 557 jbd2_journal_write_revoke_records(commit_transaction, &log_bufs);
558 &log_bufs, WRITE_SYNC);
559 558
560 jbd_debug(3, "JBD2: commit phase 2b\n"); 559 jbd_debug(3, "JBD2: commit phase 2b\n");
561 560
diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c
index 705ae577882b..c839332be56b 100644
--- a/fs/jbd2/revoke.c
+++ b/fs/jbd2/revoke.c
@@ -122,11 +122,11 @@ struct jbd2_revoke_table_s
122 122
123 123
124#ifdef __KERNEL__ 124#ifdef __KERNEL__
125static void write_one_revoke_record(journal_t *, transaction_t *, 125static void write_one_revoke_record(transaction_t *,
126 struct list_head *, 126 struct list_head *,
127 struct buffer_head **, int *, 127 struct buffer_head **, int *,
128 struct jbd2_revoke_record_s *, int); 128 struct jbd2_revoke_record_s *);
129static void flush_descriptor(journal_t *, struct buffer_head *, int, int); 129static void flush_descriptor(journal_t *, struct buffer_head *, int);
130#endif 130#endif
131 131
132/* Utility functions to maintain the revoke table */ 132/* Utility functions to maintain the revoke table */
@@ -519,11 +519,10 @@ void jbd2_journal_switch_revoke_table(journal_t *journal)
519 * Write revoke records to the journal for all entries in the current 519 * Write revoke records to the journal for all entries in the current
520 * revoke hash, deleting the entries as we go. 520 * revoke hash, deleting the entries as we go.
521 */ 521 */
522void jbd2_journal_write_revoke_records(journal_t *journal, 522void jbd2_journal_write_revoke_records(transaction_t *transaction,
523 transaction_t *transaction, 523 struct list_head *log_bufs)
524 struct list_head *log_bufs,
525 int write_op)
526{ 524{
525 journal_t *journal = transaction->t_journal;
527 struct buffer_head *descriptor; 526 struct buffer_head *descriptor;
528 struct jbd2_revoke_record_s *record; 527 struct jbd2_revoke_record_s *record;
529 struct jbd2_revoke_table_s *revoke; 528 struct jbd2_revoke_table_s *revoke;
@@ -544,16 +543,15 @@ void jbd2_journal_write_revoke_records(journal_t *journal,
544 while (!list_empty(hash_list)) { 543 while (!list_empty(hash_list)) {
545 record = (struct jbd2_revoke_record_s *) 544 record = (struct jbd2_revoke_record_s *)
546 hash_list->next; 545 hash_list->next;
547 write_one_revoke_record(journal, transaction, log_bufs, 546 write_one_revoke_record(transaction, log_bufs,
548 &descriptor, &offset, 547 &descriptor, &offset, record);
549 record, write_op);
550 count++; 548 count++;
551 list_del(&record->hash); 549 list_del(&record->hash);
552 kmem_cache_free(jbd2_revoke_record_cache, record); 550 kmem_cache_free(jbd2_revoke_record_cache, record);
553 } 551 }
554 } 552 }
555 if (descriptor) 553 if (descriptor)
556 flush_descriptor(journal, descriptor, offset, write_op); 554 flush_descriptor(journal, descriptor, offset);
557 jbd_debug(1, "Wrote %d revoke records\n", count); 555 jbd_debug(1, "Wrote %d revoke records\n", count);
558} 556}
559 557
@@ -562,14 +560,13 @@ void jbd2_journal_write_revoke_records(journal_t *journal,
562 * block if the old one is full or if we have not already created one. 560 * block if the old one is full or if we have not already created one.
563 */ 561 */
564 562
565static void write_one_revoke_record(journal_t *journal, 563static void write_one_revoke_record(transaction_t *transaction,
566 transaction_t *transaction,
567 struct list_head *log_bufs, 564 struct list_head *log_bufs,
568 struct buffer_head **descriptorp, 565 struct buffer_head **descriptorp,
569 int *offsetp, 566 int *offsetp,
570 struct jbd2_revoke_record_s *record, 567 struct jbd2_revoke_record_s *record)
571 int write_op)
572{ 568{
569 journal_t *journal = transaction->t_journal;
573 int csum_size = 0; 570 int csum_size = 0;
574 struct buffer_head *descriptor; 571 struct buffer_head *descriptor;
575 int sz, offset; 572 int sz, offset;
@@ -597,7 +594,7 @@ static void write_one_revoke_record(journal_t *journal,
597 /* Make sure we have a descriptor with space left for the record */ 594 /* Make sure we have a descriptor with space left for the record */
598 if (descriptor) { 595 if (descriptor) {
599 if (offset + sz > journal->j_blocksize - csum_size) { 596 if (offset + sz > journal->j_blocksize - csum_size) {
600 flush_descriptor(journal, descriptor, offset, write_op); 597 flush_descriptor(journal, descriptor, offset);
601 descriptor = NULL; 598 descriptor = NULL;
602 } 599 }
603 } 600 }
@@ -654,7 +651,7 @@ static void jbd2_revoke_csum_set(journal_t *j, struct buffer_head *bh)
654 651
655static void flush_descriptor(journal_t *journal, 652static void flush_descriptor(journal_t *journal,
656 struct buffer_head *descriptor, 653 struct buffer_head *descriptor,
657 int offset, int write_op) 654 int offset)
658{ 655{
659 jbd2_journal_revoke_header_t *header; 656 jbd2_journal_revoke_header_t *header;
660 657
@@ -670,7 +667,7 @@ static void flush_descriptor(journal_t *journal,
670 set_buffer_jwrite(descriptor); 667 set_buffer_jwrite(descriptor);
671 BUFFER_TRACE(descriptor, "write"); 668 BUFFER_TRACE(descriptor, "write");
672 set_buffer_dirty(descriptor); 669 set_buffer_dirty(descriptor);
673 write_dirty_buffer(descriptor, write_op); 670 write_dirty_buffer(descriptor, WRITE_SYNC);
674} 671}
675#endif 672#endif
676 673