All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <krisman@collabora.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Shreeya Patel <shreeya.patel@collabora.com>,
	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
Date: Mon, 06 Sep 2021 18:16:24 -0400	[thread overview]
Message-ID: <87a6kpfiyv.fsf@collabora.com> (raw)
In-Reply-To: <87h7exfj31.fsf@collabora.com> (Gabriel Krisman Bertazi's message of "Mon, 06 Sep 2021 18:13:54 -0400")

Gabriel Krisman Bertazi <krisman@collabora.com> writes:

> Christoph Hellwig <hch@lst.de> 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 <hch@lst.de>
>> ---
>>  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

WARNING: multiple messages have this Message-ID (diff)
From: Gabriel Krisman Bertazi <krisman@collabora.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	Shreeya Patel <shreeya.patel@collabora.com>,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 05/11] unicode: pass a UNICODE_AGE() tripple to utf8_load
Date: Mon, 06 Sep 2021 18:16:24 -0400	[thread overview]
Message-ID: <87a6kpfiyv.fsf@collabora.com> (raw)
In-Reply-To: <87h7exfj31.fsf@collabora.com> (Gabriel Krisman Bertazi's message of "Mon, 06 Sep 2021 18:13:54 -0400")

Gabriel Krisman Bertazi <krisman@collabora.com> writes:

> Christoph Hellwig <hch@lst.de> 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 <hch@lst.de>
>> ---
>>  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


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply	other threads:[~2021-09-06 22:16 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 14:06 unicode cleanups, and split the data table into a separate module Christoph Hellwig
2021-08-18 14:06 ` [f2fs-dev] " Christoph Hellwig
2021-08-18 14:06 ` [PATCH 01/11] ext4: simplify ext4_sb_read_encoding Christoph Hellwig
2021-08-18 14:06   ` [f2fs-dev] " Christoph Hellwig
2021-08-23 14:51   ` Gabriel Krisman Bertazi
2021-08-23 14:51     ` [f2fs-dev] " Gabriel Krisman Bertazi
2021-09-08 20:53   ` Theodore Ts'o
2021-09-08 20:53     ` [f2fs-dev] " Theodore Ts'o
2021-08-18 14:06 ` [PATCH 02/11] f2fs: simplify f2fs_sb_read_encoding Christoph Hellwig
2021-08-18 14:06   ` [f2fs-dev] " Christoph Hellwig
2021-08-23 14:52   ` Gabriel Krisman Bertazi
2021-08-23 14:52     ` [f2fs-dev] " Gabriel Krisman Bertazi
2021-08-24  6:21   ` Chao Yu
2021-08-24  6:21     ` Chao Yu
2021-08-18 14:06 ` [PATCH 03/11] unicode: remove the charset field from struct unicode_map Christoph Hellwig
2021-08-18 14:06   ` [f2fs-dev] " Christoph Hellwig
2021-08-23 14:53   ` Gabriel Krisman Bertazi
2021-08-23 14:53     ` Gabriel Krisman Bertazi
2021-08-18 14:06 ` [f2fs-dev] [PATCH 04/11] unicode: mark the version field in struct unicode_map unsigned Christoph Hellwig
2021-08-18 14:06   ` Christoph Hellwig
2021-08-23 14:54   ` Gabriel Krisman Bertazi
2021-08-23 14:54     ` [f2fs-dev] " Gabriel Krisman Bertazi
2021-08-18 14:06 ` [f2fs-dev] [PATCH 05/11] unicode: pass a UNICODE_AGE() tripple to utf8_load Christoph Hellwig
2021-08-18 14:06   ` Christoph Hellwig
2021-08-23 15:02   ` Gabriel Krisman Bertazi
2021-08-23 15:02     ` [f2fs-dev] " Gabriel Krisman Bertazi
2021-08-24  7:34     ` Christoph Hellwig
2021-08-24  7:34       ` [f2fs-dev] " Christoph Hellwig
2021-09-06 22:13   ` Gabriel Krisman Bertazi
2021-09-06 22:13     ` [f2fs-dev] " Gabriel Krisman Bertazi
2021-09-06 22:16     ` Gabriel Krisman Bertazi [this message]
2021-09-06 22:16       ` Gabriel Krisman Bertazi
2021-09-08  6:19       ` Christoph Hellwig
2021-09-08  6:19         ` [f2fs-dev] " Christoph Hellwig
2021-08-18 14:06 ` [f2fs-dev] [PATCH 06/11] unicode: remove the unused utf8{, n}age{min, max} functions Christoph Hellwig
2021-08-18 14:06   ` [PATCH 06/11] unicode: remove the unused utf8{,n}age{min,max} functions Christoph Hellwig
2021-08-18 14:06 ` [f2fs-dev] [PATCH 07/11] unicode: simplify utf8len Christoph Hellwig
2021-08-18 14:06   ` Christoph Hellwig
2021-08-18 14:06 ` [f2fs-dev] [PATCH 08/11] unicode: move utf8cursor to utf8-selftest.c Christoph Hellwig
2021-08-18 14:06   ` Christoph Hellwig
2021-08-18 14:06 ` [f2fs-dev] [PATCH 09/11] unicode: cache the normalization tables in struct unicode_map Christoph Hellwig
2021-08-18 14:06   ` Christoph Hellwig
2021-08-18 14:06 ` [f2fs-dev] [PATCH 10/11] unicode: Add utf8-data module Christoph Hellwig
2021-08-18 14:06   ` Christoph Hellwig
2021-08-18 14:06 ` [PATCH 11/11] unicode: only export internal symbols for the selftests Christoph Hellwig
2021-08-18 14:06   ` [f2fs-dev] " Christoph Hellwig
2021-08-18 14:56   ` Matthew Wilcox
2021-08-18 14:56     ` [f2fs-dev] " Matthew Wilcox
2021-08-18 14:58     ` Christoph Hellwig
2021-08-18 14:58       ` [f2fs-dev] " Christoph Hellwig
2021-09-15  6:59 unicode cleanups, and split the data table into a separate module v2 Christoph Hellwig
2021-09-15  7:00 ` [PATCH 05/11] unicode: pass a UNICODE_AGE() tripple to utf8_load Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a6kpfiyv.fsf@collabora.com \
    --to=krisman@collabora.com \
    --cc=hch@lst.de \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=shreeya.patel@collabora.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.