jb->journal_list = NULL ;
jb->bitmaps = vmalloc( mem ) ;
if (!jb->bitmaps) {
- reiserfs_warning("clm-2000, unable to allocate bitmaps for journal lists\n") ;
+ reiserfs_warning(p_s_sb, "clm-2000, unable to allocate bitmaps for journal lists") ;
failed = 1;
break ;
}
static struct reiserfs_journal_cnode *get_cnode(struct super_block *p_s_sb) {
struct reiserfs_journal_cnode *cn ;
- reiserfs_check_lock_depth("get_cnode") ;
+ reiserfs_check_lock_depth(p_s_sb, "get_cnode") ;
if (SB_JOURNAL(p_s_sb)->j_cnode_free <= 0) {
return NULL ;
*/
static void free_cnode(struct super_block *p_s_sb, struct reiserfs_journal_cnode *cn) {
- reiserfs_check_lock_depth("free_cnode") ;
+ reiserfs_check_lock_depth(p_s_sb, "free_cnode") ;
SB_JOURNAL(p_s_sb)->j_cnode_used-- ;
SB_JOURNAL(p_s_sb)->j_cnode_free++ ;
/* utility function to force a BUG if it is called without the big
** kernel lock held. caller is the string printed just before calling BUG()
*/
-void reiserfs_check_lock_depth(char *caller) {
+void reiserfs_check_lock_depth(struct super_block *sb, char *caller) {
#ifdef CONFIG_SMP
if (current->lock_depth < 0) {
- printk("%s called without kernel lock held\n", caller) ;
- BUG() ;
+ reiserfs_panic (sb, "%s called without kernel lock held", caller) ;
}
#else
;
struct reiserfs_journal_list *jl)
{
if (jl->j_refcount < 1) {
- printk("trans id %lu, refcount at %d\n", jl->j_trans_id,
+ reiserfs_panic (s, "trans id %lu, refcount at %d", jl->j_trans_id,
jl->j_refcount);
- BUG();
}
if (--jl->j_refcount == 0)
reiserfs_kfree(jl, sizeof(struct reiserfs_journal_list), s);
char b[BDEVNAME_SIZE];
if (buffer_journaled(bh)) {
- reiserfs_warning("clm-2084: pinned buffer %lu:%s sent to disk\n",
+ reiserfs_warning(NULL, "clm-2084: pinned buffer %lu:%s sent to disk",
bh->b_blocknr, bdevname(bh->b_bdev, b)) ;
}
if (uptodate)
struct buffer_head *tbh = NULL ;
unsigned long trans_id = jl->j_trans_id;
- reiserfs_check_lock_depth("flush_commit_list") ;
+ reiserfs_check_lock_depth(s, "flush_commit_list") ;
if (atomic_read(&jl->j_older_commits_done)) {
return 0 ;
bforget(jl->j_commit_bh) ;
if (SB_JOURNAL(s)->j_last_commit_id != 0 &&
(jl->j_trans_id - SB_JOURNAL(s)->j_last_commit_id) != 1) {
- reiserfs_warning("clm-2200: last commit %lu, current %lu\n",
+ reiserfs_warning(s, "clm-2200: last commit %lu, current %lu",
SB_JOURNAL(s)->j_last_commit_id,
jl->j_trans_id);
}
while(cn) {
if (cn->blocknr != 0) {
if (debug) {
- printk("block %u, bh is %d, state %ld\n", cn->blocknr, cn->bh ? 1: 0,
- cn->state) ;
+ reiserfs_warning (p_s_sb, "block %u, bh is %d, state %ld", cn->blocknr,
+ cn->bh ? 1: 0, cn->state) ;
}
cn->state = 0 ;
remove_journal_hash(p_s_sb, SB_JOURNAL(p_s_sb)->j_list_hash_table, jl, cn->blocknr, 1) ;
set_buffer_dirty(SB_JOURNAL(p_s_sb)->j_header_bh) ;
sync_dirty_buffer(SB_JOURNAL(p_s_sb)->j_header_bh) ;
if (!buffer_uptodate(SB_JOURNAL(p_s_sb)->j_header_bh)) {
- printk( "reiserfs: journal-837: IO error during journal replay\n" );
+ reiserfs_warning (p_s_sb, "journal-837: IO error during journal replay");
return -EIO ;
}
}
}
if (atomic_read(&SB_JOURNAL(s)->j_wcount) != 0) {
- reiserfs_warning("clm-2048: flush_journal_list called with wcount %d\n",
+ reiserfs_warning(s, "clm-2048: flush_journal_list called with wcount %d",
atomic_read(&SB_JOURNAL(s)->j_wcount)) ;
}
if (jl->j_trans_id == 0)
** is not marked JDirty_wait
*/
if ((!was_jwait) && !buffer_locked(saved_bh)) {
-printk("journal-813: BAD! buffer %llu %cdirty %cjwait, not in a newer tranasction\n", (unsigned long long)saved_bh->b_blocknr,
- was_dirty ? ' ' : '!', was_jwait ? ' ' : '!') ;
+ reiserfs_warning (s, "journal-813: BAD! buffer %llu %cdirty %cjwait, "
+ "not in a newer tranasction",
+ (unsigned long long)saved_bh->b_blocknr,
+ was_dirty ? ' ' : '!', was_jwait ? ' ' : '!') ;
}
if (was_dirty) {
/* we inc again because saved_bh gets decremented at free_cnode */
unlock_buffer(saved_bh);
count++ ;
} else {
- printk("clm-2082: Unable to flush buffer %llu in flush_journal_list\n",
- (unsigned long long)saved_bh->b_blocknr) ;
+ reiserfs_warning (s, "clm-2082: Unable to flush buffer %llu in %s",
+ (unsigned long long)saved_bh->b_blocknr, __FUNCTION__);
}
free_cnode:
last = cn ;
/* we incremented this to keep others from taking the buffer head away */
put_bh(saved_bh) ;
if (atomic_read(&(saved_bh->b_count)) < 0) {
- printk("journal-945: saved_bh->b_count < 0") ;
+ reiserfs_warning (s, "journal-945: saved_bh->b_count < 0");
}
}
}
if (SB_JOURNAL(s)->j_last_flush_id != 0 &&
(jl->j_trans_id - SB_JOURNAL(s)->j_last_flush_id) != 1) {
- reiserfs_warning("clm-2201: last flush %lu, current %lu\n",
+ reiserfs_warning(s, "clm-2201: last flush %lu, current %lu",
SB_JOURNAL(s)->j_last_flush_id,
jl->j_trans_id);
}
if (oldest_invalid_trans_id && *oldest_invalid_trans_id && get_desc_trans_id(desc) > *oldest_invalid_trans_id) {
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-986: transaction "
"is valid returning because trans_id %d is greater than "
- "oldest_invalid %lu\n", get_desc_trans_id(desc),
+ "oldest_invalid %lu", get_desc_trans_id(desc),
*oldest_invalid_trans_id);
return 0 ;
}
if (newest_mount_id && *newest_mount_id > get_desc_mount_id (desc)) {
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1087: transaction "
"is valid returning because mount_id %d is less than "
- "newest_mount_id %lu\n", get_desc_mount_id (desc),
+ "newest_mount_id %lu", get_desc_mount_id (desc),
*newest_mount_id) ;
return -1 ;
}
if ( get_desc_trans_len(desc) > SB_JOURNAL_TRANS_MAX(p_s_sb) ) {
- reiserfs_warning("journal-2018: Bad transaction length %d encountered, ignoring transaction\n", get_desc_trans_len(desc));
+ reiserfs_warning(p_s_sb, "journal-2018: Bad transaction length %d encountered, ignoring transaction", get_desc_trans_len(desc));
return -1 ;
}
offset = d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) ;
if (journal_compare_desc_commit(p_s_sb, desc, commit)) {
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE,
"journal_transaction_is_valid, commit offset %ld had bad "
- "time %d or length %d\n",
+ "time %d or length %d",
c_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb),
get_commit_trans_id (commit),
get_commit_trans_len(commit));
if (oldest_invalid_trans_id) {
*oldest_invalid_trans_id = get_desc_trans_id(desc) ;
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1004: "
- "transaction_is_valid setting oldest invalid trans_id "
- "to %d\n", get_desc_trans_id(desc)) ;
+ "transaction_is_valid setting oldest invalid trans_id "
+ "to %d", get_desc_trans_id(desc)) ;
}
return -1;
}
brelse(c_bh) ;
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1006: found valid "
- "transaction start offset %llu, len %d id %d\n",
+ "transaction start offset %llu, len %d id %d",
d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb),
get_desc_trans_len(desc), get_desc_trans_id(desc)) ;
return 1 ;
desc = (struct reiserfs_journal_desc *)d_bh->b_data ;
trans_offset = d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) ;
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1037: "
- "journal_read_transaction, offset %llu, len %d mount_id %d\n",
+ "journal_read_transaction, offset %llu, len %d mount_id %d",
d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb),
get_desc_trans_len(desc), get_desc_mount_id(desc)) ;
if (get_desc_trans_id(desc) < oldest_trans_id) {
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1039: "
- "journal_read_trans skipping because %lu is too old\n",
+ "journal_read_trans skipping because %lu is too old",
cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb)) ;
brelse(d_bh) ;
return 1 ;
if (get_desc_mount_id(desc) != newest_mount_id) {
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1146: "
"journal_read_trans skipping because %d is != "
- "newest_mount_id %lu\n", get_desc_mount_id(desc),
+ "newest_mount_id %lu", get_desc_mount_id(desc),
newest_mount_id) ;
brelse(d_bh) ;
return 1 ;
commit = (struct reiserfs_journal_commit *)c_bh->b_data ;
if (journal_compare_desc_commit(p_s_sb, desc, commit)) {
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal_read_transaction, "
- "commit offset %llu had bad time %d or length %d\n",
+ "commit offset %llu had bad time %d or length %d",
c_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb),
get_commit_trans_id(commit), get_commit_trans_len(commit));
brelse(c_bh) ;
brelse(d_bh) ;
reiserfs_kfree(log_blocks, get_desc_trans_len(desc) * sizeof(struct buffer_head *), p_s_sb) ;
reiserfs_kfree(real_blocks, get_desc_trans_len(desc) * sizeof(struct buffer_head *), p_s_sb) ;
- reiserfs_warning("journal-1169: kmalloc failed, unable to mount FS\n") ;
+ reiserfs_warning(p_s_sb, "journal-1169: kmalloc failed, unable to mount FS") ;
return -1 ;
}
/* get all the buffer heads */
real_blocks[i] = sb_getblk(p_s_sb, le32_to_cpu(commit->j_realblock[i - trans_half])) ;
}
if ( real_blocks[i]->b_blocknr > SB_BLOCK_COUNT(p_s_sb) ) {
- reiserfs_warning("journal-1207: REPLAY FAILURE fsck required! Block to replay is outside of filesystem\n");
+ reiserfs_warning(p_s_sb, "journal-1207: REPLAY FAILURE fsck required! Block to replay is outside of filesystem");
goto abort_replay;
}
/* make sure we don't try to replay onto log or reserved area */
if (is_block_in_log_or_reserved_area(p_s_sb, real_blocks[i]->b_blocknr)) {
- reiserfs_warning("journal-1204: REPLAY FAILURE fsck required! Trying to replay onto a log block\n") ;
+ reiserfs_warning(p_s_sb, "journal-1204: REPLAY FAILURE fsck required! Trying to replay onto a log block") ;
abort_replay:
brelse_array(log_blocks, i) ;
brelse_array(real_blocks, i) ;
for (i = 0 ; i < get_desc_trans_len(desc) ; i++) {
wait_on_buffer(log_blocks[i]) ;
if (!buffer_uptodate(log_blocks[i])) {
- reiserfs_warning("journal-1212: REPLAY FAILURE fsck required! buffer write failed\n") ;
+ reiserfs_warning(p_s_sb, "journal-1212: REPLAY FAILURE fsck required! buffer write failed") ;
brelse_array(log_blocks + i, get_desc_trans_len(desc) - i) ;
brelse_array(real_blocks, get_desc_trans_len(desc)) ;
brelse(c_bh) ;
for (i = 0 ; i < get_desc_trans_len(desc) ; i++) {
wait_on_buffer(real_blocks[i]) ;
if (!buffer_uptodate(real_blocks[i])) {
- reiserfs_warning("journal-1226: REPLAY FAILURE, fsck required! buffer write failed\n") ;
+ reiserfs_warning(p_s_sb, "journal-1226: REPLAY FAILURE, fsck required! buffer write failed") ;
brelse_array(real_blocks + i, get_desc_trans_len(desc) - i) ;
brelse(c_bh) ;
brelse(d_bh) ;
}
cur_dblock = SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + ((trans_offset + get_desc_trans_len(desc) + 2) % SB_ONDISK_JOURNAL_SIZE(p_s_sb)) ;
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1095: setting journal "
- "start to offset %ld\n",
+ "start to offset %ld",
cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb)) ;
/* init starting values for the first transaction, in case this is the last transaction to be replayed. */
char b[BDEVNAME_SIZE];
cur_dblock = SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) ;
- printk("reiserfs: checking transaction log (%s) for (%s)\n",
- bdevname(SB_JOURNAL(p_s_sb)->j_dev_bd, b),
- reiserfs_bdevname(p_s_sb));
+ reiserfs_info (p_s_sb, "checking transaction log (%s)\n",
+ bdevname(SB_JOURNAL(p_s_sb)->j_dev_bd, b));
start = get_seconds();
/* step 1, read in the journal header block. Check the transaction it says
newest_mount_id = le32_to_cpu(jh->j_mount_id);
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1153: found in "
"header: first_unflushed_offset %d, last_flushed_trans_id "
- "%lu\n", le32_to_cpu(jh->j_first_unflushed_offset),
+ "%lu", le32_to_cpu(jh->j_first_unflushed_offset),
le32_to_cpu(jh->j_last_flush_trans_id)) ;
valid_journal_header = 1 ;
}
if (continue_replay && bdev_read_only(p_s_sb->s_bdev)) {
- printk("clm-2076: device is readonly, unable to replay log\n") ;
+ reiserfs_warning (p_s_sb,
+ "clm-2076: device is readonly, unable to replay log") ;
return -1 ;
}
oldest_start = d_bh->b_blocknr ;
newest_mount_id = get_desc_mount_id(desc) ;
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1179: Setting "
- "oldest_start to offset %llu, trans_id %lu\n",
+ "oldest_start to offset %llu, trans_id %lu",
oldest_start - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb),
oldest_trans_id) ;
} else if (oldest_trans_id > get_desc_trans_id(desc)) {
oldest_trans_id = get_desc_trans_id(desc) ;
oldest_start = d_bh->b_blocknr ;
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1180: Resetting "
- "oldest_start to offset %lu, trans_id %lu\n",
+ "oldest_start to offset %lu, trans_id %lu",
oldest_start - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb),
oldest_trans_id) ;
}
if (newest_mount_id < get_desc_mount_id(desc)) {
newest_mount_id = get_desc_mount_id(desc) ;
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1299: Setting "
- "newest_mount_id to %d\n", get_desc_mount_id(desc));
+ "newest_mount_id to %d", get_desc_mount_id(desc));
}
cur_dblock += get_desc_trans_len(desc) + 2 ;
} else {
cur_dblock = oldest_start ;
if (oldest_trans_id) {
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1206: Starting replay "
- "from offset %llu, trans_id %lu\n",
+ "from offset %llu, trans_id %lu",
cur_dblock - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb),
oldest_trans_id) ;
if (oldest_trans_id == 0) {
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1225: No valid "
- "transactions found\n") ;
+ "transactions found") ;
}
/* j_start does not get set correctly if we don't replay any transactions.
** if we had a valid journal_header, set j_start to the first unflushed transaction value,
SB_JOURNAL(p_s_sb)->j_mount_id = newest_mount_id + 1 ;
}
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1299: Setting "
- "newest_mount_id to %lu\n", SB_JOURNAL(p_s_sb)->j_mount_id) ;
+ "newest_mount_id to %lu", SB_JOURNAL(p_s_sb)->j_mount_id) ;
SB_JOURNAL(p_s_sb)->j_first_unflushed_offset = SB_JOURNAL(p_s_sb)->j_start ;
if (replay_count > 0) {
- printk("reiserfs: replayed %d transactions in %lu seconds\n", replay_count,
- get_seconds() - start) ;
+ reiserfs_info (p_s_sb, "replayed %d transactions in %lu seconds\n",
+ replay_count, get_seconds() - start) ;
}
if (!bdev_read_only(p_s_sb->s_bdev) &&
_update_journal_header_block(p_s_sb, SB_JOURNAL(p_s_sb)->j_start,
}
if( result != 0 ) {
- reiserfs_warning("sh-457: release_journal_dev: Cannot release journal device: %i\n", result );
+ reiserfs_warning(super, "sh-457: release_journal_dev: Cannot release journal device: %i", result );
}
return result;
}
if (IS_ERR(journal->j_dev_bd)) {
result = PTR_ERR(journal->j_dev_bd);
journal->j_dev_bd = NULL;
- printk( "sh-458: journal_init_dev: cannot init journal device\n '%s': %i",
- __bdevname(jdev, b), result );
+ reiserfs_warning (super, "sh-458: journal_init_dev: "
+ "cannot init journal device '%s': %i",
+ __bdevname(jdev, b), result );
return result;
} else if (jdev != super->s_dev)
set_blocksize(journal->j_dev_bd, super->s_blocksize);
if( !IS_ERR( journal -> j_dev_file ) ) {
struct inode *jdev_inode = journal->j_dev_file->f_mapping->host;
if( !S_ISBLK( jdev_inode -> i_mode ) ) {
- printk( "journal_init_dev: '%s' is not a block device\n", jdev_name );
+ reiserfs_warning (super, "journal_init_dev: '%s' is "
+ "not a block device", jdev_name );
result = -ENOTBLK;
} else {
/* ok */
} else {
result = PTR_ERR( journal -> j_dev_file );
journal -> j_dev_file = NULL;
- printk( "journal_init_dev: Cannot open '%s': %i\n", jdev_name, result );
+ reiserfs_warning (super,
+ "journal_init_dev: Cannot open '%s': %i",
+ jdev_name, result );
}
if( result != 0 ) {
release_journal_dev( super, journal );
}
- printk( "journal_init_dev: journal device: %s\n",
+ reiserfs_info(super, "journal_init_dev: journal device: %s\n",
bdevname(journal->j_dev_bd, b));
return result;
}
journal = SB_JOURNAL(p_s_sb) = vmalloc(sizeof (struct reiserfs_journal)) ;
if (!journal) {
- printk("journal-1256: unable to get memory for journal structure\n") ;
+ reiserfs_warning (p_s_sb, "journal-1256: unable to get memory for journal structure") ;
return 1 ;
}
memset(journal, 0, sizeof(struct reiserfs_journal)) ;
INIT_LIST_HEAD (&SB_JOURNAL(p_s_sb)->j_prealloc_list);
INIT_LIST_HEAD(&SB_JOURNAL(p_s_sb)->j_working_list);
INIT_LIST_HEAD(&SB_JOURNAL(p_s_sb)->j_journal_list);
- reiserfs_allocate_list_bitmaps(p_s_sb, SB_JOURNAL(p_s_sb)->j_list_bitmap,
- SB_BMAP_NR(p_s_sb)) ;
+ if (reiserfs_allocate_list_bitmaps(p_s_sb,
+ SB_JOURNAL(p_s_sb)->j_list_bitmap,
+ SB_BMAP_NR(p_s_sb)))
+ goto free_and_return ;
allocate_bitmap_nodes(p_s_sb) ;
/* reserved for journal area support */
(actual for small blocksizes) */
if ( !SB_ONDISK_JOURNAL_DEVICE( p_s_sb ) &&
(SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb) + SB_ONDISK_JOURNAL_SIZE(p_s_sb) > p_s_sb->s_blocksize * 8) ) {
- printk("journal-1393: journal does not fit for area addressed by first of bitmap blocks. "
- "It starts at %u and its size is %u. Block size %ld\n",
- SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb), SB_ONDISK_JOURNAL_SIZE(p_s_sb), p_s_sb->s_blocksize) ;
+ reiserfs_warning (p_s_sb, "journal-1393: journal does not fit for area "
+ "addressed by first of bitmap blocks. It starts at "
+ "%u and its size is %u. Block size %ld",
+ SB_JOURNAL_1st_RESERVED_BLOCK(p_s_sb),
+ SB_ONDISK_JOURNAL_SIZE(p_s_sb), p_s_sb->s_blocksize);
goto free_and_return;
}
if( journal_init_dev( p_s_sb, journal, j_dev_name ) != 0 ) {
- printk( "sh-462: unable to initialize jornal device\n");
+ reiserfs_warning (p_s_sb, "sh-462: unable to initialize jornal device");
goto free_and_return;
}
bhjh = journal_bread(p_s_sb,
SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + SB_ONDISK_JOURNAL_SIZE(p_s_sb));
if (!bhjh) {
- printk("sh-459: unable to read journal header\n") ;
+ reiserfs_warning (p_s_sb, "sh-459: unable to read journal header");
goto free_and_return;
}
jh = (struct reiserfs_journal_header *)(bhjh->b_data);
/* make sure that journal matches to the super block */
if (is_reiserfs_jr(rs) && (jh->jh_journal.jp_journal_magic != sb_jp_journal_magic(rs))) {
- printk("sh-460: journal header magic %x (device %s) does not match "
- "to magic found in super block %x (device %s)\n",
- jh->jh_journal.jp_journal_magic,
- bdevname( SB_JOURNAL(p_s_sb)->j_dev_bd, b),
- sb_jp_journal_magic(rs), reiserfs_bdevname (p_s_sb));
+ reiserfs_warning (p_s_sb, "sh-460: journal header magic %x "
+ "(device %s) does not match to magic found in super "
+ "block %x",
+ jh->jh_journal.jp_journal_magic,
+ bdevname( SB_JOURNAL(p_s_sb)->j_dev_bd, b),
+ sb_jp_journal_magic(rs));
brelse (bhjh);
goto free_and_return;
}
SB_JOURNAL_TRANS_MAX(p_s_sb) = JOURNAL_TRANS_MIN_DEFAULT / ratio;
if (SB_JOURNAL_TRANS_MAX(p_s_sb) != initial)
- printk ("sh-461: journal_init: wrong transaction max size (%u). Changed to %u\n",
+ reiserfs_warning (p_s_sb, "sh-461: journal_init: wrong transaction max size (%u). Changed to %u",
initial, SB_JOURNAL_TRANS_MAX(p_s_sb));
SB_JOURNAL_MAX_BATCH(p_s_sb) = SB_JOURNAL_TRANS_MAX(p_s_sb)*
SB_JOURNAL_MAX_TRANS_AGE(p_s_sb) = commit_max_age;
}
- printk ("Reiserfs journal params: device %s, size %u, "
- "journal first block %u, max trans len %u, max batch %u, "
- "max commit age %u, max trans age %u\n",
- bdevname( SB_JOURNAL(p_s_sb)->j_dev_bd, b),
- SB_ONDISK_JOURNAL_SIZE(p_s_sb),
- SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb),
- SB_JOURNAL_TRANS_MAX(p_s_sb),
- SB_JOURNAL_MAX_BATCH(p_s_sb),
- SB_JOURNAL_MAX_COMMIT_AGE(p_s_sb),
- SB_JOURNAL_MAX_TRANS_AGE(p_s_sb));
+ reiserfs_info (p_s_sb, "journal params: device %s, size %u, "
+ "journal first block %u, max trans len %u, max batch %u, "
+ "max commit age %u, max trans age %u\n",
+ bdevname( SB_JOURNAL(p_s_sb)->j_dev_bd, b),
+ SB_ONDISK_JOURNAL_SIZE(p_s_sb),
+ SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb),
+ SB_JOURNAL_TRANS_MAX(p_s_sb),
+ SB_JOURNAL_MAX_BATCH(p_s_sb),
+ SB_JOURNAL_MAX_COMMIT_AGE(p_s_sb),
+ SB_JOURNAL_MAX_TRANS_AGE(p_s_sb));
brelse (bhjh);
jl = SB_JOURNAL(p_s_sb)->j_current_jl;
jl->j_list_bitmap = get_list_bitmap(p_s_sb, jl);
if (!jl->j_list_bitmap) {
- reiserfs_warning("journal-2005, get_list_bitmap failed for journal list 0\n") ;
+ reiserfs_warning(p_s_sb, "journal-2005, get_list_bitmap failed for journal list 0") ;
goto free_and_return;
}
if (journal_read(p_s_sb) < 0) {
- reiserfs_warning("Replay Failure, unable to mount\n") ;
+ reiserfs_warning(p_s_sb, "Replay Failure, unable to mount") ;
goto free_and_return;
}
struct reiserfs_transaction_handle myth;
int sched_count = 0;
- reiserfs_check_lock_depth("journal_begin") ;
+ reiserfs_check_lock_depth(p_s_sb, "journal_begin") ;
RFALSE( p_s_sb->s_flags & MS_RDONLY,
"clm-2078: calling journal_begin on readonly FS") ;
cur_th->t_refcount++ ;
memcpy(th, cur_th, sizeof(*th));
if (th->t_refcount <= 1)
- printk("BAD: refcount <= 1, but journal_info != 0\n");
+ reiserfs_warning (p_s_sb, "BAD: refcount <= 1, but journal_info != 0");
return 0;
} else {
/* we've ended up with a handle from a different filesystem.
** save it and restore on journal_end. This should never
** really happen...
*/
- reiserfs_warning("clm-2100: nesting info a different FS\n") ;
+ reiserfs_warning(p_s_sb, "clm-2100: nesting info a different FS") ;
th->t_handle_save = current->journal_info ;
current->journal_info = th;
}
** could get to disk too early. NOT GOOD.
*/
if (!prepared || buffer_dirty(bh)) {
- printk("journal-1777: buffer %llu bad state %cPREPARED %cLOCKED %cDIRTY %cJDIRTY_WAIT\n", (unsigned long long)bh->b_blocknr, prepared ? ' ' : '!',
- buffer_locked(bh) ? ' ' : '!',
+ reiserfs_warning (p_s_sb, "journal-1777: buffer %llu bad state "
+ "%cPREPARED %cLOCKED %cDIRTY %cJDIRTY_WAIT",
+ (unsigned long long)bh->b_blocknr, prepared ? ' ' : '!',
+ buffer_locked(bh) ? ' ' : '!',
buffer_dirty(bh) ? ' ' : '!',
buffer_journal_dirty(bh) ? ' ' : '!') ;
}
if (atomic_read(&(SB_JOURNAL(p_s_sb)->j_wcount)) <= 0) {
- printk("journal-1409: journal_mark_dirty returning because j_wcount was %d\n", atomic_read(&(SB_JOURNAL(p_s_sb)->j_wcount))) ;
+ reiserfs_warning (p_s_sb, "journal-1409: journal_mark_dirty returning because j_wcount was %d", atomic_read(&(SB_JOURNAL(p_s_sb)->j_wcount))) ;
return 1 ;
}
/* this error means I've screwed up, and we've overflowed the transaction.
int journal_end(struct reiserfs_transaction_handle *th, struct super_block *p_s_sb, unsigned long nblocks) {
if (!current->journal_info && th->t_refcount > 1)
- printk("REISER-NESTING: th NULL, refcount %d\n", th->t_refcount);
+ reiserfs_warning (p_s_sb, "REISER-NESTING: th NULL, refcount %d",
+ th->t_refcount);
th->t_refcount--;
if (th->t_refcount > 0) {
mark_buffer_notjournal_dirty(bh) ;
put_bh(bh) ;
if (atomic_read(&(bh->b_count)) < 0) {
- printk("journal-1752: remove from trans, b_count < 0\n") ;
+ reiserfs_warning (p_s_sb, "journal-1752: remove from trans, b_count < 0");
}
ret = 1 ;
}
cleaned = 1 ;
put_bh(cn->bh) ;
if (atomic_read(&(cn->bh->b_count)) < 0) {
- printk("journal-2138: cn->bh->b_count < 0\n") ;
+ reiserfs_warning (p_s_sb, "journal-2138: cn->bh->b_count < 0");
}
}
if (cn->jlist) { /* since we are clearing the bh, we MUST dec nonzerolen */
if (bh) {
put_bh(bh) ; /* get_hash grabs the buffer */
if (atomic_read(&(bh->b_count)) < 0) {
- printk("journal-2165: bh->b_count < 0\n") ;
+ reiserfs_warning (p_s_sb, "journal-2165: bh->b_count < 0");
}
}
return 0 ;
BUG() ;
current->journal_info = th->t_handle_save;
- reiserfs_check_lock_depth("journal end");
+ reiserfs_check_lock_depth(p_s_sb, "journal end");
if (SB_JOURNAL(p_s_sb)->j_len == 0) {
reiserfs_prepare_for_journal(p_s_sb, SB_BUFFER_WITH_SB(p_s_sb), 1) ;
journal_mark_dirty(th, p_s_sb, SB_BUFFER_WITH_SB(p_s_sb)) ;
clear_bit(BH_JDirty, &(cn->bh->b_state)) ;
} else {
/* JDirty cleared sometime during transaction. don't log this one */
- reiserfs_warning("journal-2048: do_journal_end: BAD, buffer in journal hash, but not JDirty!\n") ;
+ reiserfs_warning(p_s_sb, "journal-2048: do_journal_end: BAD, buffer in journal hash, but not JDirty!") ;
brelse(cn->bh) ;
}
next = cn->next ;
flush_commit_list(p_s_sb, jl, 1) ;
}
out:
- reiserfs_check_lock_depth("journal end2");
+ reiserfs_check_lock_depth(p_s_sb, "journal end2");
th->t_trans_id = 0;
return 0 ;
}