fs/ext4/super.c: use strreplace() in ext4_fill_super()
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Thu, 25 Jun 2015 22:02:41 +0000 (15:02 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 26 Jun 2015 00:00:41 +0000 (17:00 -0700)
This makes a very large function a little smaller.

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>
fs/ext4/super.c

index ca9d4a2fed415649cd9744fdac2a1e8bdfa1631a..5f3c43a66937c96cef34ae091f4eb0137bb2c78c 100644 (file)
@@ -3420,7 +3420,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
        unsigned long journal_devnum = 0;
        unsigned long def_mount_opts;
        struct inode *root;
-       char *cp;
        const char *descr;
        int ret = -ENOMEM;
        int blocksize, clustersize;
@@ -3456,8 +3455,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 #endif
 
        /* Cleanup superblock name */
-       for (cp = sb->s_id; (cp = strchr(cp, '/'));)
-               *cp = '!';
+       strreplace(sb->s_id, '/', '!');
 
        /* -EINVAL is default */
        ret = -EINVAL;