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 v2 11/13] btrfs-progs: Introduce rescue.h to resolve missing-prototypes for chunk and super rescue
Date: Wed,  5 Dec 2018 14:40:16 +0800	[thread overview]
Message-ID: <20181205064018.27755-12-wqu@suse.com> (raw)
In-Reply-To: <20181205064018.27755-1-wqu@suse.com>

We don't have any header declaring btrfs_recover_chunk_tree() nor
btrfs_recover_superblocks(), thus W=1 gives missing-prototypes warning
on them.

Fix it by introducing a new header, rescue.h for these two functions, so
make W=1 could be much happier.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
---
 chunk-recover.c |  1 +
 cmds-rescue.c   |  4 +---
 rescue.h        | 21 +++++++++++++++++++++
 super-recover.c |  1 +
 4 files changed, 24 insertions(+), 3 deletions(-)
 create mode 100644 rescue.h

diff --git a/chunk-recover.c b/chunk-recover.c
index 1d30db51d8ed..1e554b8e8750 100644
--- a/chunk-recover.c
+++ b/chunk-recover.c
@@ -40,6 +40,7 @@
 #include "utils.h"
 #include "btrfsck.h"
 #include "commands.h"
+#include "rescue.h"
 
 struct recover_control {
 	int verbose;
diff --git a/cmds-rescue.c b/cmds-rescue.c
index 2bc50c0841ed..36e9e1277e40 100644
--- a/cmds-rescue.c
+++ b/cmds-rescue.c
@@ -26,15 +26,13 @@
 #include "commands.h"
 #include "utils.h"
 #include "help.h"
+#include "rescue.h"
 
 static const char * const rescue_cmd_group_usage[] = {
 	"btrfs rescue <command> [options] <path>",
 	NULL
 };
 
-int btrfs_recover_chunk_tree(const char *path, int verbose, int yes);
-int btrfs_recover_superblocks(const char *path, int verbose, int yes);
-
 static const char * const cmd_rescue_chunk_recover_usage[] = {
 	"btrfs rescue chunk-recover [options] <device>",
 	"Recover the chunk tree by scanning the devices one by one.",
diff --git a/rescue.h b/rescue.h
new file mode 100644
index 000000000000..de486e2e2004
--- /dev/null
+++ b/rescue.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2018 SUSE.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License v2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef __BTRFS_RESCUE_H__
+#define __BTRFS_RESCUE_H__
+
+int btrfs_recover_superblocks(const char *path, int verbose, int yes);
+int btrfs_recover_chunk_tree(const char *path, int verbose, int yes);
+
+#endif
diff --git a/super-recover.c b/super-recover.c
index 86b3df9867dc..a1af71786034 100644
--- a/super-recover.c
+++ b/super-recover.c
@@ -34,6 +34,7 @@
 #include "crc32c.h"
 #include "volumes.h"
 #include "commands.h"
+#include "rescue.h"
 
 struct btrfs_recover_superblock {
 	struct btrfs_fs_devices *fs_devices;
-- 
2.19.2


  parent reply	other threads:[~2018-12-05  6:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-05  6:40 [PATCH v2 00/13] btrfs-progs: Make W=1 great (no "again") Qu Wenruo
2018-12-05  6:40 ` [PATCH v2 01/13] btrfs-progs: Makefile.extrawarn: Import cc-disable-warning Qu Wenruo
2018-12-05  6:40 ` [PATCH v2 02/13] btrfs-progs: fix gcc8 default build warning caused by '-Wformat-truncation' Qu Wenruo
2018-12-05  6:40 ` [PATCH v2 03/13] btrfs-progs: Makefile.extrawarn: Don't warn on sign compare Qu Wenruo
2018-12-05  6:40 ` [PATCH v2 04/13] btrfs-progs: Fix Wempty-body warning Qu Wenruo
2018-12-13 18:59   ` David Sterba
2018-12-13 23:54     ` Qu Wenruo
2018-12-05  6:40 ` [PATCH v2 05/13] btrfs-progs: Fix Wimplicit-fallthrough warning Qu Wenruo
2018-12-05  6:40 ` [PATCH v2 06/13] btrfs-progs: Fix Wsuggest-attribute=format warning Qu Wenruo
2018-12-05  6:40 ` [PATCH v2 07/13] btrfs-progs: Fix Wmaybe-uninitialized warning Qu Wenruo
2018-12-05 13:40   ` David Sterba
2018-12-05 14:03     ` Qu Wenruo
2019-01-15 17:42       ` David Sterba
2018-12-05  6:40 ` [PATCH v2 08/13] btrfs-progs: Fix Wtype-limits warning Qu Wenruo
2018-12-05  6:40 ` [PATCH v2 09/13] btrfs-progs: Fix missing-prototypes warning caused by non-static functions Qu Wenruo
2018-12-05  6:40 ` [PATCH v2 10/13] btrfs-progs: Move btrfs_check_nodesize to fsfeatures.c to fix missing-prototypes warning Qu Wenruo
2018-12-05  6:40 ` Qu Wenruo [this message]
2018-12-05  6:40 ` [PATCH v2 12/13] btrfs-progs: Add utils.h include to solve " Qu Wenruo
2018-12-05  6:40 ` [PATCH v2 13/13] btrfs-progs: free-space-tree: Remove unsued function Qu Wenruo

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=20181205064018.27755-12-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).