2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-21 11:44:01 +08:00

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: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Rasmus Villemoes 2015-06-25 15:02:38 -07:00 committed by Linus Torvalds
parent 90a9befb20
commit 81ae394bdc

View File

@ -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,
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)
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",