linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 1/2] btrfs-progs: fix compile warning due to global fs_info cleanup
Date: Wed, 26 Aug 2020 08:47:33 +0800	[thread overview]
Message-ID: <20200826004734.89905-2-wqu@suse.com> (raw)
In-Reply-To: <20200826004734.89905-1-wqu@suse.com>

[BUG]
Compiler gives the following warning:

  check/main.c: In function 'check_chunks_and_extents':
  check/main.c:8712:30: warning: assignment to 'int (*)(struct btrfs_fs_info *, u64,  u64,  u64,  u64,  u64,  u64,  int)' {aka 'int (*)(struct btrfs_fs_info *, long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int,  int)'} from incompatible pointer type 'int (*)(u64,  u64,  u64,  u64,  u64,  u64,  int)' {aka 'int (*)(long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int,  int)'} [-Wincompatible-pointer-types]
   8712 |   gfs_info->free_extent_hook = free_extent_hook;

And obviously, this would screwup original mode repair.

[CAUSE]
Commit b91222b3 ("btrfs-progs: check: drop unused fs_info") removes the
fs_info parameter for free_extent_hook(), but didn't remove the
parameter for the definition.

[FIX]
Also remove the fs_info parameter for the hook definition.

Fixes: b91222b3 ("btrfs-progs: check: drop unused fs_info")
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 kernel-shared/ctree.h       | 3 +--
 kernel-shared/extent-tree.c | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h
index 78d268e226fd..7683b8bbf0b4 100644
--- a/kernel-shared/ctree.h
+++ b/kernel-shared/ctree.h
@@ -1201,8 +1201,7 @@ struct btrfs_fs_info {
 
 	int transaction_aborted;
 
-	int (*free_extent_hook)(struct btrfs_fs_info *fs_info,
-				u64 bytenr, u64 num_bytes, u64 parent,
+	int (*free_extent_hook)(u64 bytenr, u64 num_bytes, u64 parent,
 				u64 root_objectid, u64 owner, u64 offset,
 				int refs_to_drop);
 	struct cache_tree *fsck_extent_cache;
diff --git a/kernel-shared/extent-tree.c b/kernel-shared/extent-tree.c
index e29ff433196f..5b1fbe10283a 100644
--- a/kernel-shared/extent-tree.c
+++ b/kernel-shared/extent-tree.c
@@ -1921,7 +1921,7 @@ static int __free_extent(struct btrfs_trans_handle *trans,
 		btrfs_fs_incompat(extent_root->fs_info, SKINNY_METADATA);
 
 	if (trans->fs_info->free_extent_hook) {
-		trans->fs_info->free_extent_hook(trans->fs_info, bytenr, num_bytes,
+		trans->fs_info->free_extent_hook(bytenr, num_bytes,
 						parent, root_objectid, owner_objectid,
 						owner_offset, refs_to_drop);
 
-- 
2.28.0


  reply	other threads:[~2020-08-26  0:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26  0:47 [PATCH 0/2] btrfs-progs: small compile warning fixes Qu Wenruo
2020-08-26  0:47 ` Qu Wenruo [this message]
2020-08-26 14:26   ` [PATCH 1/2] btrfs-progs: fix compile warning due to global fs_info cleanup Josef Bacik
2020-08-28 16:06   ` David Sterba
2020-08-26  0:47 ` [PATCH 2/2] btrfs-progs: remove the unused variable in check_chunks_and_extents_lowmem() Qu Wenruo
2020-08-26 14:29   ` Josef Bacik
2020-08-28 16:06   ` David Sterba
2020-08-26 15:31 ` [PATCH 0/2] btrfs-progs: small compile warning fixes David Sterba
2020-08-26 15:43   ` 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=20200826004734.89905-2-wqu@suse.com \
    --to=wqu@suse.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 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).