Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3204780pxb; Mon, 6 Sep 2021 15:25:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVpaZKMKdZweBxh3CDI3NCy9uuRN/f0qqCB65BSeZ4rRVMCa5mJszrm34UbFtzmxaPVpIT X-Received: by 2002:a17:906:417:: with SMTP id d23mr15901308eja.383.1630967147767; Mon, 06 Sep 2021 15:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630967147; cv=none; d=google.com; s=arc-20160816; b=NH703moATE+Xz9hjSQwIrlx6EDYXACyXdaVQiQsNWlz5IM8r21ygxNQOLOypH6a0TI PgzvonB+H/U5vyOywWDukUxpSKD2Z7gB84AUT72exSfxbCo5UeVOFJkbzdKoRNXHqSWI tMIt3W5efew5XLX+gBXlGJkmadTrIk7zV0BKtEYCSlc6tQTqxU1JL4fl06mafWEzBMLA 4oF9/rIV4iZg5ATtoWNvXRsaZNMpBv1pzchsXvJipby5BzbSbv9SbYQsQD6wmjC//9wl 4jEyd++lSltmAWkzvW6Kwi6Qz4nmMZumCZhHSQf1ajk8Q+6u5ZRA1/IrWv6lQnhfrzJ+ IP4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:organization:subject:cc:to:from; bh=IcULeXjBq9EO+kUkE5IzDgLD3DirayfY82IgSZLMWZc=; b=qs+JGK8u7MVDzljWpHfp8uoEnW6xcAbsY2hnoVOPEeNpSzz/gelP+rouh8g41YNQnY L/rIsOJDoK9cBqEr6mKCRigihAiALWizwMj3A0W+kgWQJQhfn8D0iM6nI1E742IEVyjD i2ya9MbzOXeTqcat1DerJPvFK5EMPaKZOKYT+uYulkUiMT2GQmG6Njuk9ndubhjcp3fd TkWu8tJ2/eNIbKgtwRWmX5jaSXMNwjc7A/+ps55B85bLPTgLXzVtjMExDYJbbiuCzGlC WlEgB1PRz7+j8rt2Wnv+BYckZehIwObza9RHPa8C58hPabJlbtjzopkYd0grvwiXBaOu us+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sb9si9380782ejb.363.2021.09.06.15.25.23; Mon, 06 Sep 2021 15:25:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237799AbhIFWRi (ORCPT + 99 others); Mon, 6 Sep 2021 18:17:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230384AbhIFWRh (ORCPT ); Mon, 6 Sep 2021 18:17:37 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62A8CC061757; Mon, 6 Sep 2021 15:16:31 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id C90E81F429DF From: Gabriel Krisman Bertazi To: Christoph Hellwig Cc: Shreeya Patel , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [PATCH 05/11] unicode: pass a UNICODE_AGE() tripple to utf8_load Organization: Collabora References: <20210818140651.17181-1-hch@lst.de> <20210818140651.17181-6-hch@lst.de> <87h7exfj31.fsf@collabora.com> Date: Mon, 06 Sep 2021 18:16:24 -0400 In-Reply-To: <87h7exfj31.fsf@collabora.com> (Gabriel Krisman Bertazi's message of "Mon, 06 Sep 2021 18:13:54 -0400") Message-ID: <87a6kpfiyv.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Gabriel Krisman Bertazi writes: > Christoph Hellwig writes: > >> 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 >> --- >> fs/ext4/super.c | 10 ++++---- >> fs/f2fs/super.c | 10 ++++---- >> fs/unicode/utf8-core.c | 50 ++++---------------------------------- >> fs/unicode/utf8-norm.c | 11 ++------- >> fs/unicode/utf8-selftest.c | 15 ++++++------ >> fs/unicode/utf8n.h | 14 ++--------- >> include/linux/unicode.h | 11 ++++++++- >> 7 files changed, 37 insertions(+), 84 deletions(-) >> >> diff --git a/fs/ext4/super.c b/fs/ext4/super.c >> index a68be582bba5..be418a30b52e 100644 >> --- a/fs/ext4/super.c >> +++ b/fs/ext4/super.c >> @@ -2016,9 +2016,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 * >> @@ -4308,15 +4308,15 @@ 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-0x%x " >> "not supported by the kernel. flags: 0x%x.", >> encoding_info->name, encoding_info->version, >> encoding_flags); >> goto failed_mount; > > "Using encoding defined by superblock: utf8-0xc0100 with flags 0x0" > > This is much less readable than what we previously had: > > "Using encoding defined by superblock: utf8-12.1.0 with flags 0x0" > > It is minor, but can we do instead: > > ext4_msg("... %u.%u.%u\n", (encoding_info->version>>12) & 0xff, > (encoding_info->version>>8) & 0xff), encoding_info->version & 0xff)) > > The rest of the series looks good and I can pick it up for 5.15, unless > someone has anything else to say? It has lived on the list for a while > now. > Ugh, pressed reply too quickly. Sorry for the multiple email reply. In the summary line: tripple -> triple. -- Gabriel Krisman Bertazi