linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>, Qu Wenruo <wqu@suse.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] btrfs: make btrfs module init/exit match their sequence
Date: Fri, 14 Oct 2022 08:10:01 +0800	[thread overview]
Message-ID: <b135361d-58ae-7bf9-fa3b-d11d5d5faaf9@oracle.com> (raw)
In-Reply-To: <96de6625-fb23-b44b-b4ab-9aae52ab70c3@gmx.com>


>>>>> +static bool mod_init_result[ARRAY_SIZE(mod_init_seq)];
>>>>
>>>>   Why not move bool mod_init_result into the (non-const) struct
>>>> init_sequence?
>>
>> Any comment on this suggestion?
> 
> Why you want to change the init_sequence array into non-const then?

   We can remove an isolated array mod_init_result to contain the result.
   Instead struct init_sequence can have results as a member.


>>>>> +    /*
>>>>> +     * If we call exit_btrfs_fs() it would cause section mismatch.
>>>>> +     * As init_btrfs_fs() belongs to .init.text, while 
>>>>> exit_btrfs_fs()
>>>>> +     * belongs to .exit.text.
>>>>> +     */
>>>>   Why not move it into a helper that can be called at both exit and
>>>> init?
>>>
>>> IIRC the last time I went the helper path, it caused section mismatch
>>> again, as all __init/__exit functions can only call functions inside
>>> .init/.exit.text.
>>>
>>> Thus the helper way won't solve it.
>>
>> Really? Maybe it was something else because, I see it as working.
>> As below.
> 
> You removed __exit, which removed the section type check.

  Yeah. We don't need __exit return type in the helper function. It does 
not make sense in the helper function.

  reply	other threads:[~2022-10-14  0:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-12  9:22 [PATCH v2] btrfs: make btrfs module init/exit match their sequence Qu Wenruo
2022-10-13  6:03 ` Anand Jain
2022-10-13  6:44   ` Qu Wenruo
2022-10-13 13:46     ` Anand Jain
2022-10-13 23:14       ` Qu Wenruo
2022-10-14  0:10         ` Anand Jain [this message]
2022-10-14  0:17           ` Qu Wenruo
2022-10-14 12:08     ` David Sterba
2022-10-13  9:14 ` Nikolay Borisov
2022-10-13  9:22   ` Qu Wenruo
2022-10-13  9:29     ` Nikolay Borisov
2022-10-13  9:51       ` Qu Wenruo
2022-10-17 18:07 ` David Sterba

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=b135361d-58ae-7bf9-fa3b-d11d5d5faaf9@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=wqu@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).