All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: [PATCH v3 02/15] btrfs: move assert helpers out of ctree.h
Date: Wed, 19 Oct 2022 10:50:48 -0400	[thread overview]
Message-ID: <d89ffe6bc0dd3fa90d5567a9a790a00acbf3d1e9.1666190849.git.josef@toxicpanda.com> (raw)
In-Reply-To: <cover.1666190849.git.josef@toxicpanda.com>

These call functions that aren't defined in, or will be moved out of,
ctree.h  Move them to super.c where the other assert/error message code
is defined.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/ctree.h | 18 +++---------------
 fs/btrfs/super.c | 14 ++++++++++++++
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 52987ee61c72..c97a02a81517 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -3320,18 +3320,11 @@ do {								\
 } while (0)
 
 #ifdef CONFIG_BTRFS_ASSERT
-__cold __noreturn
-static inline void assertfail(const char *expr, const char *file, int line)
-{
-	pr_err("assertion failed: %s, in %s:%d\n", expr, file, line);
-	BUG();
-}
+void __cold btrfs_assertfail(const char *expr, const char *file, int line);
 
 #define ASSERT(expr)						\
-	(likely(expr) ? (void)0 : assertfail(#expr, __FILE__, __LINE__))
-
+	(likely(expr) ? (void)0 : btrfs_assertfail(#expr, __FILE__, __LINE__))
 #else
-static inline void assertfail(const char *expr, const char* file, int line) { }
 #define ASSERT(expr)	(void)(expr)
 #endif
 
@@ -3391,12 +3384,7 @@ static inline unsigned long get_eb_page_index(unsigned long offset)
 #define EXPORT_FOR_TESTS
 #endif
 
-__cold
-static inline void btrfs_print_v0_err(struct btrfs_fs_info *fs_info)
-{
-	btrfs_err(fs_info,
-"Unsupported V0 extent filesystem detected. Aborting. Please re-create your filesystem with a newer kernel");
-}
+void __cold btrfs_print_v0_err(struct btrfs_fs_info *fs_info);
 
 __printf(5, 6)
 __cold
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index ebd59dc448dd..9aa14ac3a7ff 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -306,6 +306,20 @@ void __cold _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt,
 }
 #endif
 
+#ifdef CONFIG_BTRFS_ASSERT
+void __cold btrfs_assertfail(const char *expr, const char *file, int line)
+{
+	pr_err("assertion failed: %s, in %s:%d\n", expr, file, line);
+	BUG();
+}
+#endif
+
+void __cold btrfs_print_v0_err(struct btrfs_fs_info *fs_info)
+{
+	btrfs_err(fs_info,
+"Unsupported V0 extent filesystem detected. Aborting. Please re-create your filesystem with a newer kernel");
+}
+
 #if BITS_PER_LONG == 32
 void __cold btrfs_warn_32bit_limit(struct btrfs_fs_info *fs_info)
 {
-- 
2.26.3


  parent reply	other threads:[~2022-10-19 14:58 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 14:50 [PATCH v3 00/15] btrfs: split out larger chunks of ctree.h Josef Bacik
2022-10-19 14:50 ` [PATCH v3 01/15] btrfs: move fs wide helpers out " Josef Bacik
2022-10-20  6:08   ` Johannes Thumshirn
2022-10-21  6:11   ` Anand Jain
2022-10-19 14:50 ` Josef Bacik [this message]
2022-10-20  6:09   ` [PATCH v3 02/15] btrfs: move assert " Johannes Thumshirn
2022-10-20 15:49   ` David Sterba
2022-10-20 15:52     ` David Sterba
2022-10-19 14:50 ` [PATCH v3 03/15] btrfs: move the printk " Josef Bacik
2022-10-20  6:16   ` Johannes Thumshirn
2022-10-19 14:50 ` [PATCH v3 04/15] btrfs: push printk index code into their respective helpers Josef Bacik
2022-10-19 14:50 ` [PATCH v3 05/15] btrfs: move BTRFS_FS_STATE* defs and helpers to fs.h Josef Bacik
2022-10-19 14:50 ` [PATCH v3 06/15] btrfs: convert incompat and compat flag test helpers to defines Josef Bacik
2022-10-19 14:50 ` [PATCH v3 07/15] btrfs: move mount option definitions to fs.h Josef Bacik
2022-10-21  7:13   ` Anand Jain
2022-10-19 14:50 ` [PATCH v3 08/15] btrfs: move fs_info->flags enum " Josef Bacik
2022-10-21  6:57   ` Anand Jain
2022-10-19 14:50 ` [PATCH v3 09/15] btrfs: add a BTRFS_FS_NEED_TRANS_COMMIT flag Josef Bacik
2022-10-21  6:03   ` Anand Jain
2022-10-21  7:14     ` David Sterba
2022-10-19 14:50 ` [PATCH v3 10/15] btrfs: remove fs_info::pending_changes and related code Josef Bacik
2022-10-21  7:24   ` Anand Jain
2022-10-19 14:50 ` [PATCH v3 11/15] btrfs: move the compat/incompat flag masks to fs.h Josef Bacik
2022-10-21  7:16   ` Anand Jain
2022-10-19 14:50 ` [PATCH v3 12/15] btrfs: rename struct-funcs.c -> accessors.c Josef Bacik
2022-10-21  7:29   ` Anand Jain
2022-10-19 14:50 ` [PATCH v3 13/15] btrfs: move btrfs_map_token to accessors Josef Bacik
2022-10-20  6:22   ` Johannes Thumshirn
2022-10-19 14:51 ` [PATCH v3 14/15] btrfs: move accessor helpers into accessors.h Josef Bacik
2022-10-19 14:51 ` [PATCH v3 15/15] btrfs: remove temporary btrfs_map_token declaration in ctree.h Josef Bacik
2022-10-20  6:23   ` Johannes Thumshirn
2022-10-21  7:25   ` Anand Jain
2022-10-20 16:29 ` [PATCH v3 00/15] btrfs: split out larger chunks of ctree.h 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=d89ffe6bc0dd3fa90d5567a9a790a00acbf3d1e9.1666190849.git.josef@toxicpanda.com \
    --to=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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.