From patchwork Sat Aug 3 01:24:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 2838237 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 340079F3B8 for ; Sat, 3 Aug 2013 01:25:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 424162022F for ; Sat, 3 Aug 2013 01:25:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 361BD20219 for ; Sat, 3 Aug 2013 01:25:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755386Ab3HCBZA (ORCPT ); Fri, 2 Aug 2013 21:25:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38873 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753739Ab3HCBZA (ORCPT ); Fri, 2 Aug 2013 21:25:00 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r731Ov3A014858 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 2 Aug 2013 21:24:57 -0400 Received: from Liberator.local (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r731OtZ4021599 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 2 Aug 2013 21:24:56 -0400 Message-ID: <51FC5BE7.2080506@redhat.com> Date: Fri, 02 Aug 2013 20:24:55 -0500 From: Eric Sandeen User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: linux-btrfs , Stefan Behrens Subject: btrfs-progs: drop weird indirections & dead code from send/receive X-Enigmail-Version: 1.5.2 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 ", - NULL -}; - const char * const cmd_receive_usage[] = { "btrfs receive [-ve] [-f ] ", "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 ", - NULL -}; - const char * const cmd_send_usage[] = { "btrfs send [-ve] [-p ] [-c ] ", "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;