From patchwork Thu Aug 24 05:25:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Misono Tomohiro X-Patchwork-Id: 9919067 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 9663460349 for ; Thu, 24 Aug 2017 05:25:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88D6D28B48 for ; Thu, 24 Aug 2017 05:25:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DC2228B58; Thu, 24 Aug 2017 05:25:50 +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 4DC9E28B48 for ; Thu, 24 Aug 2017 05:25:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751128AbdHXFZo (ORCPT ); Thu, 24 Aug 2017 01:25:44 -0400 Received: from mgwkm04.jp.fujitsu.com ([202.219.69.171]:31616 "EHLO mgwkm04.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751105AbdHXFZn (ORCPT ); Thu, 24 Aug 2017 01:25:43 -0400 Received: from kw-mxoi2.gw.nic.fujitsu.com (unknown [192.168.231.133]) by mgwkm04.jp.fujitsu.com with smtp id 3cd6_27c8_0f553693_3485_49fb_b15b_488082beae84; Thu, 24 Aug 2017 14:25:39 +0900 Received: from g01jpfmpwkw01.exch.g01.fujitsu.local (g01jpfmpwkw01.exch.g01.fujitsu.local [10.0.193.38]) by kw-mxoi2.gw.nic.fujitsu.com (Postfix) with ESMTP id ABBD2AC0185 for ; Thu, 24 Aug 2017 14:25:36 +0900 (JST) Received: from g01jpexchkw37.g01.fujitsu.local (unknown [10.0.193.4]) by g01jpfmpwkw01.exch.g01.fujitsu.local (Postfix) with ESMTP id DEE466926E5 for ; Thu, 24 Aug 2017 14:25:35 +0900 (JST) X-SecurityPolicyCheck: OK by SHieldMailChecker v2.5.2 X-SHieldMailCheckerPolicyVersion: FJ-ISEC-20170217-enc X-SHieldMailCheckerMailID: c345531a588e440cbe46be1bce11114e Subject: [PATCH 3/3] btrfs-progs: fix option handling for some commands From: "Misono, Tomohiro" To: References: <2ea1dea7-13b5-b984-03ce-2d88d4f9d220@jp.fujitsu.com> Message-ID: Date: Thu, 24 Aug 2017 14:25:29 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <2ea1dea7-13b5-b984-03ce-2d88d4f9d220@jp.fujitsu.com> Content-Language: en-US X-SecurityPolicyCheck-GC: OK by FENCE-Mail 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 This fixes "btrfs inspect-internal dump-super --bytenr" Signed-off-by: Tomohiro Misono --- cmds-inspect-dump-super.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmds-inspect-dump-super.c b/cmds-inspect-dump-super.c index 98e0270..c7afd80 100644 --- a/cmds-inspect-dump-super.c +++ b/cmds-inspect-dump-super.c @@ -519,11 +519,13 @@ int cmd_inspect_dump_super(int argc, char **argv) while (1) { int c; + enum { GETOPT_VAL_BYTENR = 257 }; static const struct option long_options[] = { {"all", no_argument, NULL, 'a'}, {"full", no_argument, NULL, 'f'}, {"force", no_argument, NULL, 'F'}, {"super", required_argument, NULL, 's' }, + {"bytenr", required_argument, NULL, GETOPT_VAL_BYTENR }, {NULL, 0, NULL, 0} }; @@ -565,6 +567,11 @@ int cmd_inspect_dump_super(int argc, char **argv) } all = 0; break; + case GETOPT_VAL_BYTENR: + arg = arg_strtou64(optarg); + sb_bytenr = arg; + all = 0; + break; default: usage(cmd_inspect_dump_super_usage); }