From patchwork Wed Oct 19 03:45:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsutomu Itoh X-Patchwork-Id: 9383563 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 364F4600CA for ; Wed, 19 Oct 2016 03:46:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24FA92982B for ; Wed, 19 Oct 2016 03:46:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15C2029814; Wed, 19 Oct 2016 03:46:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00FD929814 for ; Wed, 19 Oct 2016 03:46:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933941AbcJSDqU (ORCPT ); Tue, 18 Oct 2016 23:46:20 -0400 Received: from mgwkm04.jp.fujitsu.com ([202.219.69.171]:40748 "EHLO mgwkm04.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752481AbcJSDqT (ORCPT ); Tue, 18 Oct 2016 23:46:19 -0400 Received: from kw-mxauth.gw.nic.fujitsu.com (unknown [192.168.231.132]) by mgwkm04.jp.fujitsu.com with smtp id 2ca6_1811_26be292b_f6f6_43a8_9baf_948611c74e65; Wed, 19 Oct 2016 12:46:13 +0900 Received: from m3050.s.css.fujitsu.com (msm.b.css.fujitsu.com [10.134.21.208]) by kw-mxauth.gw.nic.fujitsu.com (Postfix) with ESMTP id CBFC5AC0185 for ; Wed, 19 Oct 2016 12:46:12 +0900 (JST) Received: from WIN-5MHF4RKU941.jp.fujitsu.com (unknown [10.124.102.163]) by m3050.s.css.fujitsu.com (Postfix) with SMTP id AFF35446 for ; Wed, 19 Oct 2016 12:46:12 +0900 (JST) X-SecurityPolicyCheck: OK by SHieldMailChecker v2.3.2 X-SHieldMailCheckerPolicyVersion: FJ-ISEC-20150223 X-SHieldMailCheckerMailID: 871ffe50fc1845c899f3b06f4fa9d513 Message-Id: <201610190345.AA00004@WIN-5MHF4RKU941.jp.fujitsu.com> From: Tsutomu Itoh Date: Wed, 19 Oct 2016 12:45:57 +0900 To: linux-btrfs@vger.kernel.org Subject: [PATCH v2 1/3] btrfs-progs: send: remove unnecessary code MIME-Version: 1.0 X-Mailer: AL-Mail32 Version 1.13 X-TM-AS-MML: disable Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some unnecessary codes are deleted. - the setting of subvol is double. - read only check was already done by previous loop. Signed-off-by: Tsutomu Itoh --- v2: description was changed --- cmds-send.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/cmds-send.c b/cmds-send.c index 74d0128..dfdfe01 100644 --- a/cmds-send.c +++ b/cmds-send.c @@ -564,8 +564,6 @@ int cmd_send(int argc, char **argv) } /* use first send subvol to determine mount_root */ - subvol = argv[optind]; - subvol = realpath(argv[optind], NULL); if (!subvol) { ret = -errno; @@ -661,15 +659,6 @@ int cmd_send(int argc, char **argv) } } - ret = is_subvol_ro(&send, subvol); - if (ret < 0) - goto out; - if (!ret) { - ret = -EINVAL; - error("subvolume %s is not read-only", subvol); - goto out; - } - if (new_end_cmd_semantic) { /* require new kernel */ is_first_subvol = (i == optind);