1 jbd2: remove unnecessary arguments of jbd2_journal_write_revoke_records
3 From: Jan Kara <jack@suse.cz>
5 jbd2_journal_write_revoke_records() takes journal pointer and write_op,
6 although journal can be obtained from the passed transaction and
7 write_op is always WRITE_SYNC. Remove these superfluous arguments.
9 Signed-off-by: Jan Kara <jack@suse.cz>
10 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 fs/jbd2/commit.c | 3 +--
13 fs/jbd2/revoke.c | 33 +++++++++++++++------------------
14 include/linux/jbd2.h | 6 ++----
15 3 files changed, 18 insertions(+), 24 deletions(-)
17 diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
18 index 36345fefa3ff..ae4402d15d46 100644
19 --- a/fs/jbd2/commit.c
20 +++ b/fs/jbd2/commit.c
21 @@ -554,8 +554,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
22 jbd2_journal_abort(journal, err);
24 blk_start_plug(&plug);
25 - jbd2_journal_write_revoke_records(journal, commit_transaction,
26 - &log_bufs, WRITE_SYNC);
27 + jbd2_journal_write_revoke_records(commit_transaction, &log_bufs);
29 jbd_debug(3, "JBD2: commit phase 2b\n");
31 diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c
32 index 705ae577882b..c839332be56b 100644
33 --- a/fs/jbd2/revoke.c
34 +++ b/fs/jbd2/revoke.c
35 @@ -122,11 +122,11 @@ struct jbd2_revoke_table_s
39 -static void write_one_revoke_record(journal_t *, transaction_t *,
40 +static void write_one_revoke_record(transaction_t *,
42 struct buffer_head **, int *,
43 - struct jbd2_revoke_record_s *, int);
44 -static void flush_descriptor(journal_t *, struct buffer_head *, int, int);
45 + struct jbd2_revoke_record_s *);
46 +static void flush_descriptor(journal_t *, struct buffer_head *, int);
49 /* Utility functions to maintain the revoke table */
50 @@ -519,11 +519,10 @@ void jbd2_journal_switch_revoke_table(journal_t *journal)
51 * Write revoke records to the journal for all entries in the current
52 * revoke hash, deleting the entries as we go.
54 -void jbd2_journal_write_revoke_records(journal_t *journal,
55 - transaction_t *transaction,
56 - struct list_head *log_bufs,
58 +void jbd2_journal_write_revoke_records(transaction_t *transaction,
59 + struct list_head *log_bufs)
61 + journal_t *journal = transaction->t_journal;
62 struct buffer_head *descriptor;
63 struct jbd2_revoke_record_s *record;
64 struct jbd2_revoke_table_s *revoke;
65 @@ -544,16 +543,15 @@ void jbd2_journal_write_revoke_records(journal_t *journal,
66 while (!list_empty(hash_list)) {
67 record = (struct jbd2_revoke_record_s *)
69 - write_one_revoke_record(journal, transaction, log_bufs,
70 - &descriptor, &offset,
72 + write_one_revoke_record(transaction, log_bufs,
73 + &descriptor, &offset, record);
75 list_del(&record->hash);
76 kmem_cache_free(jbd2_revoke_record_cache, record);
80 - flush_descriptor(journal, descriptor, offset, write_op);
81 + flush_descriptor(journal, descriptor, offset);
82 jbd_debug(1, "Wrote %d revoke records\n", count);
85 @@ -562,14 +560,13 @@ void jbd2_journal_write_revoke_records(journal_t *journal,
86 * block if the old one is full or if we have not already created one.
89 -static void write_one_revoke_record(journal_t *journal,
90 - transaction_t *transaction,
91 +static void write_one_revoke_record(transaction_t *transaction,
92 struct list_head *log_bufs,
93 struct buffer_head **descriptorp,
95 - struct jbd2_revoke_record_s *record,
97 + struct jbd2_revoke_record_s *record)
99 + journal_t *journal = transaction->t_journal;
101 struct buffer_head *descriptor;
103 @@ -597,7 +594,7 @@ static void write_one_revoke_record(journal_t *journal,
104 /* Make sure we have a descriptor with space left for the record */
106 if (offset + sz > journal->j_blocksize - csum_size) {
107 - flush_descriptor(journal, descriptor, offset, write_op);
108 + flush_descriptor(journal, descriptor, offset);
112 @@ -654,7 +651,7 @@ static void jbd2_revoke_csum_set(journal_t *j, struct buffer_head *bh)
114 static void flush_descriptor(journal_t *journal,
115 struct buffer_head *descriptor,
116 - int offset, int write_op)
119 jbd2_journal_revoke_header_t *header;
121 @@ -670,7 +667,7 @@ static void flush_descriptor(journal_t *journal,
122 set_buffer_jwrite(descriptor);
123 BUFFER_TRACE(descriptor, "write");
124 set_buffer_dirty(descriptor);
125 - write_dirty_buffer(descriptor, write_op);
126 + write_dirty_buffer(descriptor, WRITE_SYNC);
130 diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
131 index 65407f6c9120..5716d9554e77 100644
132 --- a/include/linux/jbd2.h
133 +++ b/include/linux/jbd2.h
134 @@ -1327,10 +1327,8 @@ extern int jbd2_journal_init_revoke_caches(void);
135 extern void jbd2_journal_destroy_revoke(journal_t *);
136 extern int jbd2_journal_revoke (handle_t *, unsigned long long, struct buffer_head *);
137 extern int jbd2_journal_cancel_revoke(handle_t *, struct journal_head *);
138 -extern void jbd2_journal_write_revoke_records(journal_t *journal,
139 - transaction_t *transaction,
140 - struct list_head *log_bufs,
142 +extern void jbd2_journal_write_revoke_records(transaction_t *transaction,
143 + struct list_head *log_bufs);
145 /* Recovery revoke support */
146 extern int jbd2_journal_set_revoke(journal_t *, unsigned long long, tid_t);