Commit 9bcf976c authored by Jan Kara's avatar Jan Kara Committed by Theodore Ts'o

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: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 29c6eaff
...@@ -554,8 +554,7 @@ void jbd2_journal_commit_transaction(journal_t *journal) ...@@ -554,8 +554,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
jbd2_journal_abort(journal, err); jbd2_journal_abort(journal, err);
blk_start_plug(&plug); blk_start_plug(&plug);
jbd2_journal_write_revoke_records(journal, commit_transaction, jbd2_journal_write_revoke_records(commit_transaction, &log_bufs);
&log_bufs, WRITE_SYNC);
jbd_debug(3, "JBD2: commit phase 2b\n"); jbd_debug(3, "JBD2: commit phase 2b\n");
......
...@@ -122,11 +122,11 @@ struct jbd2_revoke_table_s ...@@ -122,11 +122,11 @@ struct jbd2_revoke_table_s
#ifdef __KERNEL__ #ifdef __KERNEL__
static void write_one_revoke_record(journal_t *, transaction_t *, static void write_one_revoke_record(transaction_t *,
struct list_head *, struct list_head *,
struct buffer_head **, int *, struct buffer_head **, int *,
struct jbd2_revoke_record_s *, int); struct jbd2_revoke_record_s *);
static void flush_descriptor(journal_t *, struct buffer_head *, int, int); static void flush_descriptor(journal_t *, struct buffer_head *, int);
#endif #endif
/* Utility functions to maintain the revoke table */ /* Utility functions to maintain the revoke table */
...@@ -519,11 +519,10 @@ void jbd2_journal_switch_revoke_table(journal_t *journal) ...@@ -519,11 +519,10 @@ void jbd2_journal_switch_revoke_table(journal_t *journal)
* Write revoke records to the journal for all entries in the current * Write revoke records to the journal for all entries in the current
* revoke hash, deleting the entries as we go. * revoke hash, deleting the entries as we go.
*/ */
void jbd2_journal_write_revoke_records(journal_t *journal, void jbd2_journal_write_revoke_records(transaction_t *transaction,
transaction_t *transaction, struct list_head *log_bufs)
struct list_head *log_bufs,
int write_op)
{ {
journal_t *journal = transaction->t_journal;
struct buffer_head *descriptor; struct buffer_head *descriptor;
struct jbd2_revoke_record_s *record; struct jbd2_revoke_record_s *record;
struct jbd2_revoke_table_s *revoke; struct jbd2_revoke_table_s *revoke;
...@@ -544,16 +543,15 @@ void jbd2_journal_write_revoke_records(journal_t *journal, ...@@ -544,16 +543,15 @@ void jbd2_journal_write_revoke_records(journal_t *journal,
while (!list_empty(hash_list)) { while (!list_empty(hash_list)) {
record = (struct jbd2_revoke_record_s *) record = (struct jbd2_revoke_record_s *)
hash_list->next; hash_list->next;
write_one_revoke_record(journal, transaction, log_bufs, write_one_revoke_record(transaction, log_bufs,
&descriptor, &offset, &descriptor, &offset, record);
record, write_op);
count++; count++;
list_del(&record->hash); list_del(&record->hash);
kmem_cache_free(jbd2_revoke_record_cache, record); kmem_cache_free(jbd2_revoke_record_cache, record);
} }
} }
if (descriptor) if (descriptor)
flush_descriptor(journal, descriptor, offset, write_op); flush_descriptor(journal, descriptor, offset);
jbd_debug(1, "Wrote %d revoke records\n", count); jbd_debug(1, "Wrote %d revoke records\n", count);
} }
...@@ -562,14 +560,13 @@ void jbd2_journal_write_revoke_records(journal_t *journal, ...@@ -562,14 +560,13 @@ void jbd2_journal_write_revoke_records(journal_t *journal,
* block if the old one is full or if we have not already created one. * block if the old one is full or if we have not already created one.
*/ */
static void write_one_revoke_record(journal_t *journal, static void write_one_revoke_record(transaction_t *transaction,
transaction_t *transaction,
struct list_head *log_bufs, struct list_head *log_bufs,
struct buffer_head **descriptorp, struct buffer_head **descriptorp,
int *offsetp, int *offsetp,
struct jbd2_revoke_record_s *record, struct jbd2_revoke_record_s *record)
int write_op)
{ {
journal_t *journal = transaction->t_journal;
int csum_size = 0; int csum_size = 0;
struct buffer_head *descriptor; struct buffer_head *descriptor;
int sz, offset; int sz, offset;
...@@ -597,7 +594,7 @@ static void write_one_revoke_record(journal_t *journal, ...@@ -597,7 +594,7 @@ static void write_one_revoke_record(journal_t *journal,
/* Make sure we have a descriptor with space left for the record */ /* Make sure we have a descriptor with space left for the record */
if (descriptor) { if (descriptor) {
if (offset + sz > journal->j_blocksize - csum_size) { if (offset + sz > journal->j_blocksize - csum_size) {
flush_descriptor(journal, descriptor, offset, write_op); flush_descriptor(journal, descriptor, offset);
descriptor = NULL; descriptor = NULL;
} }
} }
...@@ -654,7 +651,7 @@ static void jbd2_revoke_csum_set(journal_t *j, struct buffer_head *bh) ...@@ -654,7 +651,7 @@ static void jbd2_revoke_csum_set(journal_t *j, struct buffer_head *bh)
static void flush_descriptor(journal_t *journal, static void flush_descriptor(journal_t *journal,
struct buffer_head *descriptor, struct buffer_head *descriptor,
int offset, int write_op) int offset)
{ {
jbd2_journal_revoke_header_t *header; jbd2_journal_revoke_header_t *header;
...@@ -670,7 +667,7 @@ static void flush_descriptor(journal_t *journal, ...@@ -670,7 +667,7 @@ static void flush_descriptor(journal_t *journal,
set_buffer_jwrite(descriptor); set_buffer_jwrite(descriptor);
BUFFER_TRACE(descriptor, "write"); BUFFER_TRACE(descriptor, "write");
set_buffer_dirty(descriptor); set_buffer_dirty(descriptor);
write_dirty_buffer(descriptor, write_op); write_dirty_buffer(descriptor, WRITE_SYNC);
} }
#endif #endif
......
...@@ -1327,10 +1327,8 @@ extern int jbd2_journal_init_revoke_caches(void); ...@@ -1327,10 +1327,8 @@ extern int jbd2_journal_init_revoke_caches(void);
extern void jbd2_journal_destroy_revoke(journal_t *); extern void jbd2_journal_destroy_revoke(journal_t *);
extern int jbd2_journal_revoke (handle_t *, unsigned long long, struct buffer_head *); extern int jbd2_journal_revoke (handle_t *, unsigned long long, struct buffer_head *);
extern int jbd2_journal_cancel_revoke(handle_t *, struct journal_head *); extern int jbd2_journal_cancel_revoke(handle_t *, struct journal_head *);
extern void jbd2_journal_write_revoke_records(journal_t *journal, extern void jbd2_journal_write_revoke_records(transaction_t *transaction,
transaction_t *transaction, struct list_head *log_bufs);
struct list_head *log_bufs,
int write_op);
/* Recovery revoke support */ /* Recovery revoke support */
extern int jbd2_journal_set_revoke(journal_t *, unsigned long long, tid_t); extern int jbd2_journal_set_revoke(journal_t *, unsigned long long, tid_t);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment