From: jeffm@suse.com
To: linux-btrfs@vger.kernel.org
Cc: Jeff Mahoney <jeffm@suse.com>
Subject: [PATCH 10/18] btrfs-progs: reorder placement of help declarations for send/receive
Date: Wed, 16 May 2018 17:38:43 -0400 [thread overview]
Message-ID: <20180516213851.10196-11-jeffm@suse.com> (raw)
In-Reply-To: <20180516213851.10196-1-jeffm@suse.com>
From: Jeff Mahoney <jeffm@suse.com>
The usage definitions for send and receive follow the command
definitions, which use them. This works because we declare them
in commands.h. When we move to using cmd_struct as the entry point,
these declarations will be removed, breaking the commands. Since
that would be an otherwise unrelated change, this patch reorders
them separately.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
cmds-receive.c | 62 ++++++++++++++++++++++++++--------------------------
cmds-send.c | 69 +++++++++++++++++++++++++++++-----------------------------
2 files changed, 66 insertions(+), 65 deletions(-)
diff --git a/cmds-receive.c b/cmds-receive.c
index 68123a31..b3709f36 100644
--- a/cmds-receive.c
+++ b/cmds-receive.c
@@ -1248,6 +1248,37 @@ out:
return ret;
}
+const char * const cmd_receive_usage[] = {
+ "btrfs receive [options] <mount>\n"
+ "btrfs receive --dump [options]",
+ "Receive subvolumes from a stream",
+ "Receives one or more subvolumes that were previously",
+ "sent with btrfs send. The received subvolumes are stored",
+ "into MOUNT.",
+ "The receive will fail in case the receiving subvolume",
+ "already exists. It will also fail in case a previously",
+ "received subvolume has been changed after it was received.",
+ "After receiving a subvolume, it is immediately set to",
+ "read-only.",
+ "",
+ "-v increase verbosity about performed actions",
+ "-f FILE read the stream from FILE instead of stdin",
+ "-e terminate after receiving an <end cmd> marker in the stream.",
+ " Without this option the receiver side terminates only in case",
+ " of an error on end of file.",
+ "-C|--chroot confine the process to <mount> using chroot",
+ "-E|--max-errors NERR",
+ " terminate as soon as NERR errors occur while",
+ " stream processing commands from the stream.",
+ " Default value is 1. A value of 0 means no limit.",
+ "-m ROOTMOUNT the root mount point of the destination filesystem.",
+ " If /proc is not accessible, use this to tell us where",
+ " this file system is mounted.",
+ "--dump dump stream metadata, one line per operation,",
+ " does not require the MOUNT parameter",
+ NULL
+};
+
int cmd_receive(int argc, char **argv)
{
char *tomnt = NULL;
@@ -1357,34 +1388,3 @@ out:
return !!ret;
}
-
-const char * const cmd_receive_usage[] = {
- "btrfs receive [options] <mount>\n"
- "btrfs receive --dump [options]",
- "Receive subvolumes from a stream",
- "Receives one or more subvolumes that were previously",
- "sent with btrfs send. The received subvolumes are stored",
- "into MOUNT.",
- "The receive will fail in case the receiving subvolume",
- "already exists. It will also fail in case a previously",
- "received subvolume has been changed after it was received.",
- "After receiving a subvolume, it is immediately set to",
- "read-only.",
- "",
- "-v increase verbosity about performed actions",
- "-f FILE read the stream from FILE instead of stdin",
- "-e terminate after receiving an <end cmd> marker in the stream.",
- " Without this option the receiver side terminates only in case",
- " of an error on end of file.",
- "-C|--chroot confine the process to <mount> using chroot",
- "-E|--max-errors NERR",
- " terminate as soon as NERR errors occur while",
- " stream processing commands from the stream.",
- " Default value is 1. A value of 0 means no limit.",
- "-m ROOTMOUNT the root mount point of the destination filesystem.",
- " If /proc is not accessible, use this to tell us where",
- " this file system is mounted.",
- "--dump dump stream metadata, one line per operation,",
- " does not require the MOUNT parameter",
- NULL
-};
diff --git a/cmds-send.c b/cmds-send.c
index c5ecdaa1..8365e9c9 100644
--- a/cmds-send.c
+++ b/cmds-send.c
@@ -489,6 +489,41 @@ static void free_send_info(struct btrfs_send *sctx)
subvol_uuid_search_finit(&sctx->sus);
}
+
+const char * const cmd_send_usage[] = {
+ "btrfs send [-ve] [-p <parent>] [-c <clone-src>] [-f <outfile>] <subvol> [<subvol>...]",
+ "Send the subvolume(s) to stdout.",
+ "Sends the subvolume(s) specified by <subvol> to stdout.",
+ "<subvol> should be read-only here.",
+ "By default, this will send the whole subvolume. To do an incremental",
+ "send, use '-p <parent>'. If you want to allow btrfs to clone from",
+ "any additional local snapshots, use '-c <clone-src>' (multiple times",
+ "where applicable). You must not specify clone sources unless you",
+ "guarantee that these snapshots are exactly in the same state on both",
+ "sides, the sender and the receiver. It is allowed to omit the",
+ "'-p <parent>' option when '-c <clone-src>' options are given, in",
+ "which case 'btrfs send' will determine a suitable parent among the",
+ "clone sources itself.",
+ "\n",
+ "-e If sending multiple subvols at once, use the new",
+ " format and omit the end-cmd between the subvols.",
+ "-p <parent> Send an incremental stream from <parent> to",
+ " <subvol>.",
+ "-c <clone-src> Use this snapshot as a clone source for an ",
+ " incremental send (multiple allowed)",
+ "-f <outfile> Output is normally written to stdout. To write to",
+ " a file, use this option. An alternative would be to",
+ " use pipes.",
+ "--no-data send in NO_FILE_DATA mode, Note: the output stream",
+ " does not contain any file data and thus cannot be used",
+ " to transfer changes. This mode is faster and useful to",
+ " show the differences in metadata.",
+ "-v|--verbose enable verbose output to stderr, each occurrence of",
+ " this option increases verbosity",
+ "-q|--quiet suppress all messages, except errors",
+ NULL
+};
+
int cmd_send(int argc, char **argv)
{
char *subvol = NULL;
@@ -774,37 +809,3 @@ out:
free_send_info(&send);
return !!ret;
}
-
-const char * const cmd_send_usage[] = {
- "btrfs send [-ve] [-p <parent>] [-c <clone-src>] [-f <outfile>] <subvol> [<subvol>...]",
- "Send the subvolume(s) to stdout.",
- "Sends the subvolume(s) specified by <subvol> to stdout.",
- "<subvol> should be read-only here.",
- "By default, this will send the whole subvolume. To do an incremental",
- "send, use '-p <parent>'. If you want to allow btrfs to clone from",
- "any additional local snapshots, use '-c <clone-src>' (multiple times",
- "where applicable). You must not specify clone sources unless you",
- "guarantee that these snapshots are exactly in the same state on both",
- "sides, the sender and the receiver. It is allowed to omit the",
- "'-p <parent>' option when '-c <clone-src>' options are given, in",
- "which case 'btrfs send' will determine a suitable parent among the",
- "clone sources itself.",
- "\n",
- "-e If sending multiple subvols at once, use the new",
- " format and omit the end-cmd between the subvols.",
- "-p <parent> Send an incremental stream from <parent> to",
- " <subvol>.",
- "-c <clone-src> Use this snapshot as a clone source for an ",
- " incremental send (multiple allowed)",
- "-f <outfile> Output is normally written to stdout. To write to",
- " a file, use this option. An alternative would be to",
- " use pipes.",
- "--no-data send in NO_FILE_DATA mode, Note: the output stream",
- " does not contain any file data and thus cannot be used",
- " to transfer changes. This mode is faster and useful to",
- " show the differences in metadata.",
- "-v|--verbose enable verbose output to stderr, each occurrence of",
- " this option increases verbosity",
- "-q|--quiet suppress all messages, except errors",
- NULL
-};
--
2.15.1
next prev parent reply other threads:[~2018-05-16 21:39 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-16 21:38 [PATCH v3 00/18] btrfs-progs: qgroups-usability jeffm
2018-05-16 21:38 ` [PATCH 01/18] btrfs-progs: quota: Add -W option to rescan to wait without starting rescan jeffm
2018-05-16 21:38 ` [PATCH 02/18] btrfs-progs: qgroups: fix misleading index check jeffm
2018-05-16 21:38 ` [PATCH 03/18] btrfs-progs: constify pathnames passed as arguments jeffm
2018-05-16 21:38 ` [PATCH 04/18] btrfs-progs: btrfs-list: add rb_entry helpers for root_info jeffm
2018-05-16 21:38 ` [PATCH 05/18] btrfs-progs: qgroups: add pathname to show output jeffm
2018-05-18 4:55 ` Misono Tomohiro
2018-05-16 21:38 ` [PATCH 06/18] btrfs-progs: qgroups: introduce and use info and limit structures jeffm
2018-05-16 21:38 ` [PATCH 07/18] btrfs-progs: qgroups: introduce btrfs_qgroup_query jeffm
2018-05-16 21:38 ` [PATCH 08/18] btrfs-progs: subvolume: add quota info to btrfs sub show jeffm
2018-05-16 21:38 ` [PATCH 09/18] btrfs-progs: help: convert ints used as bools to bool jeffm
2018-05-16 21:38 ` jeffm [this message]
2018-05-16 21:38 ` [PATCH 11/18] btrfs-progs: filesystem balance: split out special handling jeffm
2018-05-16 21:38 ` [PATCH 12/18] btrfs-progs: use cmd_struct as command entry point jeffm
2018-05-16 21:38 ` [PATCH 13/18] btrfs-progs: pass cmd_struct to command callback function jeffm
2018-05-16 21:38 ` [PATCH 14/18] btrfs-progs: pass cmd_struct to clean_args_no_options{,_relaxed} jeffm
2018-05-16 21:38 ` [PATCH 15/18] btrfs-progs: pass cmd_struct to usage() jeffm
2018-05-16 21:38 ` [PATCH 16/18] btrfs-progs: add support for output formats jeffm
2018-05-16 21:38 ` [PATCH 17/18] btrfs-progs: handle command groups directly for common case jeffm
2018-05-16 21:38 ` [PATCH 18/18] btrfs-progs: qgroups: don't print dead qgroups jeffm
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=20180516213851.10196-11-jeffm@suse.com \
--to=jeffm@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).