aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd2/revoke.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jbd2/revoke.c')
-rw-r--r--fs/jbd2/revoke.c146
1 files changed, 73 insertions, 73 deletions
diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c
index c532429d8d9b..2fccddc7acad 100644
--- a/fs/jbd2/revoke.c
+++ b/fs/jbd2/revoke.c
@@ -62,7 +62,7 @@
62#else 62#else
63#include <linux/time.h> 63#include <linux/time.h>
64#include <linux/fs.h> 64#include <linux/fs.h>
65#include <linux/jbd.h> 65#include <linux/jbd2.h>
66#include <linux/errno.h> 66#include <linux/errno.h>
67#include <linux/slab.h> 67#include <linux/slab.h>
68#include <linux/list.h> 68#include <linux/list.h>
@@ -70,14 +70,14 @@
70#include <linux/init.h> 70#include <linux/init.h>
71#endif 71#endif
72 72
73static kmem_cache_t *revoke_record_cache; 73static kmem_cache_t *jbd2_revoke_record_cache;
74static kmem_cache_t *revoke_table_cache; 74static kmem_cache_t *jbd2_revoke_table_cache;
75 75
76/* Each revoke record represents one single revoked block. During 76/* Each revoke record represents one single revoked block. During
77 journal replay, this involves recording the transaction ID of the 77 journal replay, this involves recording the transaction ID of the
78 last transaction to revoke this block. */ 78 last transaction to revoke this block. */
79 79
80struct jbd_revoke_record_s 80struct jbd2_revoke_record_s
81{ 81{
82 struct list_head hash; 82 struct list_head hash;
83 tid_t sequence; /* Used for recovery only */ 83 tid_t sequence; /* Used for recovery only */
@@ -86,7 +86,7 @@ struct jbd_revoke_record_s
86 86
87 87
88/* The revoke table is just a simple hash table of revoke records. */ 88/* The revoke table is just a simple hash table of revoke records. */
89struct jbd_revoke_table_s 89struct jbd2_revoke_table_s
90{ 90{
91 /* It is conceivable that we might want a larger hash table 91 /* It is conceivable that we might want a larger hash table
92 * for recovery. Must be a power of two. */ 92 * for recovery. Must be a power of two. */
@@ -99,7 +99,7 @@ struct jbd_revoke_table_s
99#ifdef __KERNEL__ 99#ifdef __KERNEL__
100static void write_one_revoke_record(journal_t *, transaction_t *, 100static void write_one_revoke_record(journal_t *, transaction_t *,
101 struct journal_head **, int *, 101 struct journal_head **, int *,
102 struct jbd_revoke_record_s *); 102 struct jbd2_revoke_record_s *);
103static void flush_descriptor(journal_t *, struct journal_head *, int); 103static void flush_descriptor(journal_t *, struct journal_head *, int);
104#endif 104#endif
105 105
@@ -108,7 +108,7 @@ static void flush_descriptor(journal_t *, struct journal_head *, int);
108/* Borrowed from buffer.c: this is a tried and tested block hash function */ 108/* Borrowed from buffer.c: this is a tried and tested block hash function */
109static inline int hash(journal_t *journal, unsigned long block) 109static inline int hash(journal_t *journal, unsigned long block)
110{ 110{
111 struct jbd_revoke_table_s *table = journal->j_revoke; 111 struct jbd2_revoke_table_s *table = journal->j_revoke;
112 int hash_shift = table->hash_shift; 112 int hash_shift = table->hash_shift;
113 113
114 return ((block << (hash_shift - 6)) ^ 114 return ((block << (hash_shift - 6)) ^
@@ -120,10 +120,10 @@ static int insert_revoke_hash(journal_t *journal, unsigned long blocknr,
120 tid_t seq) 120 tid_t seq)
121{ 121{
122 struct list_head *hash_list; 122 struct list_head *hash_list;
123 struct jbd_revoke_record_s *record; 123 struct jbd2_revoke_record_s *record;
124 124
125repeat: 125repeat:
126 record = kmem_cache_alloc(revoke_record_cache, GFP_NOFS); 126 record = kmem_cache_alloc(jbd2_revoke_record_cache, GFP_NOFS);
127 if (!record) 127 if (!record)
128 goto oom; 128 goto oom;
129 129
@@ -145,57 +145,57 @@ oom:
145 145
146/* Find a revoke record in the journal's hash table. */ 146/* Find a revoke record in the journal's hash table. */
147 147
148static struct jbd_revoke_record_s *find_revoke_record(journal_t *journal, 148static struct jbd2_revoke_record_s *find_revoke_record(journal_t *journal,
149 unsigned long blocknr) 149 unsigned long blocknr)
150{ 150{
151 struct list_head *hash_list; 151 struct list_head *hash_list;
152 struct jbd_revoke_record_s *record; 152 struct jbd2_revoke_record_s *record;
153 153
154 hash_list = &journal->j_revoke->hash_table[hash(journal, blocknr)]; 154 hash_list = &journal->j_revoke->hash_table[hash(journal, blocknr)];
155 155
156 spin_lock(&journal->j_revoke_lock); 156 spin_lock(&journal->j_revoke_lock);
157 record = (struct jbd_revoke_record_s *) hash_list->next; 157 record = (struct jbd2_revoke_record_s *) hash_list->next;
158 while (&(record->hash) != hash_list) { 158 while (&(record->hash) != hash_list) {
159 if (record->blocknr == blocknr) { 159 if (record->blocknr == blocknr) {
160 spin_unlock(&journal->j_revoke_lock); 160 spin_unlock(&journal->j_revoke_lock);
161 return record; 161 return record;
162 } 162 }
163 record = (struct jbd_revoke_record_s *) record->hash.next; 163 record = (struct jbd2_revoke_record_s *) record->hash.next;
164 } 164 }
165 spin_unlock(&journal->j_revoke_lock); 165 spin_unlock(&journal->j_revoke_lock);
166 return NULL; 166 return NULL;
167} 167}
168 168
169int __init journal_init_revoke_caches(void) 169int __init jbd2_journal_init_revoke_caches(void)
170{ 170{
171 revoke_record_cache = kmem_cache_create("revoke_record", 171 jbd2_revoke_record_cache = kmem_cache_create("revoke_record",
172 sizeof(struct jbd_revoke_record_s), 172 sizeof(struct jbd2_revoke_record_s),
173 0, SLAB_HWCACHE_ALIGN, NULL, NULL); 173 0, SLAB_HWCACHE_ALIGN, NULL, NULL);
174 if (revoke_record_cache == 0) 174 if (jbd2_revoke_record_cache == 0)
175 return -ENOMEM; 175 return -ENOMEM;
176 176
177 revoke_table_cache = kmem_cache_create("revoke_table", 177 jbd2_revoke_table_cache = kmem_cache_create("revoke_table",
178 sizeof(struct jbd_revoke_table_s), 178 sizeof(struct jbd2_revoke_table_s),
179 0, 0, NULL, NULL); 179 0, 0, NULL, NULL);
180 if (revoke_table_cache == 0) { 180 if (jbd2_revoke_table_cache == 0) {
181 kmem_cache_destroy(revoke_record_cache); 181 kmem_cache_destroy(jbd2_revoke_record_cache);
182 revoke_record_cache = NULL; 182 jbd2_revoke_record_cache = NULL;
183 return -ENOMEM; 183 return -ENOMEM;
184 } 184 }
185 return 0; 185 return 0;
186} 186}
187 187
188void journal_destroy_revoke_caches(void) 188void jbd2_journal_destroy_revoke_caches(void)
189{ 189{
190 kmem_cache_destroy(revoke_record_cache); 190 kmem_cache_destroy(jbd2_revoke_record_cache);
191 revoke_record_cache = NULL; 191 jbd2_revoke_record_cache = NULL;
192 kmem_cache_destroy(revoke_table_cache); 192 kmem_cache_destroy(jbd2_revoke_table_cache);
193 revoke_table_cache = NULL; 193 jbd2_revoke_table_cache = NULL;
194} 194}
195 195
196/* Initialise the revoke table for a given journal to a given size. */ 196/* Initialise the revoke table for a given journal to a given size. */
197 197
198int journal_init_revoke(journal_t *journal, int hash_size) 198int jbd2_journal_init_revoke(journal_t *journal, int hash_size)
199{ 199{
200 int shift, tmp; 200 int shift, tmp;
201 201
@@ -206,7 +206,7 @@ int journal_init_revoke(journal_t *journal, int hash_size)
206 while((tmp >>= 1UL) != 0UL) 206 while((tmp >>= 1UL) != 0UL)
207 shift++; 207 shift++;
208 208
209 journal->j_revoke_table[0] = kmem_cache_alloc(revoke_table_cache, GFP_KERNEL); 209 journal->j_revoke_table[0] = kmem_cache_alloc(jbd2_revoke_table_cache, GFP_KERNEL);
210 if (!journal->j_revoke_table[0]) 210 if (!journal->j_revoke_table[0])
211 return -ENOMEM; 211 return -ENOMEM;
212 journal->j_revoke = journal->j_revoke_table[0]; 212 journal->j_revoke = journal->j_revoke_table[0];
@@ -221,7 +221,7 @@ int journal_init_revoke(journal_t *journal, int hash_size)
221 journal->j_revoke->hash_table = 221 journal->j_revoke->hash_table =
222 kmalloc(hash_size * sizeof(struct list_head), GFP_KERNEL); 222 kmalloc(hash_size * sizeof(struct list_head), GFP_KERNEL);
223 if (!journal->j_revoke->hash_table) { 223 if (!journal->j_revoke->hash_table) {
224 kmem_cache_free(revoke_table_cache, journal->j_revoke_table[0]); 224 kmem_cache_free(jbd2_revoke_table_cache, journal->j_revoke_table[0]);
225 journal->j_revoke = NULL; 225 journal->j_revoke = NULL;
226 return -ENOMEM; 226 return -ENOMEM;
227 } 227 }
@@ -229,10 +229,10 @@ int journal_init_revoke(journal_t *journal, int hash_size)
229 for (tmp = 0; tmp < hash_size; tmp++) 229 for (tmp = 0; tmp < hash_size; tmp++)
230 INIT_LIST_HEAD(&journal->j_revoke->hash_table[tmp]); 230 INIT_LIST_HEAD(&journal->j_revoke->hash_table[tmp]);
231 231
232 journal->j_revoke_table[1] = kmem_cache_alloc(revoke_table_cache, GFP_KERNEL); 232 journal->j_revoke_table[1] = kmem_cache_alloc(jbd2_revoke_table_cache, GFP_KERNEL);
233 if (!journal->j_revoke_table[1]) { 233 if (!journal->j_revoke_table[1]) {
234 kfree(journal->j_revoke_table[0]->hash_table); 234 kfree(journal->j_revoke_table[0]->hash_table);
235 kmem_cache_free(revoke_table_cache, journal->j_revoke_table[0]); 235 kmem_cache_free(jbd2_revoke_table_cache, journal->j_revoke_table[0]);
236 return -ENOMEM; 236 return -ENOMEM;
237 } 237 }
238 238
@@ -249,8 +249,8 @@ int journal_init_revoke(journal_t *journal, int hash_size)
249 kmalloc(hash_size * sizeof(struct list_head), GFP_KERNEL); 249 kmalloc(hash_size * sizeof(struct list_head), GFP_KERNEL);
250 if (!journal->j_revoke->hash_table) { 250 if (!journal->j_revoke->hash_table) {
251 kfree(journal->j_revoke_table[0]->hash_table); 251 kfree(journal->j_revoke_table[0]->hash_table);
252 kmem_cache_free(revoke_table_cache, journal->j_revoke_table[0]); 252 kmem_cache_free(jbd2_revoke_table_cache, journal->j_revoke_table[0]);
253 kmem_cache_free(revoke_table_cache, journal->j_revoke_table[1]); 253 kmem_cache_free(jbd2_revoke_table_cache, journal->j_revoke_table[1]);
254 journal->j_revoke = NULL; 254 journal->j_revoke = NULL;
255 return -ENOMEM; 255 return -ENOMEM;
256 } 256 }
@@ -265,9 +265,9 @@ int journal_init_revoke(journal_t *journal, int hash_size)
265 265
266/* Destoy a journal's revoke table. The table must already be empty! */ 266/* Destoy a journal's revoke table. The table must already be empty! */
267 267
268void journal_destroy_revoke(journal_t *journal) 268void jbd2_journal_destroy_revoke(journal_t *journal)
269{ 269{
270 struct jbd_revoke_table_s *table; 270 struct jbd2_revoke_table_s *table;
271 struct list_head *hash_list; 271 struct list_head *hash_list;
272 int i; 272 int i;
273 273
@@ -281,7 +281,7 @@ void journal_destroy_revoke(journal_t *journal)
281 } 281 }
282 282
283 kfree(table->hash_table); 283 kfree(table->hash_table);
284 kmem_cache_free(revoke_table_cache, table); 284 kmem_cache_free(jbd2_revoke_table_cache, table);
285 journal->j_revoke = NULL; 285 journal->j_revoke = NULL;
286 286
287 table = journal->j_revoke_table[1]; 287 table = journal->j_revoke_table[1];
@@ -294,7 +294,7 @@ void journal_destroy_revoke(journal_t *journal)
294 } 294 }
295 295
296 kfree(table->hash_table); 296 kfree(table->hash_table);
297 kmem_cache_free(revoke_table_cache, table); 297 kmem_cache_free(jbd2_revoke_table_cache, table);
298 journal->j_revoke = NULL; 298 journal->j_revoke = NULL;
299} 299}
300 300
@@ -302,7 +302,7 @@ void journal_destroy_revoke(journal_t *journal)
302#ifdef __KERNEL__ 302#ifdef __KERNEL__
303 303
304/* 304/*
305 * journal_revoke: revoke a given buffer_head from the journal. This 305 * jbd2_journal_revoke: revoke a given buffer_head from the journal. This
306 * prevents the block from being replayed during recovery if we take a 306 * prevents the block from being replayed during recovery if we take a
307 * crash after this current transaction commits. Any subsequent 307 * crash after this current transaction commits. Any subsequent
308 * metadata writes of the buffer in this transaction cancel the 308 * metadata writes of the buffer in this transaction cancel the
@@ -314,18 +314,18 @@ void journal_destroy_revoke(journal_t *journal)
314 * revoke before clearing the block bitmap when we are deleting 314 * revoke before clearing the block bitmap when we are deleting
315 * metadata. 315 * metadata.
316 * 316 *
317 * Revoke performs a journal_forget on any buffer_head passed in as a 317 * Revoke performs a jbd2_journal_forget on any buffer_head passed in as a
318 * parameter, but does _not_ forget the buffer_head if the bh was only 318 * parameter, but does _not_ forget the buffer_head if the bh was only
319 * found implicitly. 319 * found implicitly.
320 * 320 *
321 * bh_in may not be a journalled buffer - it may have come off 321 * bh_in may not be a journalled buffer - it may have come off
322 * the hash tables without an attached journal_head. 322 * the hash tables without an attached journal_head.
323 * 323 *
324 * If bh_in is non-zero, journal_revoke() will decrement its b_count 324 * If bh_in is non-zero, jbd2_journal_revoke() will decrement its b_count
325 * by one. 325 * by one.
326 */ 326 */
327 327
328int journal_revoke(handle_t *handle, unsigned long blocknr, 328int jbd2_journal_revoke(handle_t *handle, unsigned long blocknr,
329 struct buffer_head *bh_in) 329 struct buffer_head *bh_in)
330{ 330{
331 struct buffer_head *bh = NULL; 331 struct buffer_head *bh = NULL;
@@ -338,7 +338,7 @@ int journal_revoke(handle_t *handle, unsigned long blocknr,
338 BUFFER_TRACE(bh_in, "enter"); 338 BUFFER_TRACE(bh_in, "enter");
339 339
340 journal = handle->h_transaction->t_journal; 340 journal = handle->h_transaction->t_journal;
341 if (!journal_set_features(journal, 0, 0, JFS_FEATURE_INCOMPAT_REVOKE)){ 341 if (!jbd2_journal_set_features(journal, 0, 0, JBD2_FEATURE_INCOMPAT_REVOKE)){
342 J_ASSERT (!"Cannot set revoke feature!"); 342 J_ASSERT (!"Cannot set revoke feature!");
343 return -EINVAL; 343 return -EINVAL;
344 } 344 }
@@ -386,8 +386,8 @@ int journal_revoke(handle_t *handle, unsigned long blocknr,
386 set_buffer_revoked(bh); 386 set_buffer_revoked(bh);
387 set_buffer_revokevalid(bh); 387 set_buffer_revokevalid(bh);
388 if (bh_in) { 388 if (bh_in) {
389 BUFFER_TRACE(bh_in, "call journal_forget"); 389 BUFFER_TRACE(bh_in, "call jbd2_journal_forget");
390 journal_forget(handle, bh_in); 390 jbd2_journal_forget(handle, bh_in);
391 } else { 391 } else {
392 BUFFER_TRACE(bh, "call brelse"); 392 BUFFER_TRACE(bh, "call brelse");
393 __brelse(bh); 393 __brelse(bh);
@@ -403,7 +403,7 @@ int journal_revoke(handle_t *handle, unsigned long blocknr,
403 403
404/* 404/*
405 * Cancel an outstanding revoke. For use only internally by the 405 * Cancel an outstanding revoke. For use only internally by the
406 * journaling code (called from journal_get_write_access). 406 * journaling code (called from jbd2_journal_get_write_access).
407 * 407 *
408 * We trust buffer_revoked() on the buffer if the buffer is already 408 * We trust buffer_revoked() on the buffer if the buffer is already
409 * being journaled: if there is no revoke pending on the buffer, then we 409 * being journaled: if there is no revoke pending on the buffer, then we
@@ -418,9 +418,9 @@ int journal_revoke(handle_t *handle, unsigned long blocknr,
418 * 418 *
419 * The caller must have the journal locked. 419 * The caller must have the journal locked.
420 */ 420 */
421int journal_cancel_revoke(handle_t *handle, struct journal_head *jh) 421int jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
422{ 422{
423 struct jbd_revoke_record_s *record; 423 struct jbd2_revoke_record_s *record;
424 journal_t *journal = handle->h_transaction->t_journal; 424 journal_t *journal = handle->h_transaction->t_journal;
425 int need_cancel; 425 int need_cancel;
426 int did_revoke = 0; /* akpm: debug */ 426 int did_revoke = 0; /* akpm: debug */
@@ -447,7 +447,7 @@ int journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
447 spin_lock(&journal->j_revoke_lock); 447 spin_lock(&journal->j_revoke_lock);
448 list_del(&record->hash); 448 list_del(&record->hash);
449 spin_unlock(&journal->j_revoke_lock); 449 spin_unlock(&journal->j_revoke_lock);
450 kmem_cache_free(revoke_record_cache, record); 450 kmem_cache_free(jbd2_revoke_record_cache, record);
451 did_revoke = 1; 451 did_revoke = 1;
452 } 452 }
453 } 453 }
@@ -478,7 +478,7 @@ int journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
478 * we do not want to suspend any processing until all revokes are 478 * we do not want to suspend any processing until all revokes are
479 * written -bzzz 479 * written -bzzz
480 */ 480 */
481void journal_switch_revoke_table(journal_t *journal) 481void jbd2_journal_switch_revoke_table(journal_t *journal)
482{ 482{
483 int i; 483 int i;
484 484
@@ -498,12 +498,12 @@ void journal_switch_revoke_table(journal_t *journal)
498 * Called with the journal lock held. 498 * Called with the journal lock held.
499 */ 499 */
500 500
501void journal_write_revoke_records(journal_t *journal, 501void jbd2_journal_write_revoke_records(journal_t *journal,
502 transaction_t *transaction) 502 transaction_t *transaction)
503{ 503{
504 struct journal_head *descriptor; 504 struct journal_head *descriptor;
505 struct jbd_revoke_record_s *record; 505 struct jbd2_revoke_record_s *record;
506 struct jbd_revoke_table_s *revoke; 506 struct jbd2_revoke_table_s *revoke;
507 struct list_head *hash_list; 507 struct list_head *hash_list;
508 int i, offset, count; 508 int i, offset, count;
509 509
@@ -519,14 +519,14 @@ void journal_write_revoke_records(journal_t *journal,
519 hash_list = &revoke->hash_table[i]; 519 hash_list = &revoke->hash_table[i];
520 520
521 while (!list_empty(hash_list)) { 521 while (!list_empty(hash_list)) {
522 record = (struct jbd_revoke_record_s *) 522 record = (struct jbd2_revoke_record_s *)
523 hash_list->next; 523 hash_list->next;
524 write_one_revoke_record(journal, transaction, 524 write_one_revoke_record(journal, transaction,
525 &descriptor, &offset, 525 &descriptor, &offset,
526 record); 526 record);
527 count++; 527 count++;
528 list_del(&record->hash); 528 list_del(&record->hash);
529 kmem_cache_free(revoke_record_cache, record); 529 kmem_cache_free(jbd2_revoke_record_cache, record);
530 } 530 }
531 } 531 }
532 if (descriptor) 532 if (descriptor)
@@ -543,7 +543,7 @@ static void write_one_revoke_record(journal_t *journal,
543 transaction_t *transaction, 543 transaction_t *transaction,
544 struct journal_head **descriptorp, 544 struct journal_head **descriptorp,
545 int *offsetp, 545 int *offsetp,
546 struct jbd_revoke_record_s *record) 546 struct jbd2_revoke_record_s *record)
547{ 547{
548 struct journal_head *descriptor; 548 struct journal_head *descriptor;
549 int offset; 549 int offset;
@@ -551,7 +551,7 @@ static void write_one_revoke_record(journal_t *journal,
551 551
552 /* If we are already aborting, this all becomes a noop. We 552 /* If we are already aborting, this all becomes a noop. We
553 still need to go round the loop in 553 still need to go round the loop in
554 journal_write_revoke_records in order to free all of the 554 jbd2_journal_write_revoke_records in order to free all of the
555 revoke records: only the IO to the journal is omitted. */ 555 revoke records: only the IO to the journal is omitted. */
556 if (is_journal_aborted(journal)) 556 if (is_journal_aborted(journal))
557 return; 557 return;
@@ -568,19 +568,19 @@ static void write_one_revoke_record(journal_t *journal,
568 } 568 }
569 569
570 if (!descriptor) { 570 if (!descriptor) {
571 descriptor = journal_get_descriptor_buffer(journal); 571 descriptor = jbd2_journal_get_descriptor_buffer(journal);
572 if (!descriptor) 572 if (!descriptor)
573 return; 573 return;
574 header = (journal_header_t *) &jh2bh(descriptor)->b_data[0]; 574 header = (journal_header_t *) &jh2bh(descriptor)->b_data[0];
575 header->h_magic = cpu_to_be32(JFS_MAGIC_NUMBER); 575 header->h_magic = cpu_to_be32(JBD2_MAGIC_NUMBER);
576 header->h_blocktype = cpu_to_be32(JFS_REVOKE_BLOCK); 576 header->h_blocktype = cpu_to_be32(JBD2_REVOKE_BLOCK);
577 header->h_sequence = cpu_to_be32(transaction->t_tid); 577 header->h_sequence = cpu_to_be32(transaction->t_tid);
578 578
579 /* Record it so that we can wait for IO completion later */ 579 /* Record it so that we can wait for IO completion later */
580 JBUFFER_TRACE(descriptor, "file as BJ_LogCtl"); 580 JBUFFER_TRACE(descriptor, "file as BJ_LogCtl");
581 journal_file_buffer(descriptor, transaction, BJ_LogCtl); 581 jbd2_journal_file_buffer(descriptor, transaction, BJ_LogCtl);
582 582
583 offset = sizeof(journal_revoke_header_t); 583 offset = sizeof(jbd2_journal_revoke_header_t);
584 *descriptorp = descriptor; 584 *descriptorp = descriptor;
585 } 585 }
586 586
@@ -601,7 +601,7 @@ static void flush_descriptor(journal_t *journal,
601 struct journal_head *descriptor, 601 struct journal_head *descriptor,
602 int offset) 602 int offset)
603{ 603{
604 journal_revoke_header_t *header; 604 jbd2_journal_revoke_header_t *header;
605 struct buffer_head *bh = jh2bh(descriptor); 605 struct buffer_head *bh = jh2bh(descriptor);
606 606
607 if (is_journal_aborted(journal)) { 607 if (is_journal_aborted(journal)) {
@@ -609,7 +609,7 @@ static void flush_descriptor(journal_t *journal,
609 return; 609 return;
610 } 610 }
611 611
612 header = (journal_revoke_header_t *) jh2bh(descriptor)->b_data; 612 header = (jbd2_journal_revoke_header_t *) jh2bh(descriptor)->b_data;
613 header->r_count = cpu_to_be32(offset); 613 header->r_count = cpu_to_be32(offset);
614 set_buffer_jwrite(bh); 614 set_buffer_jwrite(bh);
615 BUFFER_TRACE(bh, "write"); 615 BUFFER_TRACE(bh, "write");
@@ -640,11 +640,11 @@ static void flush_descriptor(journal_t *journal,
640 * single block. 640 * single block.
641 */ 641 */
642 642
643int journal_set_revoke(journal_t *journal, 643int jbd2_journal_set_revoke(journal_t *journal,
644 unsigned long blocknr, 644 unsigned long blocknr,
645 tid_t sequence) 645 tid_t sequence)
646{ 646{
647 struct jbd_revoke_record_s *record; 647 struct jbd2_revoke_record_s *record;
648 648
649 record = find_revoke_record(journal, blocknr); 649 record = find_revoke_record(journal, blocknr);
650 if (record) { 650 if (record) {
@@ -664,11 +664,11 @@ int journal_set_revoke(journal_t *journal,
664 * ones, but later transactions still need replayed. 664 * ones, but later transactions still need replayed.
665 */ 665 */
666 666
667int journal_test_revoke(journal_t *journal, 667int jbd2_journal_test_revoke(journal_t *journal,
668 unsigned long blocknr, 668 unsigned long blocknr,
669 tid_t sequence) 669 tid_t sequence)
670{ 670{
671 struct jbd_revoke_record_s *record; 671 struct jbd2_revoke_record_s *record;
672 672
673 record = find_revoke_record(journal, blocknr); 673 record = find_revoke_record(journal, blocknr);
674 if (!record) 674 if (!record)
@@ -683,21 +683,21 @@ int journal_test_revoke(journal_t *journal,
683 * that it can be reused by the running filesystem. 683 * that it can be reused by the running filesystem.
684 */ 684 */
685 685
686void journal_clear_revoke(journal_t *journal) 686void jbd2_journal_clear_revoke(journal_t *journal)
687{ 687{
688 int i; 688 int i;
689 struct list_head *hash_list; 689 struct list_head *hash_list;
690 struct jbd_revoke_record_s *record; 690 struct jbd2_revoke_record_s *record;
691 struct jbd_revoke_table_s *revoke; 691 struct jbd2_revoke_table_s *revoke;
692 692
693 revoke = journal->j_revoke; 693 revoke = journal->j_revoke;
694 694
695 for (i = 0; i < revoke->hash_size; i++) { 695 for (i = 0; i < revoke->hash_size; i++) {
696 hash_list = &revoke->hash_table[i]; 696 hash_list = &revoke->hash_table[i];
697 while (!list_empty(hash_list)) { 697 while (!list_empty(hash_list)) {
698 record = (struct jbd_revoke_record_s*) hash_list->next; 698 record = (struct jbd2_revoke_record_s*) hash_list->next;
699 list_del(&record->hash); 699 list_del(&record->hash);
700 kmem_cache_free(revoke_record_cache, record); 700 kmem_cache_free(jbd2_revoke_record_cache, record);
701 } 701 }
702 } 702 }
703} 703}