aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd2/checkpoint.c
diff options
context:
space:
mode:
authorMingming Cao <cmm@us.ibm.com>2006-10-11 04:20:59 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-11 14:14:15 -0400
commitf7f4bccb729844a0fa873e224e3a6f7eeed095bb (patch)
treeb5b8ce65b5c17b4a7d45e43a3530f2cc977fb894 /fs/jbd2/checkpoint.c
parent470decc613ab2048b619a01028072d932d9086ee (diff)
[PATCH] jbd2: rename jbd2 symbols to avoid duplication of jbd symbols
Mingming Cao originally did this work, and Shaggy reproduced it using some scripts from her. Signed-off-by: Mingming Cao <cmm@us.ibm.com> Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/jbd2/checkpoint.c')
-rw-r--r--fs/jbd2/checkpoint.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c
index 0208cc7ac5d0..68039fa9a566 100644
--- a/fs/jbd2/checkpoint.c
+++ b/fs/jbd2/checkpoint.c
@@ -19,7 +19,7 @@
19 19
20#include <linux/time.h> 20#include <linux/time.h>
21#include <linux/fs.h> 21#include <linux/fs.h>
22#include <linux/jbd.h> 22#include <linux/jbd2.h>
23#include <linux/errno.h> 23#include <linux/errno.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25 25
@@ -95,9 +95,9 @@ static int __try_to_free_cp_buf(struct journal_head *jh)
95 95
96 if (jh->b_jlist == BJ_None && !buffer_locked(bh) && !buffer_dirty(bh)) { 96 if (jh->b_jlist == BJ_None && !buffer_locked(bh) && !buffer_dirty(bh)) {
97 JBUFFER_TRACE(jh, "remove from checkpoint list"); 97 JBUFFER_TRACE(jh, "remove from checkpoint list");
98 ret = __journal_remove_checkpoint(jh) + 1; 98 ret = __jbd2_journal_remove_checkpoint(jh) + 1;
99 jbd_unlock_bh_state(bh); 99 jbd_unlock_bh_state(bh);
100 journal_remove_journal_head(bh); 100 jbd2_journal_remove_journal_head(bh);
101 BUFFER_TRACE(bh, "release"); 101 BUFFER_TRACE(bh, "release");
102 __brelse(bh); 102 __brelse(bh);
103 } else { 103 } else {
@@ -107,19 +107,19 @@ static int __try_to_free_cp_buf(struct journal_head *jh)
107} 107}
108 108
109/* 109/*
110 * __log_wait_for_space: wait until there is space in the journal. 110 * __jbd2_log_wait_for_space: wait until there is space in the journal.
111 * 111 *
112 * Called under j-state_lock *only*. It will be unlocked if we have to wait 112 * Called under j-state_lock *only*. It will be unlocked if we have to wait
113 * for a checkpoint to free up some space in the log. 113 * for a checkpoint to free up some space in the log.
114 */ 114 */
115void __log_wait_for_space(journal_t *journal) 115void __jbd2_log_wait_for_space(journal_t *journal)
116{ 116{
117 int nblocks; 117 int nblocks;
118 assert_spin_locked(&journal->j_state_lock); 118 assert_spin_locked(&journal->j_state_lock);
119 119
120 nblocks = jbd_space_needed(journal); 120 nblocks = jbd_space_needed(journal);
121 while (__log_space_left(journal) < nblocks) { 121 while (__jbd2_log_space_left(journal) < nblocks) {
122 if (journal->j_flags & JFS_ABORT) 122 if (journal->j_flags & JBD2_ABORT)
123 return; 123 return;
124 spin_unlock(&journal->j_state_lock); 124 spin_unlock(&journal->j_state_lock);
125 mutex_lock(&journal->j_checkpoint_mutex); 125 mutex_lock(&journal->j_checkpoint_mutex);
@@ -130,9 +130,9 @@ void __log_wait_for_space(journal_t *journal)
130 */ 130 */
131 spin_lock(&journal->j_state_lock); 131 spin_lock(&journal->j_state_lock);
132 nblocks = jbd_space_needed(journal); 132 nblocks = jbd_space_needed(journal);
133 if (__log_space_left(journal) < nblocks) { 133 if (__jbd2_log_space_left(journal) < nblocks) {
134 spin_unlock(&journal->j_state_lock); 134 spin_unlock(&journal->j_state_lock);
135 log_do_checkpoint(journal); 135 jbd2_log_do_checkpoint(journal);
136 spin_lock(&journal->j_state_lock); 136 spin_lock(&journal->j_state_lock);
137 } 137 }
138 mutex_unlock(&journal->j_checkpoint_mutex); 138 mutex_unlock(&journal->j_checkpoint_mutex);
@@ -198,9 +198,9 @@ restart:
198 * Now in whatever state the buffer currently is, we know that 198 * Now in whatever state the buffer currently is, we know that
199 * it has been written out and so we can drop it from the list 199 * it has been written out and so we can drop it from the list
200 */ 200 */
201 released = __journal_remove_checkpoint(jh); 201 released = __jbd2_journal_remove_checkpoint(jh);
202 jbd_unlock_bh_state(bh); 202 jbd_unlock_bh_state(bh);
203 journal_remove_journal_head(bh); 203 jbd2_journal_remove_journal_head(bh);
204 __brelse(bh); 204 __brelse(bh);
205 } 205 }
206} 206}
@@ -252,16 +252,16 @@ static int __process_buffer(journal_t *journal, struct journal_head *jh,
252 252
253 spin_unlock(&journal->j_list_lock); 253 spin_unlock(&journal->j_list_lock);
254 jbd_unlock_bh_state(bh); 254 jbd_unlock_bh_state(bh);
255 log_start_commit(journal, tid); 255 jbd2_log_start_commit(journal, tid);
256 log_wait_commit(journal, tid); 256 jbd2_log_wait_commit(journal, tid);
257 ret = 1; 257 ret = 1;
258 } else if (!buffer_dirty(bh)) { 258 } else if (!buffer_dirty(bh)) {
259 J_ASSERT_JH(jh, !buffer_jbddirty(bh)); 259 J_ASSERT_JH(jh, !buffer_jbddirty(bh));
260 BUFFER_TRACE(bh, "remove from checkpoint"); 260 BUFFER_TRACE(bh, "remove from checkpoint");
261 __journal_remove_checkpoint(jh); 261 __jbd2_journal_remove_checkpoint(jh);
262 spin_unlock(&journal->j_list_lock); 262 spin_unlock(&journal->j_list_lock);
263 jbd_unlock_bh_state(bh); 263 jbd_unlock_bh_state(bh);
264 journal_remove_journal_head(bh); 264 jbd2_journal_remove_journal_head(bh);
265 __brelse(bh); 265 __brelse(bh);
266 ret = 1; 266 ret = 1;
267 } else { 267 } else {
@@ -296,7 +296,7 @@ static int __process_buffer(journal_t *journal, struct journal_head *jh,
296 * 296 *
297 * The journal should be locked before calling this function. 297 * The journal should be locked before calling this function.
298 */ 298 */
299int log_do_checkpoint(journal_t *journal) 299int jbd2_log_do_checkpoint(journal_t *journal)
300{ 300{
301 transaction_t *transaction; 301 transaction_t *transaction;
302 tid_t this_tid; 302 tid_t this_tid;
@@ -309,7 +309,7 @@ int log_do_checkpoint(journal_t *journal)
309 * don't need checkpointing, just eliminate them from the 309 * don't need checkpointing, just eliminate them from the
310 * journal straight away. 310 * journal straight away.
311 */ 311 */
312 result = cleanup_journal_tail(journal); 312 result = jbd2_cleanup_journal_tail(journal);
313 jbd_debug(1, "cleanup_journal_tail returned %d\n", result); 313 jbd_debug(1, "cleanup_journal_tail returned %d\n", result);
314 if (result <= 0) 314 if (result <= 0)
315 return result; 315 return result;
@@ -374,7 +374,7 @@ restart:
374 } 374 }
375out: 375out:
376 spin_unlock(&journal->j_list_lock); 376 spin_unlock(&journal->j_list_lock);
377 result = cleanup_journal_tail(journal); 377 result = jbd2_cleanup_journal_tail(journal);
378 if (result < 0) 378 if (result < 0)
379 return result; 379 return result;
380 return 0; 380 return 0;
@@ -397,7 +397,7 @@ out:
397 * we have an abort error outstanding. 397 * we have an abort error outstanding.
398 */ 398 */
399 399
400int cleanup_journal_tail(journal_t *journal) 400int jbd2_cleanup_journal_tail(journal_t *journal)
401{ 401{
402 transaction_t * transaction; 402 transaction_t * transaction;
403 tid_t first_tid; 403 tid_t first_tid;
@@ -452,8 +452,8 @@ int cleanup_journal_tail(journal_t *journal)
452 journal->j_tail_sequence = first_tid; 452 journal->j_tail_sequence = first_tid;
453 journal->j_tail = blocknr; 453 journal->j_tail = blocknr;
454 spin_unlock(&journal->j_state_lock); 454 spin_unlock(&journal->j_state_lock);
455 if (!(journal->j_flags & JFS_ABORT)) 455 if (!(journal->j_flags & JBD2_ABORT))
456 journal_update_superblock(journal, 1); 456 jbd2_journal_update_superblock(journal, 1);
457 return 0; 457 return 0;
458} 458}
459 459
@@ -518,7 +518,7 @@ static int journal_clean_one_cp_list(struct journal_head *jh, int *released)
518 * Returns number of buffers reaped (for debug) 518 * Returns number of buffers reaped (for debug)
519 */ 519 */
520 520
521int __journal_clean_checkpoint_list(journal_t *journal) 521int __jbd2_journal_clean_checkpoint_list(journal_t *journal)
522{ 522{
523 transaction_t *transaction, *last_transaction, *next_transaction; 523 transaction_t *transaction, *last_transaction, *next_transaction;
524 int ret = 0; 524 int ret = 0;
@@ -578,7 +578,7 @@ out:
578 * This function is called with jbd_lock_bh_state(jh2bh(jh)) 578 * This function is called with jbd_lock_bh_state(jh2bh(jh))
579 */ 579 */
580 580
581int __journal_remove_checkpoint(struct journal_head *jh) 581int __jbd2_journal_remove_checkpoint(struct journal_head *jh)
582{ 582{
583 transaction_t *transaction; 583 transaction_t *transaction;
584 journal_t *journal; 584 journal_t *journal;
@@ -607,7 +607,7 @@ int __journal_remove_checkpoint(struct journal_head *jh)
607 * dropped! 607 * dropped!
608 * 608 *
609 * The locking here around j_committing_transaction is a bit sleazy. 609 * The locking here around j_committing_transaction is a bit sleazy.
610 * See the comment at the end of journal_commit_transaction(). 610 * See the comment at the end of jbd2_journal_commit_transaction().
611 */ 611 */
612 if (transaction == journal->j_committing_transaction) { 612 if (transaction == journal->j_committing_transaction) {
613 JBUFFER_TRACE(jh, "belongs to committing transaction"); 613 JBUFFER_TRACE(jh, "belongs to committing transaction");
@@ -617,7 +617,7 @@ int __journal_remove_checkpoint(struct journal_head *jh)
617 /* OK, that was the last buffer for the transaction: we can now 617 /* OK, that was the last buffer for the transaction: we can now
618 safely remove this transaction from the log */ 618 safely remove this transaction from the log */
619 619
620 __journal_drop_transaction(journal, transaction); 620 __jbd2_journal_drop_transaction(journal, transaction);
621 621
622 /* Just in case anybody was waiting for more transactions to be 622 /* Just in case anybody was waiting for more transactions to be
623 checkpointed... */ 623 checkpointed... */
@@ -636,7 +636,7 @@ out:
636 * Called with the journal locked. 636 * Called with the journal locked.
637 * Called with j_list_lock held. 637 * Called with j_list_lock held.
638 */ 638 */
639void __journal_insert_checkpoint(struct journal_head *jh, 639void __jbd2_journal_insert_checkpoint(struct journal_head *jh,
640 transaction_t *transaction) 640 transaction_t *transaction)
641{ 641{
642 JBUFFER_TRACE(jh, "entry"); 642 JBUFFER_TRACE(jh, "entry");
@@ -666,7 +666,7 @@ void __journal_insert_checkpoint(struct journal_head *jh,
666 * Called with j_list_lock held. 666 * Called with j_list_lock held.
667 */ 667 */
668 668
669void __journal_drop_transaction(journal_t *journal, transaction_t *transaction) 669void __jbd2_journal_drop_transaction(journal_t *journal, transaction_t *transaction)
670{ 670{
671 assert_spin_locked(&journal->j_list_lock); 671 assert_spin_locked(&journal->j_list_lock);
672 if (transaction->t_cpnext) { 672 if (transaction->t_cpnext) {