Commit 81ae394b authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Linus Torvalds

fs/jbd2/journal.c: use strreplace()

In one case, we eliminate a local variable; in the other a strlen()
call and some .text.
Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 90a9befb
...@@ -1137,7 +1137,6 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev, ...@@ -1137,7 +1137,6 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev,
{ {
journal_t *journal = journal_init_common(); journal_t *journal = journal_init_common();
struct buffer_head *bh; struct buffer_head *bh;
char *p;
int n; int n;
if (!journal) if (!journal)
...@@ -1150,9 +1149,7 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev, ...@@ -1150,9 +1149,7 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev,
journal->j_blk_offset = start; journal->j_blk_offset = start;
journal->j_maxlen = len; journal->j_maxlen = len;
bdevname(journal->j_dev, journal->j_devname); bdevname(journal->j_dev, journal->j_devname);
p = journal->j_devname; strreplace(journal->j_devname, '/', '!');
while ((p = strchr(p, '/')))
*p = '!';
jbd2_stats_proc_init(journal); jbd2_stats_proc_init(journal);
n = journal->j_blocksize / sizeof(journal_block_tag_t); n = journal->j_blocksize / sizeof(journal_block_tag_t);
journal->j_wbufsize = n; journal->j_wbufsize = n;
...@@ -1204,10 +1201,7 @@ journal_t * jbd2_journal_init_inode (struct inode *inode) ...@@ -1204,10 +1201,7 @@ journal_t * jbd2_journal_init_inode (struct inode *inode)
journal->j_dev = journal->j_fs_dev = inode->i_sb->s_bdev; journal->j_dev = journal->j_fs_dev = inode->i_sb->s_bdev;
journal->j_inode = inode; journal->j_inode = inode;
bdevname(journal->j_dev, journal->j_devname); bdevname(journal->j_dev, journal->j_devname);
p = journal->j_devname; p = strreplace(journal->j_devname, '/', '!');
while ((p = strchr(p, '/')))
*p = '!';
p = journal->j_devname + strlen(journal->j_devname);
sprintf(p, "-%lu", journal->j_inode->i_ino); sprintf(p, "-%lu", journal->j_inode->i_ino);
jbd_debug(1, jbd_debug(1,
"journal %p: inode %s/%ld, size %Ld, bits %d, blksize %ld\n", "journal %p: inode %s/%ld, size %Ld, bits %d, blksize %ld\n",
......
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