Commit f7f4bccb authored by Mingming Cao's avatar Mingming Cao Committed by Linus Torvalds

[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: default avatarMingming Cao <cmm@us.ibm.com>
Signed-off-by: default avatarDave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 470decc6
......@@ -2,6 +2,6 @@
# Makefile for the linux journaling routines.
#
obj-$(CONFIG_JBD) += jbd.o
obj-$(CONFIG_JBD2) += jbd2.o
jbd-objs := transaction.o commit.o recovery.o checkpoint.o revoke.o journal.o
jbd2-objs := transaction.o commit.o recovery.o checkpoint.o revoke.o journal.o
......@@ -19,7 +19,7 @@
#include <linux/time.h>
#include <linux/fs.h>
#include <linux/jbd.h>
#include <linux/jbd2.h>
#include <linux/errno.h>
#include <linux/slab.h>
......@@ -95,9 +95,9 @@ static int __try_to_free_cp_buf(struct journal_head *jh)
if (jh->b_jlist == BJ_None && !buffer_locked(bh) && !buffer_dirty(bh)) {
JBUFFER_TRACE(jh, "remove from checkpoint list");
ret = __journal_remove_checkpoint(jh) + 1;
ret = __jbd2_journal_remove_checkpoint(jh) + 1;
jbd_unlock_bh_state(bh);
journal_remove_journal_head(bh);
jbd2_journal_remove_journal_head(bh);
BUFFER_TRACE(bh, "release");
__brelse(bh);
} else {
......@@ -107,19 +107,19 @@ static int __try_to_free_cp_buf(struct journal_head *jh)
}
/*
* __log_wait_for_space: wait until there is space in the journal.
* __jbd2_log_wait_for_space: wait until there is space in the journal.
*
* Called under j-state_lock *only*. It will be unlocked if we have to wait
* for a checkpoint to free up some space in the log.
*/
void __log_wait_for_space(journal_t *journal)
void __jbd2_log_wait_for_space(journal_t *journal)
{
int nblocks;
assert_spin_locked(&journal->j_state_lock);
nblocks = jbd_space_needed(journal);
while (__log_space_left(journal) < nblocks) {
if (journal->j_flags & JFS_ABORT)
while (__jbd2_log_space_left(journal) < nblocks) {
if (journal->j_flags & JBD2_ABORT)
return;
spin_unlock(&journal->j_state_lock);
mutex_lock(&journal->j_checkpoint_mutex);
......@@ -130,9 +130,9 @@ void __log_wait_for_space(journal_t *journal)
*/
spin_lock(&journal->j_state_lock);
nblocks = jbd_space_needed(journal);
if (__log_space_left(journal) < nblocks) {
if (__jbd2_log_space_left(journal) < nblocks) {
spin_unlock(&journal->j_state_lock);
log_do_checkpoint(journal);
jbd2_log_do_checkpoint(journal);
spin_lock(&journal->j_state_lock);
}
mutex_unlock(&journal->j_checkpoint_mutex);
......@@ -198,9 +198,9 @@ restart:
* Now in whatever state the buffer currently is, we know that
* it has been written out and so we can drop it from the list
*/
released = __journal_remove_checkpoint(jh);
released = __jbd2_journal_remove_checkpoint(jh);
jbd_unlock_bh_state(bh);
journal_remove_journal_head(bh);
jbd2_journal_remove_journal_head(bh);
__brelse(bh);
}
}
......@@ -252,16 +252,16 @@ static int __process_buffer(journal_t *journal, struct journal_head *jh,
spin_unlock(&journal->j_list_lock);
jbd_unlock_bh_state(bh);
log_start_commit(journal, tid);
log_wait_commit(journal, tid);
jbd2_log_start_commit(journal, tid);
jbd2_log_wait_commit(journal, tid);
ret = 1;
} else if (!buffer_dirty(bh)) {
J_ASSERT_JH(jh, !buffer_jbddirty(bh));
BUFFER_TRACE(bh, "remove from checkpoint");
__journal_remove_checkpoint(jh);
__jbd2_journal_remove_checkpoint(jh);
spin_unlock(&journal->j_list_lock);
jbd_unlock_bh_state(bh);
journal_remove_journal_head(bh);
jbd2_journal_remove_journal_head(bh);
__brelse(bh);
ret = 1;
} else {
......@@ -296,7 +296,7 @@ static int __process_buffer(journal_t *journal, struct journal_head *jh,
*
* The journal should be locked before calling this function.
*/
int log_do_checkpoint(journal_t *journal)
int jbd2_log_do_checkpoint(journal_t *journal)
{
transaction_t *transaction;
tid_t this_tid;
......@@ -309,7 +309,7 @@ int log_do_checkpoint(journal_t *journal)
* don't need checkpointing, just eliminate them from the
* journal straight away.
*/
result = cleanup_journal_tail(journal);
result = jbd2_cleanup_journal_tail(journal);
jbd_debug(1, "cleanup_journal_tail returned %d\n", result);
if (result <= 0)
return result;
......@@ -374,7 +374,7 @@ restart:
}
out:
spin_unlock(&journal->j_list_lock);
result = cleanup_journal_tail(journal);
result = jbd2_cleanup_journal_tail(journal);
if (result < 0)
return result;
return 0;
......@@ -397,7 +397,7 @@ out:
* we have an abort error outstanding.
*/
int cleanup_journal_tail(journal_t *journal)
int jbd2_cleanup_journal_tail(journal_t *journal)
{
transaction_t * transaction;
tid_t first_tid;
......@@ -452,8 +452,8 @@ int cleanup_journal_tail(journal_t *journal)
journal->j_tail_sequence = first_tid;
journal->j_tail = blocknr;
spin_unlock(&journal->j_state_lock);
if (!(journal->j_flags & JFS_ABORT))
journal_update_superblock(journal, 1);
if (!(journal->j_flags & JBD2_ABORT))
jbd2_journal_update_superblock(journal, 1);
return 0;
}
......@@ -518,7 +518,7 @@ static int journal_clean_one_cp_list(struct journal_head *jh, int *released)
* Returns number of buffers reaped (for debug)
*/
int __journal_clean_checkpoint_list(journal_t *journal)
int __jbd2_journal_clean_checkpoint_list(journal_t *journal)
{
transaction_t *transaction, *last_transaction, *next_transaction;
int ret = 0;
......@@ -578,7 +578,7 @@ out:
* This function is called with jbd_lock_bh_state(jh2bh(jh))
*/
int __journal_remove_checkpoint(struct journal_head *jh)
int __jbd2_journal_remove_checkpoint(struct journal_head *jh)
{
transaction_t *transaction;
journal_t *journal;
......@@ -607,7 +607,7 @@ int __journal_remove_checkpoint(struct journal_head *jh)
* dropped!
*
* The locking here around j_committing_transaction is a bit sleazy.
* See the comment at the end of journal_commit_transaction().
* See the comment at the end of jbd2_journal_commit_transaction().
*/
if (transaction == journal->j_committing_transaction) {
JBUFFER_TRACE(jh, "belongs to committing transaction");
......@@ -617,7 +617,7 @@ int __journal_remove_checkpoint(struct journal_head *jh)
/* OK, that was the last buffer for the transaction: we can now
safely remove this transaction from the log */
__journal_drop_transaction(journal, transaction);
__jbd2_journal_drop_transaction(journal, transaction);
/* Just in case anybody was waiting for more transactions to be
checkpointed... */
......@@ -636,7 +636,7 @@ out:
* Called with the journal locked.
* Called with j_list_lock held.
*/
void __journal_insert_checkpoint(struct journal_head *jh,
void __jbd2_journal_insert_checkpoint(struct journal_head *jh,
transaction_t *transaction)
{
JBUFFER_TRACE(jh, "entry");
......@@ -666,7 +666,7 @@ void __journal_insert_checkpoint(struct journal_head *jh,
* Called with j_list_lock held.
*/
void __journal_drop_transaction(journal_t *journal, transaction_t *transaction)
void __jbd2_journal_drop_transaction(journal_t *journal, transaction_t *transaction)
{
assert_spin_locked(&journal->j_list_lock);
if (transaction->t_cpnext) {
......
This diff is collapsed.
This diff is collapsed.
......@@ -18,7 +18,7 @@
#else
#include <linux/time.h>
#include <linux/fs.h>
#include <linux/jbd.h>
#include <linux/jbd2.h>
#include <linux/errno.h>
#include <linux/slab.h>
#endif
......@@ -86,7 +86,7 @@ static int do_readahead(journal_t *journal, unsigned int start)
nbufs = 0;
for (next = start; next < max; next++) {
err = journal_bmap(journal, next, &blocknr);
err = jbd2_journal_bmap(journal, next, &blocknr);
if (err) {
printk (KERN_ERR "JBD: bad block at offset %u\n",
......@@ -142,7 +142,7 @@ static int jread(struct buffer_head **bhp, journal_t *journal,
return -EIO;
}
err = journal_bmap(journal, offset, &blocknr);
err = jbd2_journal_bmap(journal, offset, &blocknr);
if (err) {
printk (KERN_ERR "JBD: bad block at offset %u\n",
......@@ -191,10 +191,10 @@ static int count_tags(struct buffer_head *bh, int size)
nr++;
tagp += sizeof(journal_block_tag_t);
if (!(tag->t_flags & cpu_to_be32(JFS_FLAG_SAME_UUID)))
if (!(tag->t_flags & cpu_to_be32(JBD2_FLAG_SAME_UUID)))
tagp += 16;
if (tag->t_flags & cpu_to_be32(JFS_FLAG_LAST_TAG))
if (tag->t_flags & cpu_to_be32(JBD2_FLAG_LAST_TAG))
break;
}
......@@ -210,7 +210,7 @@ do { \
} while (0)
/**
* journal_recover - recovers a on-disk journal
* jbd2_journal_recover - recovers a on-disk journal
* @journal: the journal to recover
*
* The primary function for recovering the log contents when mounting a
......@@ -221,7 +221,7 @@ do { \
* blocks. In the third and final pass, we replay any un-revoked blocks
* in the log.
*/
int journal_recover(journal_t *journal)
int jbd2_journal_recover(journal_t *journal)
{
int err;
journal_superblock_t * sb;
......@@ -260,13 +260,13 @@ int journal_recover(journal_t *journal)
* any existing commit records in the log. */
journal->j_transaction_sequence = ++info.end_transaction;
journal_clear_revoke(journal);
jbd2_journal_clear_revoke(journal);
sync_blockdev(journal->j_fs_dev);
return err;
}
/**
* journal_skip_recovery - Start journal and wipe exiting records
* jbd2_journal_skip_recovery - Start journal and wipe exiting records
* @journal: journal to startup
*
* Locate any valid recovery information from the journal and set up the
......@@ -278,7 +278,7 @@ int journal_recover(journal_t *journal)
* much recovery information is being erased, and to let us initialise
* the journal transaction sequence numbers to the next unused ID.
*/
int journal_skip_recovery(journal_t *journal)
int jbd2_journal_skip_recovery(journal_t *journal)
{
int err;
journal_superblock_t * sb;
......@@ -387,7 +387,7 @@ static int do_one_pass(journal_t *journal,
tmp = (journal_header_t *)bh->b_data;
if (tmp->h_magic != cpu_to_be32(JFS_MAGIC_NUMBER)) {
if (tmp->h_magic != cpu_to_be32(JBD2_MAGIC_NUMBER)) {
brelse(bh);
break;
}
......@@ -407,7 +407,7 @@ static int do_one_pass(journal_t *journal,
* to do with it? That depends on the pass... */
switch(blocktype) {
case JFS_DESCRIPTOR_BLOCK:
case JBD2_DESCRIPTOR_BLOCK:
/* If it is a valid descriptor block, replay it
* in pass REPLAY; otherwise, just skip over the
* blocks it describes. */
......@@ -451,7 +451,7 @@ static int do_one_pass(journal_t *journal,
/* If the block has been
* revoked, then we're all done
* here. */
if (journal_test_revoke
if (jbd2_journal_test_revoke
(journal, blocknr,
next_commit_ID)) {
brelse(obh);
......@@ -477,9 +477,9 @@ static int do_one_pass(journal_t *journal,
lock_buffer(nbh);
memcpy(nbh->b_data, obh->b_data,
journal->j_blocksize);
if (flags & JFS_FLAG_ESCAPE) {
if (flags & JBD2_FLAG_ESCAPE) {
*((__be32 *)bh->b_data) =
cpu_to_be32(JFS_MAGIC_NUMBER);
cpu_to_be32(JBD2_MAGIC_NUMBER);
}
BUFFER_TRACE(nbh, "marking dirty");
......@@ -495,17 +495,17 @@ static int do_one_pass(journal_t *journal,
skip_write:
tagp += sizeof(journal_block_tag_t);
if (!(flags & JFS_FLAG_SAME_UUID))
if (!(flags & JBD2_FLAG_SAME_UUID))
tagp += 16;
if (flags & JFS_FLAG_LAST_TAG)
if (flags & JBD2_FLAG_LAST_TAG)
break;
}
brelse(bh);
continue;
case JFS_COMMIT_BLOCK:
case JBD2_COMMIT_BLOCK:
/* Found an expected commit block: not much to
* do other than move on to the next sequence
* number. */
......@@ -513,7 +513,7 @@ static int do_one_pass(journal_t *journal,
next_commit_ID++;
continue;
case JFS_REVOKE_BLOCK:
case JBD2_REVOKE_BLOCK:
/* If we aren't in the REVOKE pass, then we can
* just skip over this block. */
if (pass != PASS_REVOKE) {
......@@ -570,11 +570,11 @@ static int do_one_pass(journal_t *journal,
static int scan_revoke_records(journal_t *journal, struct buffer_head *bh,
tid_t sequence, struct recovery_info *info)
{
journal_revoke_header_t *header;
jbd2_journal_revoke_header_t *header;
int offset, max;
header = (journal_revoke_header_t *) bh->b_data;
offset = sizeof(journal_revoke_header_t);
header = (jbd2_journal_revoke_header_t *) bh->b_data;
offset = sizeof(jbd2_journal_revoke_header_t);
max = be32_to_cpu(header->r_count);
while (offset < max) {
......@@ -583,7 +583,7 @@ static int scan_revoke_records(journal_t *journal, struct buffer_head *bh,
blocknr = be32_to_cpu(* ((__be32 *) (bh->b_data+offset)));
offset += 4;
err = journal_set_revoke(journal, blocknr, sequence);
err = jbd2_journal_set_revoke(journal, blocknr, sequence);
if (err)
return err;
++info->nr_revokes;
......
This diff is collapsed.
This diff is collapsed.
/*
* linux/include/linux/ext4_jbd.h
* linux/include/linux/ext4_jbd2.h
*
* Written by Stephen C. Tweedie <sct@redhat.com>, 1999
*
......@@ -16,7 +16,7 @@
#define _LINUX_EXT4_JBD_H
#include <linux/fs.h>
#include <linux/jbd.h>
#include <linux/jbd2.h>
#include <linux/ext4_fs.h>
#define EXT4_JOURNAL(inode) (EXT4_SB((inode)->i_sb)->s_journal)
......@@ -116,7 +116,7 @@ static inline int
__ext4_journal_get_undo_access(const char *where, handle_t *handle,
struct buffer_head *bh)
{
int err = journal_get_undo_access(handle, bh);
int err = jbd2_journal_get_undo_access(handle, bh);
if (err)
ext4_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
return err;
......@@ -126,7 +126,7 @@ static inline int
__ext4_journal_get_write_access(const char *where, handle_t *handle,
struct buffer_head *bh)
{
int err = journal_get_write_access(handle, bh);
int err = jbd2_journal_get_write_access(handle, bh);
if (err)
ext4_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
return err;
......@@ -135,13 +135,13 @@ __ext4_journal_get_write_access(const char *where, handle_t *handle,
static inline void
ext4_journal_release_buffer(handle_t *handle, struct buffer_head *bh)
{
journal_release_buffer(handle, bh);
jbd2_journal_release_buffer(handle, bh);
}
static inline int
__ext4_journal_forget(const char *where, handle_t *handle, struct buffer_head *bh)
{
int err = journal_forget(handle, bh);
int err = jbd2_journal_forget(handle, bh);
if (err)
ext4_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
return err;
......@@ -151,7 +151,7 @@ static inline int
__ext4_journal_revoke(const char *where, handle_t *handle,
unsigned long blocknr, struct buffer_head *bh)
{
int err = journal_revoke(handle, blocknr, bh);
int err = jbd2_journal_revoke(handle, blocknr, bh);
if (err)
ext4_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
return err;
......@@ -161,7 +161,7 @@ static inline int
__ext4_journal_get_create_access(const char *where,
handle_t *handle, struct buffer_head *bh)
{
int err = journal_get_create_access(handle, bh);
int err = jbd2_journal_get_create_access(handle, bh);
if (err)
ext4_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
return err;
......@@ -171,7 +171,7 @@ static inline int
__ext4_journal_dirty_metadata(const char *where,
handle_t *handle, struct buffer_head *bh)
{
int err = journal_dirty_metadata(handle, bh);
int err = jbd2_journal_dirty_metadata(handle, bh);
if (err)
ext4_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
return err;
......@@ -211,22 +211,22 @@ static inline handle_t *ext4_journal_current_handle(void)
static inline int ext4_journal_extend(handle_t *handle, int nblocks)
{
return journal_extend(handle, nblocks);
return jbd2_journal_extend(handle, nblocks);
}
static inline int ext4_journal_restart(handle_t *handle, int nblocks)
{
return journal_restart(handle, nblocks);
return jbd2_journal_restart(handle, nblocks);
}
static inline int ext4_journal_blocks_per_page(struct inode *inode)
{
return journal_blocks_per_page(inode);
return jbd2_journal_blocks_per_page(inode);
}
static inline int ext4_journal_force_commit(journal_t *journal)
{
return journal_force_commit(journal);
return jbd2_journal_force_commit(journal);
}
/* super.c */
......
This diff is collapsed.
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