Skip to content

Commit 2ccdc41

Browse files
author
Al Viro
committed
kill reiserfs_bdevname()
it's never called with NULL argument... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent b42d570 commit 2ccdc41

3 files changed

Lines changed: 6 additions & 14 deletions

File tree

‎fs/reiserfs/procfs.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ int reiserfs_proc_info_init(struct super_block *sb)
419419
char *s;
420420

421421
/* Some block devices use /'s */
422-
strlcpy(b, reiserfs_bdevname(sb), BDEVNAME_SIZE);
422+
strlcpy(b, sb->s_id, BDEVNAME_SIZE);
423423
s = strchr(b, '/');
424424
if (s)
425425
*s = '!';
@@ -449,7 +449,7 @@ int reiserfs_proc_info_done(struct super_block *sb)
449449
char *s;
450450

451451
/* Some block devices use /'s */
452-
strlcpy(b, reiserfs_bdevname(sb), BDEVNAME_SIZE);
452+
strlcpy(b, sb->s_id, BDEVNAME_SIZE);
453453
s = strchr(b, '/');
454454
if (s)
455455
*s = '!';

‎fs/reiserfs/reiserfs.h‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -608,14 +608,6 @@ int reiserfs_resize(struct super_block *, unsigned long);
608608

609609
#define SB_DISK_JOURNAL_HEAD(s) (SB_JOURNAL(s)->j_header_bh->)
610610

611-
/* A safe version of the "bdevname", which returns the "s_id" field of
612-
* a superblock or else "Null superblock" if the super block is NULL.
613-
*/
614-
static inline char *reiserfs_bdevname(struct super_block *s)
615-
{
616-
return (s == NULL) ? "Null superblock" : s->s_id;
617-
}
618-
619611
#define reiserfs_is_journal_aborted(journal) (unlikely (__reiserfs_is_journal_aborted (journal)))
620612
static inline int __reiserfs_is_journal_aborted(struct reiserfs_journal
621613
*journal)

‎fs/reiserfs/super.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,7 @@ static int read_super_block(struct super_block *s, int offset)
14791479
if (!bh) {
14801480
reiserfs_warning(s, "sh-2006",
14811481
"bread failed (dev %s, block %lu, size %lu)",
1482-
reiserfs_bdevname(s), offset / s->s_blocksize,
1482+
s->s_id, offset / s->s_blocksize,
14831483
s->s_blocksize);
14841484
return 1;
14851485
}
@@ -1500,7 +1500,7 @@ static int read_super_block(struct super_block *s, int offset)
15001500
if (!bh) {
15011501
reiserfs_warning(s, "sh-2007",
15021502
"bread failed (dev %s, block %lu, size %lu)",
1503-
reiserfs_bdevname(s), offset / s->s_blocksize,
1503+
s->s_id, offset / s->s_blocksize,
15041504
s->s_blocksize);
15051505
return 1;
15061506
}
@@ -1509,7 +1509,7 @@ static int read_super_block(struct super_block *s, int offset)
15091509
if (sb_blocksize(rs) != s->s_blocksize) {
15101510
reiserfs_warning(s, "sh-2011", "can't find a reiserfs "
15111511
"filesystem on (dev %s, block %Lu, size %lu)",
1512-
reiserfs_bdevname(s),
1512+
s->s_id,
15131513
(unsigned long long)bh->b_blocknr,
15141514
s->s_blocksize);
15151515
brelse(bh);
@@ -1825,7 +1825,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
18251825
/* try new format (64-th 1k block), which can contain reiserfs super block */
18261826
else if (read_super_block(s, REISERFS_DISK_OFFSET_IN_BYTES)) {
18271827
SWARN(silent, s, "sh-2021", "can not find reiserfs on %s",
1828-
reiserfs_bdevname(s));
1828+
s->s_id);
18291829
goto error_unlocked;
18301830
}
18311831

0 commit comments

Comments
 (0)