diff options
author | Christoph Hellwig <hch@lst.de> | 2021-09-15 09:00:00 +0200 |
---|---|---|
committer | Gabriel Krisman Bertazi <krisman@collabora.com> | 2021-10-11 17:01:46 -0300 |
commit | 49bd03cc7e95cb78420305ca2f5ef67497b6fa80 (patch) | |
tree | 5fb64ae823accadc746d0e16dc290c8c4baa3cf8 /fs/ext4/super.c | |
parent | f3a9c82396006a5664f6e398d6928799d29de76e (diff) | |
download | linux-stable-49bd03cc7e95cb78420305ca2f5ef67497b6fa80.tar.gz linux-stable-49bd03cc7e95cb78420305ca2f5ef67497b6fa80.tar.bz2 linux-stable-49bd03cc7e95cb78420305ca2f5ef67497b6fa80.zip |
unicode: pass a UNICODE_AGE() tripple to utf8_load
Don't bother with pointless string parsing when the caller can just pass
the version in the format that the core expects. Also remove the
fallback to the latest version that none of the callers actually uses.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 26c0e6fc5bce..85e73093c61a 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -2018,9 +2018,9 @@ static const struct mount_opts { static const struct ext4_sb_encodings { __u16 magic; char *name; - char *version; + unsigned int version; } ext4_sb_encoding_map[] = { - {EXT4_ENC_UTF8_12_1, "utf8", "12.1.0"}, + {EXT4_ENC_UTF8_12_1, "utf8", UNICODE_AGE(12, 1, 0)}, }; static const struct ext4_sb_encodings * @@ -4166,15 +4166,21 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) encoding = utf8_load(encoding_info->version); if (IS_ERR(encoding)) { ext4_msg(sb, KERN_ERR, - "can't mount with superblock charset: %s-%s " + "can't mount with superblock charset: %s-%u.%u.%u " "not supported by the kernel. flags: 0x%x.", - encoding_info->name, encoding_info->version, + encoding_info->name, + unicode_major(encoding_info->version), + unicode_minor(encoding_info->version), + unicode_rev(encoding_info->version), encoding_flags); goto failed_mount; } ext4_msg(sb, KERN_INFO,"Using encoding defined by superblock: " - "%s-%s with flags 0x%hx", encoding_info->name, - encoding_info->version?:"\b", encoding_flags); + "%s-%u.%u.%u with flags 0x%hx", encoding_info->name, + unicode_major(encoding_info->version), + unicode_minor(encoding_info->version), + unicode_rev(encoding_info->version), + encoding_flags); sb->s_encoding = encoding; sb->s_encoding_flags = encoding_flags; |