All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Yan <yanaijie@huawei.com>
To: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Cc: <tytso@mit.edu>, <adilger.kernel@dilger.ca>, <jack@suse.cz>,
	<lczerner@redhat.com>, <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH v2 07/13] ext4: factor out ext4_encoding_init()
Date: Mon, 12 Sep 2022 11:12:48 +0800	[thread overview]
Message-ID: <7b5a5907-a0bf-58a5-f4d7-f42a9b4755de@huawei.com> (raw)
In-Reply-To: <2ef9347c-b7b8-d219-d6bb-3c9fa611506a@huawei.com>


On 2022/9/12 10:30, Jason Yan wrote:
> 
> On 2022/9/8 16:56, Ritesh Harjani (IBM) wrote:
>> On 22/09/03 11:01AM, Jason Yan wrote:
>>> Factor out ext4_encoding_init(). No functional change.
>>>
>>> Signed-off-by: Jason Yan <yanaijie@huawei.com>
>>> Reviewed-by: Jan Kara <jack@suse.cz>
>>> ---
>>>   fs/ext4/super.c | 80 +++++++++++++++++++++++++++----------------------
>>>   1 file changed, 44 insertions(+), 36 deletions(-)
>>>
>>> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
>>> index f8806226b796..67972b0218c0 100644
>>> --- a/fs/ext4/super.c
>>> +++ b/fs/ext4/super.c
>>> @@ -4521,6 +4521,48 @@ static int ext4_inode_info_init(struct 
>>> super_block *sb,
>>>       return 0;
>>>   }
>>> +static int ext4_encoding_init(struct super_block *sb, struct 
>>> ext4_super_block *es)
>>> +{
>>> +#if IS_ENABLED(CONFIG_UNICODE)
>>
>> How about simplying it like below.
>>         if (!IS_ENABLED(CONFIG_UNICODE))
>>             return 0;
>>
>>         <...>
>>
>> Then we don't need #ifdef CONFIG_UNICODE
>>
> 
> Nice idea. Will update.
> 

Sorry I tried to compile with this change but the compiler is not clever 
enough to ignore the code down if CONFIG_UNICODE is not enabled.


fs/ext4/super.c: In function ‘ext4_encoding_init’:
fs/ext4/super.c:4529:2: warning: ISO C90 forbids mixed declarations and 
code [-Wdeclaration-after-statement]
  4529 |  const struct ext4_sb_encodings *encoding_info;
       |  ^~~~~
fs/ext4/super.c:4533:42: error: ‘struct super_block’ has no member named 
‘s_encoding’
  4533 |  if (!ext4_has_feature_casefold(sb) || sb->s_encoding)
       |                                          ^~
fs/ext4/super.c:4536:18: error: implicit declaration of function 
‘ext4_sb_read_encoding’; did you mean ‘ext4_sb_bread_unmovable’? 
[-Werror=implicit-function-declaration]
  4536 |  encoding_info = ext4_sb_read_encoding(es);
       |                  ^~~~~~~~~~~~~~~~~~~~~
       |                  ext4_sb_bread_unmovable
fs/ext4/super.c:4536:16: warning: assignment to ‘const struct 
ext4_sb_encodings *’ from ‘int’ makes pointer from integer without a 
cast [-Wint-conversion]
  4536 |  encoding_info = ext4_sb_read_encoding(es);
       |                ^
fs/ext4/super.c:4543:36: error: dereferencing pointer to incomplete type 
‘const struct ext4_sb_encodings’
  4543 |  encoding = utf8_load(encoding_info->version);
       |                                    ^~
fs/ext4/super.c:4562:4: error: ‘struct super_block’ has no member named 
‘s_encoding’
  4562 |  sb->s_encoding = encoding;
       |    ^~
fs/ext4/super.c:4563:4: error: ‘struct super_block’ has no member named 
‘s_encoding_flags’
  4563 |  sb->s_encoding_flags = encoding_flags;
       |    ^~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:249: fs/ext4/super.o] Error 1
make[1]: *** [scripts/Makefile.build:465: fs/ext4] Error 2
make: *** [Makefile:1852: fs] Error 2




> Thanks
> Jason
> .




  reply	other threads:[~2022-09-12  3:13 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-03  3:01 [PATCH v2 00/13] some refactor of __ext4_fill_super() Jason Yan
2022-09-03  3:01 ` [PATCH v2 01/13] ext4: goto right label 'failed_mount3a' Jason Yan
2022-09-08  8:39   ` Ritesh Harjani (IBM)
2022-09-03  3:01 ` [PATCH v2 02/13] ext4: remove cantfind_ext4 error handler Jason Yan
2022-09-08  8:40   ` Ritesh Harjani (IBM)
2022-09-03  3:01 ` [PATCH v2 03/13] ext4: factor out ext4_set_def_opts() Jason Yan
2022-09-08  8:44   ` Ritesh Harjani (IBM)
2022-09-12  2:20     ` Jason Yan
2022-09-03  3:01 ` [PATCH v2 04/13] ext4: factor out ext4_handle_clustersize() Jason Yan
2022-09-08  8:45   ` Ritesh Harjani (IBM)
2022-09-03  3:01 ` [PATCH v2 05/13] ext4: factor out ext4_fast_commit_init() Jason Yan
2022-09-08  8:45   ` Ritesh Harjani (IBM)
2022-09-03  3:01 ` [PATCH v2 06/13] ext4: factor out ext4_inode_info_init() Jason Yan
2022-09-08  8:46   ` Ritesh Harjani (IBM)
2022-09-03  3:01 ` [PATCH v2 07/13] ext4: factor out ext4_encoding_init() Jason Yan
2022-09-08  8:56   ` Ritesh Harjani (IBM)
2022-09-12  2:30     ` Jason Yan
2022-09-12  3:12       ` Jason Yan [this message]
2022-09-03  3:01 ` [PATCH v2 08/13] ext4: factor out ext4_init_metadata_csum() Jason Yan
2022-09-08  8:57   ` Ritesh Harjani (IBM)
2022-09-03  3:01 ` [PATCH v2 09/13] ext4: factor out ext4_check_feature_compatibility() Jason Yan
2022-09-08  8:58   ` Ritesh Harjani (IBM)
2022-09-03  3:01 ` [PATCH v2 10/13] ext4: factor out ext4_geometry_check() Jason Yan
2022-09-08  9:00   ` Ritesh Harjani (IBM)
2022-09-03  3:01 ` [PATCH v2 11/13] ext4: factor out ext4_group_desc_init() and ext4_group_desc_free() Jason Yan
2022-09-08  9:03   ` Ritesh Harjani (IBM)
2022-09-03  3:01 ` [PATCH v2 12/13] ext4: factor out ext4_load_and_init_journal() Jason Yan
2022-09-08  9:04   ` Ritesh Harjani (IBM)
2022-09-03  3:01 ` [PATCH v2 13/13] ext4: factor out ext4_journal_data_mode_check() Jason Yan
2022-09-08  9:06   ` Ritesh Harjani (IBM)

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=7b5a5907-a0bf-58a5-f4d7-f42a9b4755de@huawei.com \
    --to=yanaijie@huawei.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=jack@suse.cz \
    --cc=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=ritesh.list@gmail.com \
    --cc=tytso@mit.edu \
    /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.