Commit 828156c1 authored by Oleg Drokin's avatar Oleg Drokin

Many files:

  reiserfs: use reiserfs_bdevname(s) instead of s->s_id. From Josh MacDonald.
parent caef5e31
......@@ -103,7 +103,7 @@ static void _reiserfs_free_block (struct reiserfs_transaction_handle *th, unsign
if (nr >= sb_bmap_nr (rs)) {
reiserfs_warning ("vs-4075: reiserfs_free_block: "
"block %lu is out of range on %s\n",
block, s->s_id);
block, reiserfs_bdevname (s));
return;
}
......@@ -113,7 +113,7 @@ static void _reiserfs_free_block (struct reiserfs_transaction_handle *th, unsign
if (!reiserfs_test_and_clear_le_bit (offset, apbh[nr]->b_data)) {
reiserfs_warning ("vs-4080: reiserfs_free_block: "
"free_block (%s:%lu)[dev:blocknr]: bit already cleared\n",
s->s_id, block);
reiserfs_bdevname (s), block);
}
journal_mark_dirty (th, s, apbh[nr]);
......
......@@ -1725,7 +1725,8 @@ static int grab_tail_page(struct inode *p_s_inode,
** call prepare_write
*/
reiserfs_warning("clm-6000: error reading block %lu on dev %s\n",
bh->b_blocknr, p_s_inode->i_sb->s_id) ;
bh->b_blocknr,
reiserfs_bdevname (p_s_inode->i_sb)) ;
error = -EIO ;
goto unlock ;
}
......@@ -1894,7 +1895,7 @@ static int map_block_for_writepage(struct inode *inode,
goto research ;
}
} else {
reiserfs_warning("clm-6003: bad item inode %lu, device %s\n", inode->i_ino, inode->i_sb->s_id) ;
reiserfs_warning("clm-6003: bad item inode %lu, device %s\n", inode->i_ino, reiserfs_bdevname (inode->i_sb)) ;
retval = -EIO ;
goto out ;
}
......
......@@ -1667,7 +1667,7 @@ static int journal_read(struct super_block *p_s_sb) {
cur_dblock = SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) ;
printk("reiserfs: checking transaction log (%s) for (%s)\n",
__bdevname(SB_JOURNAL_DEV(p_s_sb)), p_s_sb->s_id) ;
__bdevname(SB_JOURNAL_DEV(p_s_sb)), reiserfs_bdevname(p_s_sb));
start = CURRENT_TIME ;
/* step 1, read in the journal header block. Check the transaction it says
......@@ -2052,15 +2052,11 @@ int journal_init(struct super_block *p_s_sb, const char * j_dev_name, int old_fo
/* 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))) {
char jname[ 32 ];
char fname[ 32 ];
strcpy( jname, kdevname( SB_JOURNAL_DEV(p_s_sb) ) );
strcpy( fname, p_s_sb->s_id);
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, jname,
sb_jp_journal_magic(rs), fname);
jh->jh_journal.jp_journal_magic, kdevname( SB_JOURNAL_DEV(p_s_sb) ),
sb_jp_journal_magic(rs), reiserfs_bdevname (p_s_sb));
brelse (bhjh);
release_journal_dev(p_s_sb, journal);
return 1 ;
......
......@@ -918,7 +918,7 @@ static int reiserfs_unlink (struct inode * dir, struct dentry *dentry)
if (!inode->i_nlink) {
printk("reiserfs_unlink: deleting nonexistent file (%s:%lu), %d\n",
inode->i_sb->s_id, inode->i_ino, inode->i_nlink);
reiserfs_bdevname (inode->i_sb), inode->i_ino, inode->i_nlink);
inode->i_nlink = 1;
}
......
......@@ -337,7 +337,7 @@ void reiserfs_panic (struct super_block * sb, const char * fmt, ...)
/* this is not actually called, but makes reiserfs_panic() "noreturn" */
panic ("REISERFS: panic (device %s): %s\n",
sb ? sb->s_id : "sb == 0", error_buf);
reiserfs_bdevname (sb), error_buf);
}
......
......@@ -556,13 +556,13 @@ static const char *proc_info_root_name = "fs/reiserfs";
int reiserfs_proc_info_init( struct super_block *sb )
{
spin_lock_init( & __PINFO( sb ).lock );
REISERFS_SB(sb)->procdir = proc_mkdir(sb->s_id, proc_info_root);
REISERFS_SB(sb)->procdir = proc_mkdir(reiserfs_bdevname (sb), proc_info_root);
if( REISERFS_SB(sb)->procdir ) {
REISERFS_SB(sb)->procdir -> owner = THIS_MODULE;
return 0;
}
reiserfs_warning( "reiserfs: cannot create /proc/%s/%s\n",
proc_info_root_name, sb->s_id );
proc_info_root_name, reiserfs_bdevname (sb) );
return 1;
}
......@@ -573,7 +573,7 @@ int reiserfs_proc_info_done( struct super_block *sb )
__PINFO( sb ).exiting = 1;
spin_unlock( & __PINFO( sb ).lock );
if ( proc_info_root ) {
remove_proc_entry( sb->s_id, proc_info_root );
remove_proc_entry( reiserfs_bdevname (sb), proc_info_root );
REISERFS_SB(sb)->procdir = NULL;
}
return 0;
......
......@@ -735,7 +735,7 @@ static int read_super_block (struct super_block * s, int offset)
if (!bh) {
printk ("sh-2006: read_super_block: "
"bread failed (dev %s, block %lu, size %lu)\n",
s->s_id, offset / s->s_blocksize, s->s_blocksize);
reiserfs_bdevname (s), offset / s->s_blocksize, s->s_blocksize);
return 1;
}
......@@ -755,7 +755,7 @@ static int read_super_block (struct super_block * s, int offset)
if (!bh) {
printk("sh-2007: read_super_block: "
"bread failed (dev %s, block %lu, size %lu)\n",
s->s_id, offset / s->s_blocksize, s->s_blocksize);
reiserfs_bdevname (s), offset / s->s_blocksize, s->s_blocksize);
return 1;
}
......@@ -763,7 +763,7 @@ static int read_super_block (struct super_block * s, int offset)
if (sb_blocksize(rs) != s->s_blocksize) {
printk ("sh-2011: read_super_block: "
"can't find a reiserfs filesystem on (dev %s, block %lu, size %lu)\n",
s->s_id, bh->b_blocknr, s->s_blocksize);
reiserfs_bdevname (s), bh->b_blocknr, s->s_blocksize);
brelse (bh);
return 1;
}
......@@ -772,7 +772,7 @@ static int read_super_block (struct super_block * s, int offset)
brelse(bh) ;
printk("dev %s: Unfinished reiserfsck --rebuild-tree run detected. Please run\n"
"reiserfsck --rebuild-tree and wait for a completion. If that fails\n"
"get newer reiserfsprogs package\n", s->s_id);
"get newer reiserfsprogs package\n", reiserfs_bdevname (s));
return 1;
}
......@@ -884,7 +884,7 @@ __u32 find_hash_out (struct super_block * s)
( (r5hash == yurahash) && (yurahash == GET_HASH_VALUE( deh_offset(&(de.de_deh[de.de_entry_num])))) ) ) {
reiserfs_warning("reiserfs: Unable to automatically detect hash"
"function for device %s\n"
"please mount with -o hash={tea,rupasov,r5}\n", s->s_id);
"please mount with -o hash={tea,rupasov,r5}\n", reiserfs_bdevname (s));
hash = UNSET_HASH;
break;
}
......@@ -896,7 +896,7 @@ __u32 find_hash_out (struct super_block * s)
hash = R5_HASH;
else {
reiserfs_warning("reiserfs: Unrecognised hash function for "
"device %s\n", s->s_id);
"device %s\n", reiserfs_bdevname (s));
hash = UNSET_HASH;
}
} while (0);
......@@ -1031,7 +1031,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
old_format = 1;
/* try new format (64-th 1k block), which can contain reiserfs super block */
else if (read_super_block (s, REISERFS_DISK_OFFSET_IN_BYTES)) {
printk("sh-2021: reiserfs_fill_super: can not find reiserfs on %s\n", s->s_id);
printk("sh-2021: reiserfs_fill_super: can not find reiserfs on %s\n", reiserfs_bdevname (s));
goto error;
}
sbi->s_mount_state = SB_REISERFS_STATE(s);
......
......@@ -456,4 +456,12 @@ int reiserfs_resize(struct super_block *, unsigned long) ;
#define SB_JOURNAL_MAX_TRANS_AGE(s) (SB_JOURNAL(s)->s_journal_max_trans_age)
#define SB_JOURNAL_DEV(s) (SB_JOURNAL(s)->j_dev)
/* A safe version of the "bdevname", which returns the "s_id" field of
* a superblock or else "Null superblock" if the super block is NULL.
*/
static inline char *reiserfs_bdevname(struct super_block *s)
{
return (s == NULL) ? "Null superblock" : s -> s_id;
}
#endif /* _LINUX_REISER_FS_SB */
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