* btrfs-progs: drop weird indirections & dead code from send/receive
@ 2013-08-03 1:24 Eric Sandeen
2013-08-08 11:04 ` Stefan Behrens
0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2013-08-03 1:24 UTC (permalink / raw)
To: linux-btrfs, Stefan Behrens
cmds-recieve.c & cmds-send.c seem to have weird wrappers and
indirections, and "groups" of commands which have only
one member, which are never referenced in the code.
I think these can be removed.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
cmds-receive.c | 19 +------------------
cmds-send.c | 12 +-----------
commands.h | 2 --
3 files changed, 2 insertions(+), 31 deletions(-)
Stefan, I'd appreciate your review & testing of this though!
TBH it's an old patch I had laying around, but I have
not re-tested it recently.
Thanks,
-Eric
diff --git a/cmds-receive.c b/cmds-receive.c
index 4e480f9..7abce76 100644
--- a/cmds-receive.c
+++ b/cmds-receive.c
@@ -907,7 +907,7 @@ out:
return ret;
}
-static int do_cmd_receive(int argc, char **argv)
+int cmd_receive(int argc, char **argv)
{
int c;
char *tomnt = NULL;
@@ -960,11 +960,6 @@ static int do_cmd_receive(int argc, char **argv)
return ret;
}
-static const char * const receive_cmd_group_usage[] = {
- "btrfs receive <command> <args>",
- NULL
-};
-
const char * const cmd_receive_usage[] = {
"btrfs receive [-ve] [-f <infile>] <mount>",
"Receive subvolumes from stdin.",
@@ -988,15 +983,3 @@ const char * const cmd_receive_usage[] = {
" is recognized or on EOF.",
NULL
};
-
-const struct cmd_group receive_cmd_group = {
- receive_cmd_group_usage, NULL, {
- { "receive", do_cmd_receive, cmd_receive_usage, NULL, 0 },
- { 0, 0, 0, 0, 0 },
- },
-};
-
-int cmd_receive(int argc, char **argv)
-{
- return do_cmd_receive(argc, argv);
-}
diff --git a/cmds-send.c b/cmds-send.c
index 7209aba..f9899f4 100644
--- a/cmds-send.c
+++ b/cmds-send.c
@@ -465,7 +465,7 @@ out:
return ret;
}
-int cmd_send_start(int argc, char **argv)
+int cmd_send(int argc, char **argv)
{
char *subvol = NULL;
int c;
@@ -718,11 +718,6 @@ out:
return ret;
}
-static const char * const send_cmd_group_usage[] = {
- "btrfs send <command> <args>",
- NULL
-};
-
const char * const cmd_send_usage[] = {
"btrfs send [-ve] [-p <parent>] [-c <clone-src>] <subvol>",
"Send the subvolume to stdout.",
@@ -750,8 +745,3 @@ const char * const cmd_send_usage[] = {
" use pipes.",
NULL
};
-
-int cmd_send(int argc, char **argv)
-{
- return cmd_send_start(argc, argv);
-}
diff --git a/commands.h b/commands.h
index 65829f4..3f12fab 100644
--- a/commands.h
+++ b/commands.h
@@ -85,8 +85,6 @@ extern const struct cmd_group balance_cmd_group;
extern const struct cmd_group device_cmd_group;
extern const struct cmd_group scrub_cmd_group;
extern const struct cmd_group inspect_cmd_group;
-extern const struct cmd_group send_cmd_group;
-extern const struct cmd_group receive_cmd_group;
extern const struct cmd_group quota_cmd_group;
extern const struct cmd_group qgroup_cmd_group;
extern const struct cmd_group replace_cmd_group;
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: btrfs-progs: drop weird indirections & dead code from send/receive
2013-08-03 1:24 btrfs-progs: drop weird indirections & dead code from send/receive Eric Sandeen
@ 2013-08-08 11:04 ` Stefan Behrens
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Behrens @ 2013-08-08 11:04 UTC (permalink / raw)
To: Eric Sandeen; +Cc: linux-btrfs
On Fri, 02 Aug 2013 20:24:55 -0500, Eric Sandeen wrote:
> cmds-recieve.c & cmds-send.c seem to have weird wrappers and
> indirections, and "groups" of commands which have only
> one member, which are never referenced in the code.
>
> I think these can be removed.
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>
> cmds-receive.c | 19 +------------------
> cmds-send.c | 12 +-----------
> commands.h | 2 --
> 3 files changed, 2 insertions(+), 31 deletions(-)
>
> Stefan, I'd appreciate your review & testing of this though!
> TBH it's an old patch I had laying around, but I have
> not re-tested it recently.
Reviewed & tested without issues.
> diff --git a/cmds-receive.c b/cmds-receive.c
> index 4e480f9..7abce76 100644
> --- a/cmds-receive.c
> +++ b/cmds-receive.c
> @@ -907,7 +907,7 @@ out:
> return ret;
> }
>
> -static int do_cmd_receive(int argc, char **argv)
> +int cmd_receive(int argc, char **argv)
> {
> int c;
> char *tomnt = NULL;
> @@ -960,11 +960,6 @@ static int do_cmd_receive(int argc, char **argv)
> return ret;
> }
>
> -static const char * const receive_cmd_group_usage[] = {
> - "btrfs receive <command> <args>",
> - NULL
> -};
> -
> const char * const cmd_receive_usage[] = {
> "btrfs receive [-ve] [-f <infile>] <mount>",
> "Receive subvolumes from stdin.",
> @@ -988,15 +983,3 @@ const char * const cmd_receive_usage[] = {
> " is recognized or on EOF.",
> NULL
> };
> -
> -const struct cmd_group receive_cmd_group = {
> - receive_cmd_group_usage, NULL, {
> - { "receive", do_cmd_receive, cmd_receive_usage, NULL, 0 },
> - { 0, 0, 0, 0, 0 },
> - },
> -};
> -
> -int cmd_receive(int argc, char **argv)
> -{
> - return do_cmd_receive(argc, argv);
> -}
> diff --git a/cmds-send.c b/cmds-send.c
> index 7209aba..f9899f4 100644
> --- a/cmds-send.c
> +++ b/cmds-send.c
> @@ -465,7 +465,7 @@ out:
> return ret;
> }
>
> -int cmd_send_start(int argc, char **argv)
> +int cmd_send(int argc, char **argv)
> {
> char *subvol = NULL;
> int c;
> @@ -718,11 +718,6 @@ out:
> return ret;
> }
>
> -static const char * const send_cmd_group_usage[] = {
> - "btrfs send <command> <args>",
> - NULL
> -};
> -
> const char * const cmd_send_usage[] = {
> "btrfs send [-ve] [-p <parent>] [-c <clone-src>] <subvol>",
> "Send the subvolume to stdout.",
> @@ -750,8 +745,3 @@ const char * const cmd_send_usage[] = {
> " use pipes.",
> NULL
> };
> -
> -int cmd_send(int argc, char **argv)
> -{
> - return cmd_send_start(argc, argv);
> -}
> diff --git a/commands.h b/commands.h
> index 65829f4..3f12fab 100644
> --- a/commands.h
> +++ b/commands.h
> @@ -85,8 +85,6 @@ extern const struct cmd_group balance_cmd_group;
> extern const struct cmd_group device_cmd_group;
> extern const struct cmd_group scrub_cmd_group;
> extern const struct cmd_group inspect_cmd_group;
> -extern const struct cmd_group send_cmd_group;
> -extern const struct cmd_group receive_cmd_group;
> extern const struct cmd_group quota_cmd_group;
> extern const struct cmd_group qgroup_cmd_group;
> extern const struct cmd_group replace_cmd_group;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-08 11:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-03 1:24 btrfs-progs: drop weird indirections & dead code from send/receive Eric Sandeen
2013-08-08 11:04 ` Stefan Behrens
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).