linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] btrfs: make btrfs module init/exit match their sequence
Date: Thu, 13 Oct 2022 14:03:12 +0800	[thread overview]
Message-ID: <63038e02-81fc-92b7-4e33-0a2c6c356698@oracle.com> (raw)
In-Reply-To: <679d22de5f137a32e97ffa5e7d5f5961f7a2b782.1665566176.git.wqu@suse.com>


> With this patch, init_btrfs_fs()/exit_btrfs_fs() will be much easier to
> expand and will always follow the strict order.
> 

Nice idea.


>   
> -	btrfs_print_mod_info();
::
>   
> -	err = btrfs_run_sanity_tests();

::

> +	}, {
> +		.init_func = btrfs_run_sanity_tests,
> +		.exit_func = NULL,
> +	}, {
> +		.init_func = btrfs_print_mod_info,
> +		.exit_func = NULL,
> +	}, {


  Is there any special reason to switch the order of calling for 
sanity_tests() and mod_info()?


> +static bool mod_init_result[ARRAY_SIZE(mod_init_seq)];

  Why not move bool mod_init_result into the (non-const) struct 
init_sequence?

> +	/*
> +	 * 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?

-Anand

  reply	other threads:[~2022-10-13  6:05 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 [this message]
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
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=63038e02-81fc-92b7-4e33-0a2c6c356698@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --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).